[llvm-commits] CVS: llvm/lib/CodeGen/AsmPrinter.cpp
Nate Begeman
natebegeman at mac.com
Thu Jul 27 09:47:15 PDT 2006
Changes in directory llvm/lib/CodeGen:
AsmPrinter.cpp updated: 1.85 -> 1.86
---
Log message:
Code cleanups, per review
---
Diffs of the changes: (+7 -3)
AsmPrinter.cpp | 10 +++++++---
1 files changed, 7 insertions(+), 3 deletions(-)
Index: llvm/lib/CodeGen/AsmPrinter.cpp
diff -u llvm/lib/CodeGen/AsmPrinter.cpp:1.85 llvm/lib/CodeGen/AsmPrinter.cpp:1.86
--- llvm/lib/CodeGen/AsmPrinter.cpp:1.85 Wed Jul 26 20:13:04 2006
+++ llvm/lib/CodeGen/AsmPrinter.cpp Thu Jul 27 11:46:58 2006
@@ -210,7 +210,11 @@
const std::vector<MachineJumpTableEntry> &JT = MJTI->getJumpTables();
if (JT.empty()) return;
const TargetData *TD = TM.getTargetData();
- const char *PtrDataDirective = Data32bitsDirective;
+
+ // JTEntryDirective is a string to print sizeof(ptr) for non-PIC jump tables,
+ // and 32 bits for PIC since PIC jump table entries are differences, not
+ // pointers to blocks.
+ const char *JTEntryDirective = Data32bitsDirective;
// Pick the directive to use to print the jump table entries, and switch to
// the appropriate section.
@@ -219,7 +223,7 @@
} else {
SwitchToDataSection(JumpTableDataSection, 0);
if (TD->getPointerSize() == 8)
- PtrDataDirective = Data64bitsDirective;
+ JTEntryDirective = Data64bitsDirective;
}
EmitAlignment(Log2_32(TD->getPointerAlignment()));
@@ -228,7 +232,7 @@
<< ":\n";
const std::vector<MachineBasicBlock*> &JTBBs = JT[i].MBBs;
for (unsigned ii = 0, ee = JTBBs.size(); ii != ee; ++ii) {
- O << PtrDataDirective << ' ';
+ O << JTEntryDirective << ' ';
printBasicBlockLabel(JTBBs[ii], false, false);
if (TM.getRelocationModel() == Reloc::PIC_) {
O << '-' << PrivateGlobalPrefix << "JTI" << getFunctionNumber()
More information about the llvm-commits
mailing list