aboutsummaryrefslogtreecommitdiff
path: root/lib/Target/SparcV9
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2006-02-09 04:46:04 +0000
committerChris Lattner <sabre@nondot.org>2006-02-09 04:46:04 +0000
commit3029f920519e0871a5aad5d7c592281093953733 (patch)
tree589f441942c202c83c47dea002d7c8e3c72bf6e1 /lib/Target/SparcV9
parent04a0f60b230ca2a2c1aa128981b11d5a2c9b6e2c (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/Target/SparcV9')
-rw-r--r--lib/Target/SparcV9/SparcV9AsmPrinter.cpp14
1 files changed, 12 insertions, 2 deletions
diff --git a/lib/Target/SparcV9/SparcV9AsmPrinter.cpp b/lib/Target/SparcV9/SparcV9AsmPrinter.cpp
index 69f68094d5..62a31c2664 100644
--- a/lib/Target/SparcV9/SparcV9AsmPrinter.cpp
+++ b/lib/Target/SparcV9/SparcV9AsmPrinter.cpp
@@ -216,7 +216,8 @@ namespace {
if (Alignment == 0)
Alignment = ConstantToAlignment(CV, TM);
- O << "\t.align\t" << Alignment << "\n";
+ if (Alignment != 1)
+ O << "\t.align\t" << Alignment << "\n";
// Print .size and .type only if it is not a string.
if (const ConstantArray *CVA = dyn_cast<ConstantArray>(CV))
@@ -727,9 +728,18 @@ void SparcV9AsmPrinter::emitFunction(const Function &F) {
const std::vector<MachineConstantPoolEntry> &CP = MCP->getConstants();
enterSection(ReadOnlyData);
+ O << "\t.align\t" << (1 << MCP->getConstantPoolAlignment()) << "\n";
for (unsigned i = 0, e = CP.size(); i != e; ++i) {
std::string cpiName = ".CPI_" + CurrentFnName + "_" + utostr(i);
- printConstant(CP[i].Val, CP[i].Alignment, cpiName);
+ printConstant(CP[i].Val, 1, cpiName);
+
+ 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.
+ for (unsigned NumZeros = CP[i+1].Offset-ValEnd; NumZeros; --NumZeros)
+ O << "\t.byte 0\n";
+ }
}
enterSection(Text);