diff options
author | Chris Lattner <sabre@nondot.org> | 2006-02-09 04:46:04 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2006-02-09 04:46:04 +0000 |
commit | 3029f920519e0871a5aad5d7c592281093953733 (patch) | |
tree | 589f441942c202c83c47dea002d7c8e3c72bf6e1 /lib/CodeGen/AsmPrinter.cpp | |
parent | 04a0f60b230ca2a2c1aa128981b11d5a2c9b6e2c (diff) |
Adjust to MachineConstantPool interface change: instead of keeping a
value/alignment pair for each constant, keep a value/offset pair.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26078 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/AsmPrinter.cpp')
-rw-r--r-- | lib/CodeGen/AsmPrinter.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/CodeGen/AsmPrinter.cpp b/lib/CodeGen/AsmPrinter.cpp index bd12c775e8..af5346cb53 100644 --- a/lib/CodeGen/AsmPrinter.cpp +++ b/lib/CodeGen/AsmPrinter.cpp @@ -111,11 +111,17 @@ void AsmPrinter::EmitConstantPool(MachineConstantPool *MCP) { const TargetData &TD = TM.getTargetData(); SwitchSection(ConstantPoolSection, 0); + EmitAlignment(MCP->getConstantPoolAlignment()); for (unsigned i = 0, e = CP.size(); i != e; ++i) { - EmitAlignment(CP[i].Alignment); O << PrivateGlobalPrefix << "CPI" << getFunctionNumber() << '_' << i << ":\t\t\t\t\t" << CommentString << *CP[i].Val << '\n'; EmitGlobalConstant(CP[i].Val); + if (i != e-1) { + unsigned EntSize = TM.getTargetData().getTypeSize(CP[i].Val->getType()); + unsigned ValEnd = CP[i].Offset + EntSize; + // Emit inter-object padding for alignment. + EmitZeros(CP[i+1].Offset-ValEnd); + } } } |