]> granicus.if.org Git - clang/commitdiff
[analyzer] Handle reads of ObjCPropertyRefExprs implicitly in Environment. No need...
authorTed Kremenek <kremenek@apple.com>
Sat, 20 Aug 2011 06:23:25 +0000 (06:23 +0000)
committerTed Kremenek <kremenek@apple.com>
Sat, 20 Aug 2011 06:23:25 +0000 (06:23 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138196 91177308-0d34-0410-b5e6-96231b3b80d8

include/clang/StaticAnalyzer/Core/PathSensitive/ExprEngine.h
lib/StaticAnalyzer/Core/Environment.cpp
lib/StaticAnalyzer/Core/ExprEngine.cpp
lib/StaticAnalyzer/Core/ExprEngineObjC.cpp

index a7fb5b57095edaf7c1a132c76e978d089c28fd9c..b1dfcc05b0f0e2b792b445e11af9a851277c85d0 100644 (file)
@@ -298,9 +298,6 @@ public:
   void VisitObjCAtSynchronizedStmt(const ObjCAtSynchronizedStmt *S,
                                    ExplodedNode *Pred, ExplodedNodeSet &Dst);
 
-  void VisitObjCPropertyRefExpr(const ObjCPropertyRefExpr *E,
-                                ExplodedNode *Pred, ExplodedNodeSet &Dst);
-
   /// Transfer function logic for computing the lvalue of an Objective-C ivar.
   void VisitLvalObjCIvarRefExpr(const ObjCIvarRefExpr *DR, ExplodedNode *Pred,
                                 ExplodedNodeSet &Dst);
index 2cc8bb0e77bf9fd3dc4f1f8906ae30529e1b63b6..2d37e53ceeefea534c103c0d97202868cd574834 100644 (file)
@@ -11,6 +11,7 @@
 //
 //===----------------------------------------------------------------------===//
 
+#include "clang/AST/ExprObjC.h"
 #include "clang/Analysis/AnalysisContext.h"
 #include "clang/Analysis/CFG.h"
 #include "clang/StaticAnalyzer/Core/PathSensitive/ProgramState.h"
@@ -83,6 +84,9 @@ SVal Environment::getSVal(const Stmt *E, SValBuilder& svalBuilder,
       case Stmt::CXXBindTemporaryExprClass:
         E = cast<CXXBindTemporaryExpr>(E)->getSubExpr();
         continue;
+      case Stmt::ObjCPropertyRefExprClass:
+        return loc::ObjCPropRef(cast<ObjCPropertyRefExpr>(E));
+        
       // Handle all other Stmt* using a lookup.
       default:
         break;
index c1204479c60e1cb0f9c54a114ccf64fedd7efca5..1b72672dcaa711a6086ac23d07c6a8a94ab4772e 100644 (file)
@@ -540,7 +540,8 @@ void ExprEngine::Visit(const Stmt *S, ExplodedNode *Pred,
       break;
 
     case Stmt::ObjCPropertyRefExprClass:
-      VisitObjCPropertyRefExpr(cast<ObjCPropertyRefExpr>(S), Pred, Dst);
+      // Implicitly handled by Environment::getSVal().
+      Dst.Add(Pred);
       break;
 
     case Stmt::ImplicitValueInitExprClass: {
index 7e67667802b71fba322be9cb6397276b384a8387..34426defec9617029d75f9db01d2ce8f84ee40a2 100644 (file)
@@ -237,9 +237,3 @@ void ExprEngine::VisitObjCMessage(const ObjCMessage &msg,
   // the created nodes in 'Dst'.
   getCheckerManager().runCheckersForPostObjCMessage(Dst, dstEval, msg, *this);
 }
-
-void ExprEngine::VisitObjCPropertyRefExpr(const ObjCPropertyRefExpr *Ex,
-                                          ExplodedNode *Pred,
-                                          ExplodedNodeSet &Dst) {
-  MakeNode(Dst, Ex, Pred, Pred->getState()->BindExpr(Ex, loc::ObjCPropRef(Ex)));
-}