summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2005-11-21 06:47:58 +0000
committerChris Lattner <sabre@nondot.org>2005-11-21 06:47:58 +0000
commit41cb115afbdeee87945a0f2967943104b46cfed9 (patch)
treec5185f8ef301cfbde9096e53e8465c637b283f2e /llvm/lib
parent618981fd03f323f008dde4d5b6f9593de08a33c8 (diff)
downloadbcm5719-llvm-41cb115afbdeee87945a0f2967943104b46cfed9.tar.gz
bcm5719-llvm-41cb115afbdeee87945a0f2967943104b46cfed9.zip
set PrivateGlobalPrefix on darwin, use it when printing out CP references
llvm-svn: 24441
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp16
1 files changed, 9 insertions, 7 deletions
diff --git a/llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp b/llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp
index 8e3ed6a0ea3..666f65515c1 100644
--- a/llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp
+++ b/llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp
@@ -230,6 +230,7 @@ namespace {
: PPCAsmPrinter(O, TM) {
CommentString = ";";
GlobalPrefix = "_";
+ PrivateGlobalPrefix = "L"; // Marker for constant pool idxs
ZeroDirective = "\t.space\t"; // ".space N" emits N zeros.
Data64bitsDirective = 0; // we can't emit a 64-bit unit
AlignmentIsInBytes = false; // Alignment is by power of 2.
@@ -326,7 +327,8 @@ void PPCAsmPrinter::printOp(const MachineOperand &MO) {
}
case MachineOperand::MO_ConstantPoolIndex:
- O << "LCPI" << FunctionNumber << '_' << MO.getConstantPoolIndex();
+ O << PrivateGlobalPrefix << "CPI" << FunctionNumber
+ << '_' << MO.getConstantPoolIndex();
return;
case MachineOperand::MO_ExternalSymbol:
@@ -447,16 +449,16 @@ void DarwinAsmPrinter::printConstantPool(MachineConstantPool *MCP) {
if (CP.empty()) return;
+ SwitchSection(".const", 0);
for (unsigned i = 0, e = CP.size(); i != e; ++i) {
- SwitchSection(".const", 0);
// FIXME: force doubles to be naturally aligned. We should handle this
// more correctly in the future.
- if (Type::DoubleTy == CP[i]->getType())
+ if (CP[i]->getType() == Type::DoubleTy)
emitAlignment(3);
else
emitAlignment(TD.getTypeAlignmentShift(CP[i]->getType()));
- O << "LCPI" << FunctionNumber << '_' << i << ":\t\t\t\t\t" << CommentString
- << *CP[i] << '\n';
+ O << PrivateGlobalPrefix << "CPI" << FunctionNumber << '_' << i
+ << ":\t\t\t\t\t" << CommentString << *CP[i] << '\n';
emitGlobalConstant(CP[i]);
}
}
@@ -664,8 +666,8 @@ void AIXAsmPrinter::printConstantPool(MachineConstantPool *MCP) {
SwitchSection(".const", 0);
O << "\t.align " << (unsigned)TD.getTypeAlignment(CP[i]->getType())
<< "\n";
- O << "LCPI" << FunctionNumber << '_' << i << ":\t\t\t\t\t;"
- << *CP[i] << '\n';
+ O << PrivateGlobalPrefix << "CPI" << FunctionNumber << '_' << i
+ << ":\t\t\t\t\t;" << *CP[i] << '\n';
emitGlobalConstant(CP[i]);
}
}
OpenPOWER on IntegriCloud