summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2009-06-26 18:55:01 +0000
committerChris Lattner <sabre@nondot.org>2009-06-26 18:55:01 +0000
commit89ca575c310457304d53be93749fdc284e424375 (patch)
treead84043b7e9c0564e73a7124a602e4544283a7e0
parentd2deed00918d788d3b3ea37ea7a5879e971859c1 (diff)
downloadllvm-89ca575c310457304d53be93749fdc284e424375.tar.gz
llvm-89ca575c310457304d53be93749fdc284e424375.tar.bz2
llvm-89ca575c310457304d53be93749fdc284e424375.tar.xz
use jump table operand flags in asm printer instead of "magic predicates"
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@74310 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.cpp24
1 files changed, 18 insertions, 6 deletions
diff --git a/lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.cpp b/lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.cpp
index 726c1ae587..6d27710236 100644
--- a/lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.cpp
+++ b/lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.cpp
@@ -455,13 +455,25 @@ void X86ATTAsmPrinter::printOperand(const MachineInstr *MI, unsigned OpNo,
O << TAI->getPrivateGlobalPrefix() << "JTI" << getFunctionNumber() << '_'
<< MO.getIndex();
- if (TM.getRelocationModel() == Reloc::PIC_) {
- if (Subtarget->isPICStyleStub()) {
- O << '-';
- PrintPICBaseSymbol();
- } else if (Subtarget->isPICStyleGOT()) {
- O << "@GOTOFF";
+ switch (MO.getTargetFlags()) {
+ default:
+ assert(0 && "Unknown target flag on jump table operand");
+ case X86II::MO_NO_FLAG:
+ // FIXME: REMOVE EVENTUALLY.
+ if (TM.getRelocationModel() == Reloc::PIC_) {
+ assert(!Subtarget->isPICStyleStub() &&
+ !Subtarget->isPICStyleGOT() &&
+ "Should have operand flag!");
}
+
+ break;
+ case X86II::MO_PIC_BASE_OFFSET:
+ O << '-';
+ PrintPICBaseSymbol();
+ break;
+ case X86II::MO_GOTOFF:
+ O << "@GOTOFF";
+ break;
}
if (isMemOp && Subtarget->isPICStyleRIPRel() && !NotRIPRel)