aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Target/X86/X86TargetAsmInfo.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2007-01-18 01:15:58 +0000
committerChris Lattner <sabre@nondot.org>2007-01-18 01:15:58 +0000
commitb266ccd0f41b3ac9d9ad733e73204d9177c12e9f (patch)
tree132422713692506d709337c4ef38c7cb58adb8fe /lib/Target/X86/X86TargetAsmInfo.cpp
parent393a8eea3c15de08eaf6953aa8a65a3961b76153 (diff)
downloadexternal_llvm-b266ccd0f41b3ac9d9ad733e73204d9177c12e9f.tar.gz
external_llvm-b266ccd0f41b3ac9d9ad733e73204d9177c12e9f.tar.bz2
external_llvm-b266ccd0f41b3ac9d9ad733e73204d9177c12e9f.zip
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@33315 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/X86/X86TargetAsmInfo.cpp')
-rw-r--r--lib/Target/X86/X86TargetAsmInfo.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/Target/X86/X86TargetAsmInfo.cpp b/lib/Target/X86/X86TargetAsmInfo.cpp
index 1735220ae2..2bb4a6c227 100644
--- a/lib/Target/X86/X86TargetAsmInfo.cpp
+++ b/lib/Target/X86/X86TargetAsmInfo.cpp
@@ -68,6 +68,13 @@ X86TargetAsmInfo::X86TargetAsmInfo(const X86TargetMachine &TM) {
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";