Use CallbackVH, instead of WeakVH, to hold MDNode elements.
[oota-llvm.git] / lib / VMCore / Constants.cpp
index fd3266140c17ac7b0c97fa377107c9159c447d5b..37efafc9b208902ba9f1624cdf26ff1c54ea3852 100644 (file)
@@ -1880,7 +1880,7 @@ void ConstantArray::replaceUsesOfWithOnConstant(Value *From, Value *To,
       pImpl->ArrayConstants.InsertOrGetItem(Lookup, Exists);
     
     if (Exists) {
-      Replacement = cast<Constant>(I->second);
+      Replacement = I->second;
     } else {
       // Okay, the new shape doesn't exist in the system yet.  Instead of
       // creating a new constant array, inserting it, replaceallusesof'ing the
@@ -1967,7 +1967,7 @@ void ConstantStruct::replaceUsesOfWithOnConstant(Value *From, Value *To,
       pImpl->StructConstants.InsertOrGetItem(Lookup, Exists);
     
     if (Exists) {
-      Replacement = cast<Constant>(I->second);
+      Replacement = I->second;
     } else {
       // Okay, the new shape doesn't exist in the system yet.  Instead of
       // creating a new constant struct, inserting it, replaceallusesof'ing the