From df62250cee17b49be0a33d33817308b071ca132f Mon Sep 17 00:00:00 2001 From: Evan Cheng Date: Fri, 19 Jan 2007 18:59:56 +0000 Subject: [PATCH] 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. llvm-svn: 33362 --- llvm/lib/Target/ARM/ARMTargetAsmInfo.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/llvm/lib/Target/ARM/ARMTargetAsmInfo.cpp b/llvm/lib/Target/ARM/ARMTargetAsmInfo.cpp index 65848e53765e..d70ef6d9013d 100644 --- a/llvm/lib/Target/ARM/ARMTargetAsmInfo.cpp +++ b/llvm/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";