diff options
author | Chris Lattner <sabre@nondot.org> | 2004-10-16 18:19:26 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2004-10-16 18:19:26 +0000 |
commit | 61753bf84796694f1165e333c3190cc02ea03ba1 (patch) | |
tree | 098546dcacfabbdee05ac793216998c7df7f8d8a /llvm/lib/CodeGen/AsmPrinter.cpp | |
parent | 770709befe9000505daf38f116e7bfb46e3db228 (diff) | |
download | bcm5719-llvm-61753bf84796694f1165e333c3190cc02ea03ba1.tar.gz bcm5719-llvm-61753bf84796694f1165e333c3190cc02ea03ba1.zip |
Add support for undef
llvm-svn: 17055
Diffstat (limited to 'llvm/lib/CodeGen/AsmPrinter.cpp')
-rw-r--r-- | llvm/lib/CodeGen/AsmPrinter.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter.cpp b/llvm/lib/CodeGen/AsmPrinter.cpp index 11565dff0b3..eb57cced13e 100644 --- a/llvm/lib/CodeGen/AsmPrinter.cpp +++ b/llvm/lib/CodeGen/AsmPrinter.cpp @@ -55,7 +55,7 @@ void AsmPrinter::emitZeros(unsigned NumZeros) const { // Print out the specified constant, without a storage class. Only the // constants valid in constant expressions can occur here. void AsmPrinter::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); @@ -171,7 +171,7 @@ static void printAsCString(std::ostream &O, const ConstantArray *CVA) { void AsmPrinter::emitGlobalConstant(const Constant *CV) { const TargetData &TD = TM.getTargetData(); - if (CV->isNullValue()) { + if (CV->isNullValue() || isa<UndefValue>(CV)) { emitZeros(TD.getTypeSize(CV->getType())); return; } else if (const ConstantArray *CVA = dyn_cast<ConstantArray>(CV)) { |