From b266ccd0f41b3ac9d9ad733e73204d9177c12e9f Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Thu, 18 Jan 2007 01:15:58 +0000 Subject: 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 --- lib/Target/PowerPC/PPCTargetAsmInfo.cpp | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'lib/Target/PowerPC/PPCTargetAsmInfo.cpp') diff --git a/lib/Target/PowerPC/PPCTargetAsmInfo.cpp b/lib/Target/PowerPC/PPCTargetAsmInfo.cpp index b9f5849bdf..b54c9e9eb6 100644 --- a/lib/Target/PowerPC/PPCTargetAsmInfo.cpp +++ b/lib/Target/PowerPC/PPCTargetAsmInfo.cpp @@ -57,6 +57,13 @@ DarwinTargetAsmInfo::DarwinTargetAsmInfo(const PPCTargetMachine &TM) UsedDirective = "\t.no_dead_strip\t"; 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"; + } } LinuxTargetAsmInfo::LinuxTargetAsmInfo(const PPCTargetMachine &TM) -- cgit v1.2.3