[llvm-commits] CVS: llvm/lib/Target/PowerPC/PPCTargetAsmInfo.cpp

Chris Lattner sabre at nondot.org
Wed Jan 17 17:16:17 PST 2007



Changes in directory llvm/lib/Target/PowerPC:

PPCTargetAsmInfo.cpp updated: 1.13 -> 1.14
---
Log message:

Modify emission of jump tables on darwin to emit an extra "l" label that
delimits the boundaries of jump tables.  This lets the linker's dead code
stripping optimization do a better job.


---
Diffs of the changes:  (+7 -0)

 PPCTargetAsmInfo.cpp |    7 +++++++
 1 files changed, 7 insertions(+)


Index: llvm/lib/Target/PowerPC/PPCTargetAsmInfo.cpp
diff -u llvm/lib/Target/PowerPC/PPCTargetAsmInfo.cpp:1.13 llvm/lib/Target/PowerPC/PPCTargetAsmInfo.cpp:1.14
--- llvm/lib/Target/PowerPC/PPCTargetAsmInfo.cpp:1.13	Tue Jan 16 03:29:16 2007
+++ llvm/lib/Target/PowerPC/PPCTargetAsmInfo.cpp	Wed Jan 17 19:15:58 2007
@@ -57,6 +57,13 @@
   UsedDirective = "\t.no_dead_strip\t";
   WeakRefDirective = "\t.weak_reference\t";
   HiddenDirective = "\t.private_extern\t";
+  
+  // In non-PIC modes, emit a special label before jump tables so that the
+  // linker can perform more accurate dead code stripping.
+  if (TM.getRelocationModel() != Reloc::PIC_) {
+    // Emit a local label that is preserved until the linker runs.
+    JumpTableSpecialLabelPrefix = "l";
+  }
 }
 
 LinuxTargetAsmInfo::LinuxTargetAsmInfo(const PPCTargetMachine &TM)






More information about the llvm-commits mailing list