[llvm-commits] CVS: llvm/lib/Target/X86/X86TargetAsmInfo.cpp

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



Changes in directory llvm/lib/Target/X86:

X86TargetAsmInfo.cpp updated: 1.29 -> 1.30
---
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)

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


Index: llvm/lib/Target/X86/X86TargetAsmInfo.cpp
diff -u llvm/lib/Target/X86/X86TargetAsmInfo.cpp:1.29 llvm/lib/Target/X86/X86TargetAsmInfo.cpp:1.30
--- llvm/lib/Target/X86/X86TargetAsmInfo.cpp:1.29	Wed Jan 17 11:43:33 2007
+++ llvm/lib/Target/X86/X86TargetAsmInfo.cpp	Wed Jan 17 19:15:58 2007
@@ -68,6 +68,13 @@
     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";
+    }
+    
     NeedsSet = true;
     DwarfAbbrevSection = ".section __DWARF,__debug_abbrev,regular,debug";
     DwarfInfoSection = ".section __DWARF,__debug_info,regular,debug";






More information about the llvm-commits mailing list