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
This commit is contained in:
Chris Lattner 2007-01-18 01:15:58 +00:00
parent 393a8eea3c
commit b266ccd0f4
2 changed files with 14 additions and 0 deletions

View File

@ -57,6 +57,13 @@ DarwinTargetAsmInfo::DarwinTargetAsmInfo(const PPCTargetMachine &TM)
UsedDirective = "\t.no_dead_strip\t"; UsedDirective = "\t.no_dead_strip\t";
WeakRefDirective = "\t.weak_reference\t"; WeakRefDirective = "\t.weak_reference\t";
HiddenDirective = "\t.private_extern\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";
}
} }
LinuxTargetAsmInfo::LinuxTargetAsmInfo(const PPCTargetMachine &TM) LinuxTargetAsmInfo::LinuxTargetAsmInfo(const PPCTargetMachine &TM)

View File

@ -68,6 +68,13 @@ X86TargetAsmInfo::X86TargetAsmInfo(const X86TargetMachine &TM) {
WeakRefDirective = "\t.weak_reference\t"; WeakRefDirective = "\t.weak_reference\t";
HiddenDirective = "\t.private_extern\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; NeedsSet = true;
DwarfAbbrevSection = ".section __DWARF,__debug_abbrev,regular,debug"; DwarfAbbrevSection = ".section __DWARF,__debug_abbrev,regular,debug";
DwarfInfoSection = ".section __DWARF,__debug_info,regular,debug"; DwarfInfoSection = ".section __DWARF,__debug_info,regular,debug";