Add a cast
authorChris Lattner <sabre@nondot.org>
Wed, 4 Aug 2004 02:27:17 +0000 (02:27 +0000)
committerChris Lattner <sabre@nondot.org>
Wed, 4 Aug 2004 02:27:17 +0000 (02:27 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15457 91177308-0d34-0410-b5e6-96231b3b80d8

lib/VMCore/Globals.cpp

index ea8770101147569e4e3c51ad261dcc8c009f1705..2369d1c8eaa11d4f4e903f1a589d32fe64bda36e 100644 (file)
@@ -120,7 +120,7 @@ void GlobalVariable::replaceUsesOfWithOnConstant(Value *From, Value *To,
          "Attempt to replace GVar initializer with non-constant");
   
   // Okay, preconditions out of the way, replace the constant initializer.
-  this->setOperand(0,To);
+  this->setOperand(0, cast<Constant>(To));
 }
 
 // vim: sw=2 ai