Support UndefValue emission.

llvm-svn: 17721
This commit is contained in:
Brian Gaeke 2004-11-14 03:22:05 +00:00
parent 0fbc9c8350
commit 07097e12d5
1 changed files with 5 additions and 1 deletions

View File

@ -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();