mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-08-09 11:25:55 +00:00
I forgot that sparc no longer uses the shared asmwriter. Give it support
for undef. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17075 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -323,7 +323,9 @@ void AsmPrinter::printSingleConstantValue(const Constant* CV) {
|
|||||||
O << ConstantExprToString(CE, TM) << "\n";
|
O << ConstantExprToString(CE, TM) << "\n";
|
||||||
} else if (CV->getType()->isPrimitiveType()) {
|
} else if (CV->getType()->isPrimitiveType()) {
|
||||||
// Check primitive types last
|
// Check primitive types last
|
||||||
if (CV->getType()->isFloatingPoint()) {
|
if (isa<UndefValue>(CV)) {
|
||||||
|
O << "0\n";
|
||||||
|
} else if (CV->getType()->isFloatingPoint()) {
|
||||||
// FP Constants are printed as integer constants to avoid losing
|
// FP Constants are printed as integer constants to avoid losing
|
||||||
// precision...
|
// precision...
|
||||||
double Val = cast<ConstantFP>(CV)->getValue();
|
double Val = cast<ConstantFP>(CV)->getValue();
|
||||||
@@ -385,7 +387,7 @@ void AsmPrinter::printConstantValueOnly(const Constant* CV,
|
|||||||
}
|
}
|
||||||
assert(sizeSoFar == cvsLayout->StructSize &&
|
assert(sizeSoFar == cvsLayout->StructSize &&
|
||||||
"Layout of constant struct may be incorrect!");
|
"Layout of constant struct may be incorrect!");
|
||||||
} else if (isa<ConstantAggregateZero>(CV)) {
|
} else if (isa<ConstantAggregateZero>(CV) || isa<UndefValue>(CV)) {
|
||||||
PrintZeroBytesToPad(TM.getTargetData().getTypeSize(CV->getType()));
|
PrintZeroBytesToPad(TM.getTargetData().getTypeSize(CV->getType()));
|
||||||
} else
|
} else
|
||||||
printSingleConstantValue(CV);
|
printSingleConstantValue(CV);
|
||||||
|
Reference in New Issue
Block a user