[cfe-commits] r49756 - /cfe/trunk/lib/Analysis/CFRefCount.cpp

Ted Kremenek kremenek at apple.com
Tue Apr 15 16:44:31 PDT 2008


Author: kremenek
Date: Tue Apr 15 18:44:31 2008
New Revision: 49756

URL: http://llvm.org/viewvc/llvm-project?rev=49756&view=rev
Log:
Added initial boilerplate to support toll-free bridging in the ref-count checker.

Modified:
    cfe/trunk/lib/Analysis/CFRefCount.cpp

Modified: cfe/trunk/lib/Analysis/CFRefCount.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Analysis/CFRefCount.cpp?rev=49756&r1=49755&r2=49756&view=diff

==============================================================================
--- cfe/trunk/lib/Analysis/CFRefCount.cpp (original)
+++ cfe/trunk/lib/Analysis/CFRefCount.cpp Tue Apr 15 18:44:31 2008
@@ -600,6 +600,18 @@
                         CallExpr* CE, LVal L,
                         ExplodedNode<ValueState>* Pred);  
   
+  virtual void EvalObjCMessageExpr(ExplodedNodeSet<ValueState>& Dst,
+                                   GRExprEngine& Engine,
+                                   GRStmtNodeBuilder<ValueState>& Builder,
+                                   ObjCMessageExpr* ME,
+                                   ExplodedNode<ValueState>* Pred);
+  
+  bool EvalObjCMessageExprAux(ExplodedNodeSet<ValueState>& Dst,
+                              GRExprEngine& Engine,
+                              GRStmtNodeBuilder<ValueState>& Builder,
+                              ObjCMessageExpr* ME,
+                              ExplodedNode<ValueState>* Pred);
+
   // End-of-path.
   
   virtual void EvalEndPath(GRExprEngine& Engine,
@@ -802,6 +814,34 @@
   Builder.MakeNode(Dst, CE, Pred, St);
 }
 
+
+void CFRefCount::EvalObjCMessageExpr(ExplodedNodeSet<ValueState>& Dst,
+                                     GRExprEngine& Eng,
+                                     GRStmtNodeBuilder<ValueState>& Builder,
+                                     ObjCMessageExpr* ME,
+                                     ExplodedNode<ValueState>* Pred) {
+  
+  if (EvalObjCMessageExprAux(Dst, Eng, Builder, ME, Pred))
+    GRSimpleVals::EvalObjCMessageExpr(Dst, Eng, Builder, ME, Pred);
+}
+
+bool CFRefCount::EvalObjCMessageExprAux(ExplodedNodeSet<ValueState>& Dst,
+                                        GRExprEngine& Eng,
+                                        GRStmtNodeBuilder<ValueState>& Builder,
+                                        ObjCMessageExpr* ME,
+                                        ExplodedNode<ValueState>* Pred) {
+    
+  // Handle "toll-free bridging."  Eventually we will want to track the
+  // underlying object type associated.
+  
+  Selector S = ME->getSelector();
+  
+  if (!S.isUnarySelector())
+    return true;
+
+  return true; // FIXME: change to return false when more is implemented.
+}
+
 // End-of-path.
 
 void CFRefCount::EvalEndPath(GRExprEngine& Engine,





More information about the cfe-commits mailing list