summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/AsmPrinter.cpp
diff options
context:
space:
mode:
authorNate Begeman <natebegeman@mac.com>2006-07-27 16:46:58 +0000
committerNate Begeman <natebegeman@mac.com>2006-07-27 16:46:58 +0000
commitefc312a5c7269a0273228b7003c5510ba4d2f980 (patch)
treeb3995d3dd3c762563d7eef0486ce4fa44d37dd45 /llvm/lib/CodeGen/AsmPrinter.cpp
parent691a63d56469411acc22938768a10206e1b20ae7 (diff)
downloadbcm5719-llvm-efc312a5c7269a0273228b7003c5510ba4d2f980.tar.gz
bcm5719-llvm-efc312a5c7269a0273228b7003c5510ba4d2f980.zip
Code cleanups, per review
llvm-svn: 29347
Diffstat (limited to 'llvm/lib/CodeGen/AsmPrinter.cpp')
-rw-r--r--llvm/lib/CodeGen/AsmPrinter.cpp10
1 files changed, 7 insertions, 3 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter.cpp b/llvm/lib/CodeGen/AsmPrinter.cpp
index a0f377c63fc..489d3414de0 100644
--- a/llvm/lib/CodeGen/AsmPrinter.cpp
+++ b/llvm/lib/CodeGen/AsmPrinter.cpp
@@ -210,7 +210,11 @@ void AsmPrinter::EmitJumpTableInfo(MachineJumpTableInfo *MJTI) {
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 @@ void AsmPrinter::EmitJumpTableInfo(MachineJumpTableInfo *MJTI) {
} else {
SwitchToDataSection(JumpTableDataSection, 0);
if (TD->getPointerSize() == 8)
- PtrDataDirective = Data64bitsDirective;
+ JTEntryDirective = Data64bitsDirective;
}
EmitAlignment(Log2_32(TD->getPointerAlignment()));
@@ -228,7 +232,7 @@ void AsmPrinter::EmitJumpTableInfo(MachineJumpTableInfo *MJTI) {
<< ":\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()
OpenPOWER on IntegriCloud