diff options
author | Chris Lattner <sabre@nondot.org> | 2009-08-11 20:29:57 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2009-08-11 20:29:57 +0000 |
commit | b3ac6e40d9dd3bc8157edc47004f39c8f382dc9e (patch) | |
tree | 6ea42c6451e1704fca60343761dd51ab2a5a3f5c /lib/CodeGen | |
parent | d6474fa1f19224e62e5095a6373bed0c69bdb215 (diff) | |
download | external_llvm-b3ac6e40d9dd3bc8157edc47004f39c8f382dc9e.zip external_llvm-b3ac6e40d9dd3bc8157edc47004f39c8f382dc9e.tar.gz external_llvm-b3ac6e40d9dd3bc8157edc47004f39c8f382dc9e.tar.bz2 |
"TAI::JumpTableDirective" is always null for current arm targets, simplify
the code based on this and make it fall through better.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78708 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen')
-rw-r--r-- | lib/CodeGen/AsmPrinter/AsmPrinter.cpp | 26 |
1 files changed, 12 insertions, 14 deletions
diff --git a/lib/CodeGen/AsmPrinter/AsmPrinter.cpp b/lib/CodeGen/AsmPrinter/AsmPrinter.cpp index 8e59550..50733e6 100644 --- a/lib/CodeGen/AsmPrinter/AsmPrinter.cpp +++ b/lib/CodeGen/AsmPrinter/AsmPrinter.cpp @@ -420,11 +420,11 @@ void AsmPrinter::EmitJumpTableInfo(MachineJumpTableInfo *MJTI, void AsmPrinter::printPICJumpTableEntry(const MachineJumpTableInfo *MJTI, const MachineBasicBlock *MBB, unsigned uid) const { - bool IsPic = TM.getRelocationModel() == Reloc::PIC_; + bool isPIC = TM.getRelocationModel() == Reloc::PIC_; // Use JumpTableDirective otherwise honor the entry size from the jump table // info. - const char *JTEntryDirective = TAI->getJumpTableDirective(); + const char *JTEntryDirective = TAI->getJumpTableDirective(isPIC); bool HadJTEntryDirective = JTEntryDirective != NULL; if (!HadJTEntryDirective) { JTEntryDirective = MJTI->getEntrySize() == 4 ? @@ -438,20 +438,18 @@ void AsmPrinter::printPICJumpTableEntry(const MachineJumpTableInfo *MJTI, // emit the table entries as differences between two text section labels. // If we're emitting non-PIC code, then emit the entries as direct // references to the target basic blocks. - if (IsPic) { - if (TAI->getSetDirective()) { - O << TAI->getPrivateGlobalPrefix() << getFunctionNumber() - << '_' << uid << "_set_" << MBB->getNumber(); - } else { - printBasicBlockLabel(MBB, false, false, false); - // If the arch uses custom Jump Table directives, don't calc relative to - // JT - if (!HadJTEntryDirective) - O << '-' << TAI->getPrivateGlobalPrefix() << "JTI" - << getFunctionNumber() << '_' << uid; - } + if (!isPIC) { + printBasicBlockLabel(MBB, false, false, false); + } else if (TAI->getSetDirective()) { + O << TAI->getPrivateGlobalPrefix() << getFunctionNumber() + << '_' << uid << "_set_" << MBB->getNumber(); } else { printBasicBlockLabel(MBB, false, false, false); + // If the arch uses custom Jump Table directives, don't calc relative to + // JT + if (!HadJTEntryDirective) + O << '-' << TAI->getPrivateGlobalPrefix() << "JTI" + << getFunctionNumber() << '_' << uid; } } |