aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEvan Cheng <evan.cheng@apple.com>2007-01-19 18:59:56 +0000
committerEvan Cheng <evan.cheng@apple.com>2007-01-19 18:59:56 +0000
commit8e1185bd5ccc00576d2a4755f0e5ea8da5abb312 (patch)
tree484664c32e3dbcf32168785474af310d6a6013e7
parent42d7ccfd8e672bf3a5d42052f8da50f0d610afb2 (diff)
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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33362 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/Target/ARM/ARMTargetAsmInfo.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/Target/ARM/ARMTargetAsmInfo.cpp b/lib/Target/ARM/ARMTargetAsmInfo.cpp
index 65848e5376..d70ef6d901 100644
--- a/lib/Target/ARM/ARMTargetAsmInfo.cpp
+++ b/lib/Target/ARM/ARMTargetAsmInfo.cpp
@@ -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";