mirror of
https://github.com/RPCS3/llvm.git
synced 2024-12-23 04:28:30 +00:00
Avoid unnecessary +0 in experimental-asm-printer.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80603 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
6ceea33c5e
commit
64926be847
@ -802,9 +802,10 @@ MCOperand X86ATTAsmPrinter::LowerGlobalAddressOperand(const MachineOperand &MO){
|
||||
Expr = MCBinaryExpr::CreateSub(Expr, MCSymbolRefExpr::Create(NegatedSymbol,
|
||||
OutContext),
|
||||
OutContext);
|
||||
Expr = MCBinaryExpr::CreateAdd(Expr, MCConstantExpr::Create(MO.getOffset(),
|
||||
OutContext),
|
||||
OutContext);
|
||||
if (MO.getOffset())
|
||||
Expr = MCBinaryExpr::CreateAdd(Expr, MCConstantExpr::Create(MO.getOffset(),
|
||||
OutContext),
|
||||
OutContext);
|
||||
return MCOperand::CreateExpr(Expr);
|
||||
}
|
||||
|
||||
@ -819,10 +820,12 @@ LowerExternalSymbolOperand(const MachineOperand &MO){
|
||||
MCSymbol *Sym = OutContext.GetOrCreateSymbol(Name);
|
||||
// FIXME: We would like an efficient form for this, so we don't have to do a
|
||||
// lot of extra uniquing.
|
||||
const MCExpr *Expr =
|
||||
MCBinaryExpr::CreateAdd(MCSymbolRefExpr::Create(Sym, OutContext),
|
||||
MCConstantExpr::Create(MO.getOffset(),OutContext),
|
||||
OutContext);
|
||||
const MCExpr *Expr = MCSymbolRefExpr::Create(Sym, OutContext);
|
||||
if (MO.getOffset())
|
||||
Expr = MCBinaryExpr::CreateAdd(Expr,
|
||||
MCConstantExpr::Create(MO.getOffset(),
|
||||
OutContext),
|
||||
OutContext);
|
||||
return MCOperand::CreateExpr(Expr);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user