mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-08-07 12:28:24 +00:00
Adjust to capitalized asmprinter method names
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24457 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -48,13 +48,13 @@ bool AsmPrinter::doFinalization(Module &M) {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void AsmPrinter::setupMachineFunction(MachineFunction &MF) {
|
void AsmPrinter::SetupMachineFunction(MachineFunction &MF) {
|
||||||
// What's my mangled name?
|
// What's my mangled name?
|
||||||
CurrentFnName = Mang->getValueName(MF.getFunction());
|
CurrentFnName = Mang->getValueName(MF.getFunction());
|
||||||
}
|
}
|
||||||
|
|
||||||
// emitAlignment - Emit an alignment directive to the specified power of two.
|
// EmitAlignment - Emit an alignment directive to the specified power of two.
|
||||||
void AsmPrinter::emitAlignment(unsigned NumBits, const GlobalValue *GV) const {
|
void AsmPrinter::EmitAlignment(unsigned NumBits, const GlobalValue *GV) const {
|
||||||
if (GV && GV->getAlignment())
|
if (GV && GV->getAlignment())
|
||||||
NumBits = Log2_32(GV->getAlignment());
|
NumBits = Log2_32(GV->getAlignment());
|
||||||
if (NumBits == 0) return; // No need to emit alignment.
|
if (NumBits == 0) return; // No need to emit alignment.
|
||||||
@@ -62,9 +62,9 @@ void AsmPrinter::emitAlignment(unsigned NumBits, const GlobalValue *GV) const {
|
|||||||
O << AlignDirective << NumBits << "\n";
|
O << AlignDirective << NumBits << "\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
/// emitZeros - Emit a block of zeros.
|
/// EmitZeros - Emit a block of zeros.
|
||||||
///
|
///
|
||||||
void AsmPrinter::emitZeros(uint64_t NumZeros) const {
|
void AsmPrinter::EmitZeros(uint64_t NumZeros) const {
|
||||||
if (NumZeros) {
|
if (NumZeros) {
|
||||||
if (ZeroDirective)
|
if (ZeroDirective)
|
||||||
O << ZeroDirective << NumZeros << "\n";
|
O << ZeroDirective << NumZeros << "\n";
|
||||||
@@ -77,7 +77,7 @@ void AsmPrinter::emitZeros(uint64_t NumZeros) const {
|
|||||||
|
|
||||||
// Print out the specified constant, without a storage class. Only the
|
// Print out the specified constant, without a storage class. Only the
|
||||||
// constants valid in constant expressions can occur here.
|
// constants valid in constant expressions can occur here.
|
||||||
void AsmPrinter::emitConstantValueOnly(const Constant *CV) {
|
void AsmPrinter::EmitConstantValueOnly(const Constant *CV) {
|
||||||
if (CV->isNullValue() || isa<UndefValue>(CV))
|
if (CV->isNullValue() || isa<UndefValue>(CV))
|
||||||
O << "0";
|
O << "0";
|
||||||
else if (const ConstantBool *CB = dyn_cast<ConstantBool>(CV)) {
|
else if (const ConstantBool *CB = dyn_cast<ConstantBool>(CV)) {
|
||||||
@@ -109,13 +109,13 @@ void AsmPrinter::emitConstantValueOnly(const Constant *CV) {
|
|||||||
if (int64_t Offset = TD.getIndexedOffset(ptrVal->getType(), idxVec)) {
|
if (int64_t Offset = TD.getIndexedOffset(ptrVal->getType(), idxVec)) {
|
||||||
if (Offset)
|
if (Offset)
|
||||||
O << "(";
|
O << "(";
|
||||||
emitConstantValueOnly(ptrVal);
|
EmitConstantValueOnly(ptrVal);
|
||||||
if (Offset > 0)
|
if (Offset > 0)
|
||||||
O << ") + " << Offset;
|
O << ") + " << Offset;
|
||||||
else if (Offset < 0)
|
else if (Offset < 0)
|
||||||
O << ") - " << -Offset;
|
O << ") - " << -Offset;
|
||||||
} else {
|
} else {
|
||||||
emitConstantValueOnly(ptrVal);
|
EmitConstantValueOnly(ptrVal);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -137,14 +137,14 @@ void AsmPrinter::emitConstantValueOnly(const Constant *CV) {
|
|||||||
|| (((TD.getTypeSize(Ty) >= TD.getTypeSize(OpTy))
|
|| (((TD.getTypeSize(Ty) >= TD.getTypeSize(OpTy))
|
||||||
&& OpTy->isLosslesslyConvertibleTo(Ty))))
|
&& OpTy->isLosslesslyConvertibleTo(Ty))))
|
||||||
&& "FIXME: Don't yet support this kind of constant cast expr");
|
&& "FIXME: Don't yet support this kind of constant cast expr");
|
||||||
emitConstantValueOnly(Op);
|
EmitConstantValueOnly(Op);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case Instruction::Add:
|
case Instruction::Add:
|
||||||
O << "(";
|
O << "(";
|
||||||
emitConstantValueOnly(CE->getOperand(0));
|
EmitConstantValueOnly(CE->getOperand(0));
|
||||||
O << ") + (";
|
O << ") + (";
|
||||||
emitConstantValueOnly(CE->getOperand(1));
|
EmitConstantValueOnly(CE->getOperand(1));
|
||||||
O << ")";
|
O << ")";
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
@@ -198,13 +198,13 @@ static void printAsCString(std::ostream &O, const ConstantArray *CVA,
|
|||||||
O << "\"";
|
O << "\"";
|
||||||
}
|
}
|
||||||
|
|
||||||
/// emitGlobalConstant - Print a general LLVM constant to the .s file.
|
/// EmitGlobalConstant - Print a general LLVM constant to the .s file.
|
||||||
///
|
///
|
||||||
void AsmPrinter::emitGlobalConstant(const Constant *CV) {
|
void AsmPrinter::EmitGlobalConstant(const Constant *CV) {
|
||||||
const TargetData &TD = TM.getTargetData();
|
const TargetData &TD = TM.getTargetData();
|
||||||
|
|
||||||
if (CV->isNullValue() || isa<UndefValue>(CV)) {
|
if (CV->isNullValue() || isa<UndefValue>(CV)) {
|
||||||
emitZeros(TD.getTypeSize(CV->getType()));
|
EmitZeros(TD.getTypeSize(CV->getType()));
|
||||||
return;
|
return;
|
||||||
} else if (const ConstantArray *CVA = dyn_cast<ConstantArray>(CV)) {
|
} else if (const ConstantArray *CVA = dyn_cast<ConstantArray>(CV)) {
|
||||||
if (CVA->isString()) {
|
if (CVA->isString()) {
|
||||||
@@ -220,7 +220,7 @@ void AsmPrinter::emitGlobalConstant(const Constant *CV) {
|
|||||||
O << "\n";
|
O << "\n";
|
||||||
} else { // Not a string. Print the values in successive locations
|
} else { // Not a string. Print the values in successive locations
|
||||||
for (unsigned i = 0, e = CVA->getNumOperands(); i != e; ++i)
|
for (unsigned i = 0, e = CVA->getNumOperands(); i != e; ++i)
|
||||||
emitGlobalConstant(CVA->getOperand(i));
|
EmitGlobalConstant(CVA->getOperand(i));
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
} else if (const ConstantStruct *CVS = dyn_cast<ConstantStruct>(CV)) {
|
} else if (const ConstantStruct *CVS = dyn_cast<ConstantStruct>(CV)) {
|
||||||
@@ -238,10 +238,10 @@ void AsmPrinter::emitGlobalConstant(const Constant *CV) {
|
|||||||
sizeSoFar += fieldSize + padSize;
|
sizeSoFar += fieldSize + padSize;
|
||||||
|
|
||||||
// Now print the actual field value
|
// Now print the actual field value
|
||||||
emitGlobalConstant(field);
|
EmitGlobalConstant(field);
|
||||||
|
|
||||||
// Insert the field padding unless it's zero bytes...
|
// Insert the field padding unless it's zero bytes...
|
||||||
emitZeros(padSize);
|
EmitZeros(padSize);
|
||||||
}
|
}
|
||||||
assert(sizeSoFar == cvsLayout->StructSize &&
|
assert(sizeSoFar == cvsLayout->StructSize &&
|
||||||
"Layout of constant struct may be incorrect!");
|
"Layout of constant struct may be incorrect!");
|
||||||
@@ -328,6 +328,6 @@ void AsmPrinter::emitGlobalConstant(const Constant *CV) {
|
|||||||
assert (0 && "Can't handle printing this type of thing");
|
assert (0 && "Can't handle printing this type of thing");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
emitConstantValueOnly(CV);
|
EmitConstantValueOnly(CV);
|
||||||
O << "\n";
|
O << "\n";
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user