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 | bd1d382cc47dfc43ee758714bc22ab5a750bad15 (patch) | |
tree | 580ba057e515d5a2c1176d6e1fc3c6fcab8d5ad5 /lib/CodeGen/AsmPrinter.cpp | |
parent | a79e7cca0dff44092b0b1a17a26a7af4bebc9d5d (diff) |
Add support for undef
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17055 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/AsmPrinter.cpp')
-rw-r--r-- | lib/CodeGen/AsmPrinter.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/CodeGen/AsmPrinter.cpp b/lib/CodeGen/AsmPrinter.cpp index 11565dff0b..eb57cced13 100644 --- a/lib/CodeGen/AsmPrinter.cpp +++ b/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)) { |