summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/AsmPrinter.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2006-07-15 01:34:12 +0000
committerChris Lattner <sabre@nondot.org>2006-07-15 01:34:12 +0000
commitfd5a8ebb74df1e45b8f3b62512fb4a52e8b42704 (patch)
tree0574d9c48bc17ec8f84b502c7697664177109435 /llvm/lib/CodeGen/AsmPrinter.cpp
parente1758d4cef94692a7164f57d8b30bd8085d921fa (diff)
downloadbcm5719-llvm-fd5a8ebb74df1e45b8f3b62512fb4a52e8b42704.tar.gz
bcm5719-llvm-fd5a8ebb74df1e45b8f3b62512fb4a52e8b42704.zip
On 64-bit targets like ppc64, we should use .quad to output pointer directives,
not .long. llvm-svn: 29157
Diffstat (limited to 'llvm/lib/CodeGen/AsmPrinter.cpp')
-rw-r--r--llvm/lib/CodeGen/AsmPrinter.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter.cpp b/llvm/lib/CodeGen/AsmPrinter.cpp
index d4facd27a4f..6e5dab7851f 100644
--- a/llvm/lib/CodeGen/AsmPrinter.cpp
+++ b/llvm/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';
}
OpenPOWER on IntegriCloud