Add support for UndefValue
authorChris Lattner <sabre@nondot.org>
Sat, 16 Oct 2004 18:10:31 +0000 (18:10 +0000)
committerChris Lattner <sabre@nondot.org>
Sat, 16 Oct 2004 18:10:31 +0000 (18:10 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17046 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Transforms/Utils/ValueMapper.cpp

index d7507f9f07fb29ae30b7241ab2f8e883fb2db289..299a093364c5211ededc4b0bbeb52c07876f00c5 100644 (file)
@@ -31,7 +31,8 @@ Value *llvm::MapValue(const Value *V, std::map<const Value*, Value*> &VM) {
 
   if (Constant *C = const_cast<Constant*>(dyn_cast<Constant>(V))) {
     if (isa<ConstantIntegral>(C) || isa<ConstantFP>(C) ||
-        isa<ConstantPointerNull>(C) || isa<ConstantAggregateZero>(C))
+        isa<ConstantPointerNull>(C) || isa<ConstantAggregateZero>(C) ||
+        isa<UndefValue>(C))
       return VMSlot = C;           // Primitive constants map directly
     else if (ConstantArray *CA = dyn_cast<ConstantArray>(C)) {
       for (unsigned i = 0, e = CA->getNumOperands(); i != e; ++i) {