diff options
author | Ted Kremenek <kremenek@apple.com> | 2010-09-10 03:05:33 +0000 |
---|---|---|
committer | Ted Kremenek <kremenek@apple.com> | 2010-09-10 03:05:33 +0000 |
commit | 4beaa9f51b2da57c64740cef2bd1c2fdb0c325d5 (patch) | |
tree | 0a9084d0cf99378e9fc85db7b414b9834bb000e6 /lib/Checker/GRExprEngine.cpp | |
parent | 383329eef5564ac24a7703574f181d55ccedbab4 (diff) |
Add ObjCAtSynchronizedStmt to the CFG and add GRExprEngine support (PreVisit for checkers).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113572 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Checker/GRExprEngine.cpp')
-rw-r--r-- | lib/Checker/GRExprEngine.cpp | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/lib/Checker/GRExprEngine.cpp b/lib/Checker/GRExprEngine.cpp index 18124e47fb..851f34e43b 100644 --- a/lib/Checker/GRExprEngine.cpp +++ b/lib/Checker/GRExprEngine.cpp @@ -809,6 +809,10 @@ void GRExprEngine::Visit(const Stmt* S, ExplodedNode* Pred, break; } + case Stmt::ObjCAtSynchronizedStmtClass: + VisitObjCAtSynchronizedStmt(cast<ObjCAtSynchronizedStmt>(S), Pred, Dst); + break; + // Cases not handled yet; but will handle some day. case Stmt::DesignatedInitExprClass: case Stmt::ExtVectorElementExprClass: @@ -816,7 +820,6 @@ void GRExprEngine::Visit(const Stmt* S, ExplodedNode* Pred, case Stmt::ImplicitValueInitExprClass: case Stmt::ObjCAtCatchStmtClass: case Stmt::ObjCAtFinallyStmtClass: - case Stmt::ObjCAtSynchronizedStmtClass: case Stmt::ObjCAtTryStmtClass: case Stmt::ObjCEncodeExprClass: case Stmt::ObjCImplicitSetterGetterRefExprClass: @@ -2244,6 +2247,23 @@ void GRExprEngine::EvalEagerlyAssume(ExplodedNodeSet &Dst, ExplodedNodeSet &Src, } //===----------------------------------------------------------------------===// +// Transfer function: Objective-C @synchronized. +//===----------------------------------------------------------------------===// + +void GRExprEngine::VisitObjCAtSynchronizedStmt(const ObjCAtSynchronizedStmt *S, + ExplodedNode *Pred, + ExplodedNodeSet &Dst) { + + // The mutex expression is a CFGElement, so we don't need to explicitly + // visit it since it will already be processed. + + // Pre-visit the ObjCAtSynchronizedStmt. + ExplodedNodeSet Tmp; + Tmp.Add(Pred); + CheckerVisit(S, Dst, Tmp, PreVisitStmtCallback); +} + +//===----------------------------------------------------------------------===// // Transfer function: Objective-C ivar references. //===----------------------------------------------------------------------===// |