diff options
| author | Chris Lattner <sabre@nondot.org> | 2009-08-11 20:30:58 +0000 |
|---|---|---|
| committer | Chris Lattner <sabre@nondot.org> | 2009-08-11 20:30:58 +0000 |
| commit | fe27130454082b196e82041dd771534aa1699699 (patch) | |
| tree | 1f80bc630021628ad4c352c2e5f3264e4ff8634e /llvm/lib/Target | |
| parent | d5a91796852b72b8f8101946689e933122818353 (diff) | |
| download | bcm5719-llvm-fe27130454082b196e82041dd771534aa1699699.tar.gz bcm5719-llvm-fe27130454082b196e82041dd771534aa1699699.zip | |
split "JumpTableDirective" (an existing hack) into a PIC and nonPIC
version. This allows TAI implementations to specify the directive to use
based on the mode being codegen'd for.
The real fix for this is to remove JumpTableDirective, but I don't feel
like diving into the jumptable snarl just now.
llvm-svn: 78709
Diffstat (limited to 'llvm/lib/Target')
| -rw-r--r-- | llvm/lib/Target/ARM/AsmPrinter/ARMAsmPrinter.cpp | 10 | ||||
| -rw-r--r-- | llvm/lib/Target/Alpha/AlphaTargetAsmInfo.cpp | 2 | ||||
| -rw-r--r-- | llvm/lib/Target/Mips/MipsTargetAsmInfo.cpp | 4 | ||||
| -rw-r--r-- | llvm/lib/Target/TargetAsmInfo.cpp | 1 |
4 files changed, 6 insertions, 11 deletions
diff --git a/llvm/lib/Target/ARM/AsmPrinter/ARMAsmPrinter.cpp b/llvm/lib/Target/ARM/AsmPrinter/ARMAsmPrinter.cpp index 02ced4451f9..178e0851a0c 100644 --- a/llvm/lib/Target/ARM/AsmPrinter/ARMAsmPrinter.cpp +++ b/llvm/lib/Target/ARM/AsmPrinter/ARMAsmPrinter.cpp @@ -923,9 +923,7 @@ void ARMAsmPrinter::printJTBlockOperand(const MachineInstr *MI, int OpNum) { O << TAI->getPrivateGlobalPrefix() << "JTI" << getFunctionNumber() << '_' << JTI << '_' << MO2.getImm() << ":\n"; - const char *JTEntryDirective = TAI->getJumpTableDirective(); - if (!JTEntryDirective) - JTEntryDirective = TAI->getData32bitsDirective(); + const char *JTEntryDirective = TAI->getData32bitsDirective(); const MachineFunction *MF = MI->getParent()->getParent(); const MachineJumpTableInfo *MJTI = MF->getJumpTableInfo(); @@ -947,10 +945,8 @@ void ARMAsmPrinter::printJTBlockOperand(const MachineInstr *MI, int OpNum) { << "_set_" << MBB->getNumber(); else if (TM.getRelocationModel() == Reloc::PIC_) { printBasicBlockLabel(MBB, false, false, false); - // If the arch uses custom Jump Table directives, don't calc relative to JT - if (!TAI->getJumpTableDirective()) - O << '-' << TAI->getPrivateGlobalPrefix() << "JTI" - << getFunctionNumber() << '_' << JTI << '_' << MO2.getImm(); + O << '-' << TAI->getPrivateGlobalPrefix() << "JTI" + << getFunctionNumber() << '_' << JTI << '_' << MO2.getImm(); } else { printBasicBlockLabel(MBB, false, false, false); } diff --git a/llvm/lib/Target/Alpha/AlphaTargetAsmInfo.cpp b/llvm/lib/Target/Alpha/AlphaTargetAsmInfo.cpp index 0abdce9c3b0..20be50eff95 100644 --- a/llvm/lib/Target/Alpha/AlphaTargetAsmInfo.cpp +++ b/llvm/lib/Target/Alpha/AlphaTargetAsmInfo.cpp @@ -17,6 +17,6 @@ using namespace llvm; AlphaTargetAsmInfo::AlphaTargetAsmInfo() { AlignmentIsInBytes = false; PrivateGlobalPrefix = "$"; - JumpTableDirective = ".gprel32"; + PICJumpTableDirective = ".gprel32"; WeakRefDirective = "\t.weak\t"; } diff --git a/llvm/lib/Target/Mips/MipsTargetAsmInfo.cpp b/llvm/lib/Target/Mips/MipsTargetAsmInfo.cpp index aa40ff6a5ac..8cb58c8bb97 100644 --- a/llvm/lib/Target/Mips/MipsTargetAsmInfo.cpp +++ b/llvm/lib/Target/Mips/MipsTargetAsmInfo.cpp @@ -24,7 +24,5 @@ MipsTargetAsmInfo::MipsTargetAsmInfo(const MipsTargetMachine &TM) { PrivateGlobalPrefix = "$"; CommentString = "#"; ZeroDirective = "\t.space\t"; - - if (TM.getRelocationModel() == Reloc::PIC_) - JumpTableDirective = "\t.gpword\t"; + PICJumpTableDirective = "\t.gpword\t"; } diff --git a/llvm/lib/Target/TargetAsmInfo.cpp b/llvm/lib/Target/TargetAsmInfo.cpp index 84a97710d67..51aeae43800 100644 --- a/llvm/lib/Target/TargetAsmInfo.cpp +++ b/llvm/lib/Target/TargetAsmInfo.cpp @@ -54,6 +54,7 @@ TargetAsmInfo::TargetAsmInfo() { AlignmentIsInBytes = true; TextAlignFillValue = 0; JumpTableDirective = 0; + PICJumpTableDirective = 0; GlobalDirective = "\t.globl\t"; SetDirective = 0; LCOMMDirective = 0; |

