]> granicus.if.org Git - clang/commitdiff
Add 'cast<>' to remove an extra function call and dynamic cast.
authorTed Kremenek <kremenek@apple.com>
Thu, 5 Mar 2009 03:44:53 +0000 (03:44 +0000)
committerTed Kremenek <kremenek@apple.com>
Thu, 5 Mar 2009 03:44:53 +0000 (03:44 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66131 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Analysis/GRExprEngine.cpp

index 89ae70c090130ee6680ffb96f529e8079b5e2b9d..1d2c70cba2acbd6435450d25d2a7d7cfd65172a8 100644 (file)
@@ -1720,8 +1720,8 @@ void GRExprEngine::VisitCastPointerToInteger(SVal V, const GRState* state,
     // FIXME: Determine if the number of bits of the target type is 
     // equal or exceeds the number of bits to store the pointer value.
     // If not, flag an error.    
-    MakeNode(Dst, CastE, Pred, BindExpr(state, CastE,
-                                        EvalCast(V, CastE->getType())));
+    MakeNode(Dst, CastE, Pred, BindExpr(state, CastE, EvalCast(cast<Loc>(V),
+                                                               CastE->getType())));
   }
   else  
     MakeNode(Dst, CastE, Pred, BindExpr(state, CastE, V));