Modify emission of jump tables on darwin to emit an extra "l" label that
authorEvan Cheng <evan.cheng@apple.com>
Fri, 19 Jan 2007 18:59:56 +0000 (18:59 +0000)
committerEvan Cheng <evan.cheng@apple.com>
Fri, 19 Jan 2007 18:59:56 +0000 (18:59 +0000)
delimits the boundaries of jump tables.  This lets the linker's dead code
stripping optimization do a better job.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33362 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/ARM/ARMTargetAsmInfo.cpp

index 65848e53765e43283dfee75c4c5b070225cf2cbe..d70ef6d9013d71eaa31b5bfeac6bdef4a85f5145 100644 (file)
@@ -33,6 +33,13 @@ ARMTargetAsmInfo::ARMTargetAsmInfo(const ARMTargetMachine &TM) {
     LCOMMDirective = "\t.lcomm\t";
     COMMDirectiveTakesAlignment = false;
     
+    // 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";