On Darwin, ams printer should output a second label before a jump table so the linker knows it's a new atom. But this is only needed if the jump table is put in a separate section from the function body.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73720 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Target/ARM/ARMTargetAsmInfo.cpp b/lib/Target/ARM/ARMTargetAsmInfo.cpp
index 4107dcc..a441968 100644
--- a/lib/Target/ARM/ARMTargetAsmInfo.cpp
+++ b/lib/Target/ARM/ARMTargetAsmInfo.cpp
@@ -74,10 +74,10 @@
// 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";
- }
+ // Emit a local label that is preserved until the linker runs.
+ // We do not check the relocation model here since it can be overridden
+ // later.
+ JumpTableSpecialLabelPrefix = "l";
NeedsSet = true;
DwarfAbbrevSection = ".section __DWARF,__debug_abbrev,regular,debug";
diff --git a/lib/Target/PowerPC/PPCTargetAsmInfo.cpp b/lib/Target/PowerPC/PPCTargetAsmInfo.cpp
index c69e591..c8d1132 100644
--- a/lib/Target/PowerPC/PPCTargetAsmInfo.cpp
+++ b/lib/Target/PowerPC/PPCTargetAsmInfo.cpp
@@ -68,10 +68,9 @@
// 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";
- }
+ // We do not check the relocation model here since it can be overridden
+ // later.
+ JumpTableSpecialLabelPrefix = "l";
}
/// PreferredEHDataFormat - This hook allows the target to select data
diff --git a/lib/Target/X86/X86TargetAsmInfo.cpp b/lib/Target/X86/X86TargetAsmInfo.cpp
index 5dda5f4..0c474e1 100644
--- a/lib/Target/X86/X86TargetAsmInfo.cpp
+++ b/lib/Target/X86/X86TargetAsmInfo.cpp
@@ -99,10 +99,10 @@
// 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";
- }
+ // Emit a local label that is preserved until the linker runs.
+ // We do not check the relocation model here since it can be overridden
+ // later.
+ JumpTableSpecialLabelPrefix = "l";
SupportsDebugInformation = true;
NeedsSet = true;