From 4d9bbdc4408cc871d229677313cc4887862719d7 Mon Sep 17 00:00:00 2001 From: Nate Begeman Date: Thu, 27 Jul 2006 16:46:58 +0000 Subject: Code cleanups, per review git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29347 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/CodeGen/AsmPrinter.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'lib/CodeGen/AsmPrinter.cpp') diff --git a/lib/CodeGen/AsmPrinter.cpp b/lib/CodeGen/AsmPrinter.cpp index a0f377c63f..489d3414de 100644 --- a/lib/CodeGen/AsmPrinter.cpp +++ b/lib/CodeGen/AsmPrinter.cpp @@ -210,7 +210,11 @@ void AsmPrinter::EmitJumpTableInfo(MachineJumpTableInfo *MJTI) { const std::vector &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 &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() -- cgit v1.2.3-70-g09d2