diff options
author | Chris Lattner <sabre@nondot.org> | 2009-06-20 07:59:10 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2009-06-20 07:59:10 +0000 |
commit | dc479f6ebf38c862e75eace7b24c3232249b7ec2 (patch) | |
tree | d0f2ba7331d953502d425d06ffe0a9194530b7a6 /lib/Target/X86/AsmPrinter/X86ATTInstPrinter.cpp | |
parent | c12430644a9f49a056286f8ebe0e55ccc23bdde0 (diff) |
some comments and cleanup
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73818 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/X86/AsmPrinter/X86ATTInstPrinter.cpp')
-rw-r--r-- | lib/Target/X86/AsmPrinter/X86ATTInstPrinter.cpp | 17 |
1 files changed, 4 insertions, 13 deletions
diff --git a/lib/Target/X86/AsmPrinter/X86ATTInstPrinter.cpp b/lib/Target/X86/AsmPrinter/X86ATTInstPrinter.cpp index 0311a10a17..fd31aaf933 100644 --- a/lib/Target/X86/AsmPrinter/X86ATTInstPrinter.cpp +++ b/lib/Target/X86/AsmPrinter/X86ATTInstPrinter.cpp @@ -348,7 +348,6 @@ void X86ATTAsmPrinter::printOperand(const MCInst *MI, unsigned OpNo, } void X86ATTAsmPrinter::printLeaMemReference(const MCInst *MI, unsigned Op) { - const char *Modifier = 0; bool NotRIPRel = false; const MCOperand &BaseReg = MI->getOperand(Op); @@ -368,28 +367,20 @@ void X86ATTAsmPrinter::printLeaMemReference(const MCInst *MI, unsigned Op) { } if (IndexReg.getReg() || BaseReg.getReg()) { - unsigned ScaleVal = MI->getOperand(Op+1).getImm(); - unsigned BaseRegOperand = 0, IndexRegOperand = 2; - // There are cases where we can end up with ESP/RSP in the indexreg slot. // If this happens, swap the base/index register to support assemblers that // don't work when the index is *SP. // FIXME: REMOVE THIS. - if (IndexReg.getReg() == X86::ESP || IndexReg.getReg() == X86::RSP) { - assert(ScaleVal == 1 && "Scale not supported for stack pointer!"); - abort(); - //std::swap(BaseReg, IndexReg); - //std::swap(BaseRegOperand, IndexRegOperand); - } + assert(IndexReg.getReg() != X86::ESP && IndexReg.getReg() != X86::RSP); O << '('; if (BaseReg.getReg()) - printOperand(MI, Op+BaseRegOperand, Modifier); + printOperand(MI, Op); if (IndexReg.getReg()) { O << ','; - printOperand(MI, Op+IndexRegOperand, Modifier); - if (ScaleVal != 1) + printOperand(MI, Op+2); + if (MI->getOperand(Op+1).getImm() != 1) O << ',' << ScaleVal; } O << ')'; |