mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-28 06:24:57 +00:00
set PrivateGlobalPrefix on darwin, use it when printing out CP references
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24441 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -230,6 +230,7 @@ namespace {
|
|||||||
: PPCAsmPrinter(O, TM) {
|
: PPCAsmPrinter(O, TM) {
|
||||||
CommentString = ";";
|
CommentString = ";";
|
||||||
GlobalPrefix = "_";
|
GlobalPrefix = "_";
|
||||||
|
PrivateGlobalPrefix = "L"; // Marker for constant pool idxs
|
||||||
ZeroDirective = "\t.space\t"; // ".space N" emits N zeros.
|
ZeroDirective = "\t.space\t"; // ".space N" emits N zeros.
|
||||||
Data64bitsDirective = 0; // we can't emit a 64-bit unit
|
Data64bitsDirective = 0; // we can't emit a 64-bit unit
|
||||||
AlignmentIsInBytes = false; // Alignment is by power of 2.
|
AlignmentIsInBytes = false; // Alignment is by power of 2.
|
||||||
@ -326,7 +327,8 @@ void PPCAsmPrinter::printOp(const MachineOperand &MO) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
case MachineOperand::MO_ConstantPoolIndex:
|
case MachineOperand::MO_ConstantPoolIndex:
|
||||||
O << "LCPI" << FunctionNumber << '_' << MO.getConstantPoolIndex();
|
O << PrivateGlobalPrefix << "CPI" << FunctionNumber
|
||||||
|
<< '_' << MO.getConstantPoolIndex();
|
||||||
return;
|
return;
|
||||||
|
|
||||||
case MachineOperand::MO_ExternalSymbol:
|
case MachineOperand::MO_ExternalSymbol:
|
||||||
@ -447,16 +449,16 @@ void DarwinAsmPrinter::printConstantPool(MachineConstantPool *MCP) {
|
|||||||
|
|
||||||
if (CP.empty()) return;
|
if (CP.empty()) return;
|
||||||
|
|
||||||
|
SwitchSection(".const", 0);
|
||||||
for (unsigned i = 0, e = CP.size(); i != e; ++i) {
|
for (unsigned i = 0, e = CP.size(); i != e; ++i) {
|
||||||
SwitchSection(".const", 0);
|
|
||||||
// FIXME: force doubles to be naturally aligned. We should handle this
|
// FIXME: force doubles to be naturally aligned. We should handle this
|
||||||
// more correctly in the future.
|
// more correctly in the future.
|
||||||
if (Type::DoubleTy == CP[i]->getType())
|
if (CP[i]->getType() == Type::DoubleTy)
|
||||||
emitAlignment(3);
|
emitAlignment(3);
|
||||||
else
|
else
|
||||||
emitAlignment(TD.getTypeAlignmentShift(CP[i]->getType()));
|
emitAlignment(TD.getTypeAlignmentShift(CP[i]->getType()));
|
||||||
O << "LCPI" << FunctionNumber << '_' << i << ":\t\t\t\t\t" << CommentString
|
O << PrivateGlobalPrefix << "CPI" << FunctionNumber << '_' << i
|
||||||
<< *CP[i] << '\n';
|
<< ":\t\t\t\t\t" << CommentString << *CP[i] << '\n';
|
||||||
emitGlobalConstant(CP[i]);
|
emitGlobalConstant(CP[i]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -664,8 +666,8 @@ void AIXAsmPrinter::printConstantPool(MachineConstantPool *MCP) {
|
|||||||
SwitchSection(".const", 0);
|
SwitchSection(".const", 0);
|
||||||
O << "\t.align " << (unsigned)TD.getTypeAlignment(CP[i]->getType())
|
O << "\t.align " << (unsigned)TD.getTypeAlignment(CP[i]->getType())
|
||||||
<< "\n";
|
<< "\n";
|
||||||
O << "LCPI" << FunctionNumber << '_' << i << ":\t\t\t\t\t;"
|
O << PrivateGlobalPrefix << "CPI" << FunctionNumber << '_' << i
|
||||||
<< *CP[i] << '\n';
|
<< ":\t\t\t\t\t;" << *CP[i] << '\n';
|
||||||
emitGlobalConstant(CP[i]);
|
emitGlobalConstant(CP[i]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user