]> granicus.if.org Git - llvm/commitdiff
New const_cast instead of c style cast
authorChris Lattner <sabre@nondot.org>
Fri, 18 Apr 2003 03:49:49 +0000 (03:49 +0000)
committerChris Lattner <sabre@nondot.org>
Fri, 18 Apr 2003 03:49:49 +0000 (03:49 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5805 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Transforms/Utils/ValueMapper.cpp

index b54a1a0e42a86f1f222e063f6536de2b80f88459..484765a7e25a19b0d51db3a005e016f88c8fd404 100644 (file)
@@ -13,7 +13,7 @@ Value *MapValue(const Value *V, std::map<const Value*, Value*> &VM) {
   Value *&VMSlot = VM[V];
   if (VMSlot) return VMSlot;      // Does it exist in the map yet?
   
-  if (Constant *C = (Constant*)dyn_cast<Constant>(V)) {
+  if (Constant *C = const_cast<Constant*>(dyn_cast<Constant>(V))) {
     if (isa<ConstantIntegral>(C) || isa<ConstantFP>(C) ||
         isa<ConstantPointerNull>(C))
       return VMSlot = C;           // Primitive constants map directly