Hack to naturally align doubles in the constant pool. Remove this once we
know what The Right Thing To Do is.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22660 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Target/PowerPC/PPCAsmPrinter.cpp b/lib/Target/PowerPC/PPCAsmPrinter.cpp
index 90abbd2..55007a4 100644
--- a/lib/Target/PowerPC/PPCAsmPrinter.cpp
+++ b/lib/Target/PowerPC/PPCAsmPrinter.cpp
@@ -427,7 +427,12 @@
for (unsigned i = 0, e = CP.size(); i != e; ++i) {
O << "\t.const\n";
- emitAlignment(TD.getTypeAlignmentShift(CP[i]->getType()));
+ // FIXME: force doubles to be naturally aligned. We should handle this
+ // more correctly in the future.
+ if (Type::DoubleTy == CP[i]->getType())
+ emitAlignment(3);
+ else
+ emitAlignment(TD.getTypeAlignmentShift(CP[i]->getType()));
O << ".CPI" << CurrentFnName << "_" << i << ":\t\t\t\t\t" << CommentString
<< *CP[i] << "\n";
emitGlobalConstant(CP[i]);