diff options
author | Chris Lattner <sabre@nondot.org> | 2006-07-15 01:34:12 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2006-07-15 01:34:12 +0000 |
commit | 0c4e6789da4dba6c7b0010886776b24dec3f3bb8 (patch) | |
tree | b3fb289c7d39722cf66421b87ae4dc4433f52297 /lib/CodeGen/AsmPrinter.cpp | |
parent | ba4733d901b1c2b994f66707657342b8c81c92bc (diff) |
On 64-bit targets like ppc64, we should use .quad to output pointer directives,
not .long.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29157 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/AsmPrinter.cpp')
-rw-r--r-- | lib/CodeGen/AsmPrinter.cpp | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/lib/CodeGen/AsmPrinter.cpp b/lib/CodeGen/AsmPrinter.cpp index d4facd27a4..6e5dab7851 100644 --- a/lib/CodeGen/AsmPrinter.cpp +++ b/lib/CodeGen/AsmPrinter.cpp @@ -217,12 +217,20 @@ void AsmPrinter::EmitJumpTableInfo(MachineJumpTableInfo *MJTI) { SwitchToDataSection(JumpTableSection, 0); EmitAlignment(Log2_32(TD->getPointerAlignment())); + + // Pick the directive to use based on the pointer size. FIXME: when we support + // PIC jumptables, this should always use the 32-bit directive for label + // differences. + const char *PtrDataDirective = Data32bitsDirective; + if (TD->getPointerSize() == 8) + PtrDataDirective = Data64bitsDirective; + for (unsigned i = 0, e = JT.size(); i != e; ++i) { O << PrivateGlobalPrefix << "JTI" << getFunctionNumber() << '_' << i << ":\n"; const std::vector<MachineBasicBlock*> &JTBBs = JT[i].MBBs; for (unsigned ii = 0, ee = JTBBs.size(); ii != ee; ++ii) { - O << Data32bitsDirective << ' '; + O << PtrDataDirective << ' '; printBasicBlockLabel(JTBBs[ii]); O << '\n'; } |