From 99558806f8c4c6867a335fe896350302b126a2b5 Mon Sep 17 00:00:00 2001 From: Nate Begeman Date: Thu, 4 Aug 2005 21:04:09 +0000 Subject: [PATCH] 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 --- lib/Target/PowerPC/PPCAsmPrinter.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/Target/PowerPC/PPCAsmPrinter.cpp b/lib/Target/PowerPC/PPCAsmPrinter.cpp index 90abbd22f65..55007a49100 100644 --- a/lib/Target/PowerPC/PPCAsmPrinter.cpp +++ b/lib/Target/PowerPC/PPCAsmPrinter.cpp @@ -427,7 +427,12 @@ void DarwinAsmPrinter::printConstantPool(MachineConstantPool *MCP) { 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]);