diff options
author | Chris Lattner <sabre@nondot.org> | 2010-01-25 21:10:10 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2010-01-25 21:10:10 +0000 |
commit | 78f485afb723121eedf4b6907ae6eb53da8af03c (patch) | |
tree | 33ce4077f681dcb4ec7676ad7ab0c37a667feb13 /lib/CodeGen | |
parent | a86106ed88582b913ac2394a5a4ad1868b299da4 (diff) |
rename MAI::PICJumpTableDirective to MAI::GPRel32Directive to
make it clear what it is, instead of how it is used.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94448 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen')
-rw-r--r-- | lib/CodeGen/AsmPrinter/AsmPrinter.cpp | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/lib/CodeGen/AsmPrinter/AsmPrinter.cpp b/lib/CodeGen/AsmPrinter/AsmPrinter.cpp index 3077ae371d..7a44a01656 100644 --- a/lib/CodeGen/AsmPrinter/AsmPrinter.cpp +++ b/lib/CodeGen/AsmPrinter/AsmPrinter.cpp @@ -541,15 +541,14 @@ void AsmPrinter::EmitJumpTableInfo(MachineJumpTableInfo *MJTI, void AsmPrinter::printPICJumpTableEntry(const MachineJumpTableInfo *MJTI, const MachineBasicBlock *MBB, unsigned uid) const { - // Use JumpTableDirective otherwise honor the entry size from the jump table - // info. - const char *JTEntryDirective = MAI->getPICJumpTableDirective(); - bool HadJTEntryDirective = JTEntryDirective != NULL; - if (!HadJTEntryDirective) { - JTEntryDirective = MJTI->getEntrySize() == 4 ? - MAI->getData32bitsDirective() : MAI->getData64bitsDirective(); + // If the target supports GPRel, use it. + if (const char *GPRel32Dir = MAI->getGPRel32Directive()) { + O << GPRel32Dir << *GetMBBSymbol(MBB->getNumber()) << '\n'; + return; } + const char *JTEntryDirective = MJTI->getEntrySize() == 4 ? + MAI->getData32bitsDirective() : MAI->getData64bitsDirective(); O << JTEntryDirective << ' '; // If we have emitted set directives for the jump table entries, print @@ -564,8 +563,7 @@ void AsmPrinter::printPICJumpTableEntry(const MachineJumpTableInfo *MJTI, O << *GetMBBSymbol(MBB->getNumber()); // If the arch uses custom Jump Table directives, don't calc relative to // JT. - if (!HadJTEntryDirective) - O << '-' << *GetJTISymbol(uid); + O << '-' << *GetJTISymbol(uid); } O << '\n'; } |