Changes in directory llvm/lib/CodeGen:

AsmPrinter.cpp updated: 1.83 -> 1.84
---
Log message:

On 64-bit targets like ppc64, we should use .quad to output pointer directives,
not .long.


---
Diffs of the changes:  (+9 -1)

 AsmPrinter.cpp |   10 +++++++++-
 1 files changed, 9 insertions(+), 1 deletion(-)


Index: llvm/lib/CodeGen/AsmPrinter.cpp
diff -u llvm/lib/CodeGen/AsmPrinter.cpp:1.83 
llvm/lib/CodeGen/AsmPrinter.cpp:1.84
--- llvm/lib/CodeGen/AsmPrinter.cpp:1.83        Wed Jun 28 19:26:09 2006
+++ llvm/lib/CodeGen/AsmPrinter.cpp     Fri Jul 14 20:34:12 2006
@@ -217,12 +217,20 @@
   
   SwitchToDataSection(JumpTableSection, 0);
   EmitAlignment(Log2_32(TD->getPointerAlignment()));
+  
+  // Pick the directive to use based on the pointer size. FIXME: when we 
support
+  // PIC jumptables, this should always use the 32-bit directive for label
+  // differences. 
+  const char *PtrDataDirective = Data32bitsDirective;
+  if (TD->getPointerSize() == 8)
+    PtrDataDirective = Data64bitsDirective;
+
   for (unsigned i = 0, e = JT.size(); i != e; ++i) {
     O << PrivateGlobalPrefix << "JTI" << getFunctionNumber() << '_' << i 
       << ":\n";
     const std::vector<MachineBasicBlock*> &JTBBs = JT[i].MBBs;
     for (unsigned ii = 0, ee = JTBBs.size(); ii != ee; ++ii) {
-      O << Data32bitsDirective << ' ';
+      O << PtrDataDirective << ' ';
       printBasicBlockLabel(JTBBs[ii]);
       O << '\n';
     }



_______________________________________________
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits

Reply via email to