[llvm-commits] [llvm] r74310 - /llvm/trunk/lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.cpp

Chris Lattner sabre at nondot.org
Fri Jun 26 11:55:17 PDT 2009


Author: lattner
Date: Fri Jun 26 13:55:01 2009
New Revision: 74310

URL: http://llvm.org/viewvc/llvm-project?rev=74310&view=rev
Log:
use jump table operand flags in asm printer instead of "magic predicates"

Modified:
    llvm/trunk/lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.cpp

Modified: llvm/trunk/lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.cpp?rev=74310&r1=74309&r2=74310&view=diff

==============================================================================
--- llvm/trunk/lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.cpp (original)
+++ llvm/trunk/lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.cpp Fri Jun 26 13:55:01 2009
@@ -455,13 +455,25 @@
     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)





More information about the llvm-commits mailing list