mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-13 20:32:21 +00:00
Support UndefValue emission.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17721 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
d85f0af7c2
commit
54799c2a51
@ -131,7 +131,7 @@ static void printAsCString(std::ostream &O, const ConstantArray *CVA) {
|
||||
// Print out the specified constant, without a storage class. Only the
|
||||
// constants valid in constant expressions can occur here.
|
||||
void V8Printer::emitConstantValueOnly(const Constant *CV) {
|
||||
if (CV->isNullValue())
|
||||
if (CV->isNullValue() || isa<UndefValue> (CV))
|
||||
O << "0";
|
||||
else if (const ConstantBool *CB = dyn_cast<ConstantBool>(CV)) {
|
||||
assert(CB == ConstantBool::True);
|
||||
@ -266,6 +266,10 @@ void V8Printer::emitGlobalConstant(const Constant *CV) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
} else if (isa<UndefValue> (CV)) {
|
||||
unsigned size = TD.getTypeSize (CV->getType ());
|
||||
O << "\t.skip\t " << size << "\n";
|
||||
return;
|
||||
}
|
||||
|
||||
const Type *type = CV->getType();
|
||||
|
@ -131,7 +131,7 @@ static void printAsCString(std::ostream &O, const ConstantArray *CVA) {
|
||||
// Print out the specified constant, without a storage class. Only the
|
||||
// constants valid in constant expressions can occur here.
|
||||
void V8Printer::emitConstantValueOnly(const Constant *CV) {
|
||||
if (CV->isNullValue())
|
||||
if (CV->isNullValue() || isa<UndefValue> (CV))
|
||||
O << "0";
|
||||
else if (const ConstantBool *CB = dyn_cast<ConstantBool>(CV)) {
|
||||
assert(CB == ConstantBool::True);
|
||||
@ -266,6 +266,10 @@ void V8Printer::emitGlobalConstant(const Constant *CV) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
} else if (isa<UndefValue> (CV)) {
|
||||
unsigned size = TD.getTypeSize (CV->getType ());
|
||||
O << "\t.skip\t " << size << "\n";
|
||||
return;
|
||||
}
|
||||
|
||||
const Type *type = CV->getType();
|
||||
|
Loading…
Reference in New Issue
Block a user