diff options
| author | Ted Kremenek <kremenek@apple.com> | 2010-09-30 01:06:29 +0000 |
|---|---|---|
| committer | Ted Kremenek <kremenek@apple.com> | 2010-09-30 01:06:29 +0000 |
| commit | b0e7d777299581209073ecde2d97570a73e08cf5 (patch) | |
| tree | 5b3443f647adef18cacb4673def039df5bdbbb55 /clang/lib/Checker | |
| parent | e18dd0a84e44a257880a9060241de2d58e9940f2 (diff) | |
| download | bcm5719-llvm-b0e7d777299581209073ecde2d97570a73e08cf5.tar.gz bcm5719-llvm-b0e7d777299581209073ecde2d97570a73e08cf5.zip | |
Include changes to VisitCXXMemberCallExpr (call visitor functions).
llvm-svn: 115120
Diffstat (limited to 'clang/lib/Checker')
| -rw-r--r-- | clang/lib/Checker/GRCXXExprEngine.cpp | 25 |
1 files changed, 19 insertions, 6 deletions
diff --git a/clang/lib/Checker/GRCXXExprEngine.cpp b/clang/lib/Checker/GRCXXExprEngine.cpp index 0cae455276d..c6be6b681da 100644 --- a/clang/lib/Checker/GRCXXExprEngine.cpp +++ b/clang/lib/Checker/GRCXXExprEngine.cpp @@ -157,13 +157,21 @@ void GRExprEngine::VisitCXXMemberCallExpr(const CXXMemberCallExpr *MCE, VisitLValue(ObjArgExpr, *I, AllArgsEvaluated); } + // Allow checkers to pre-visit the member call. + ExplodedNodeSet PreVisitChecks; + CheckerVisit(MCE, PreVisitChecks, AllArgsEvaluated, PreVisitStmtCallback); + + // Now evaluate the call itself. const CXXMethodDecl *MD = cast<CXXMethodDecl>(ME->getMemberDecl()); assert(MD && "not a CXXMethodDecl?"); - if (!(MD->isThisDeclarationADefinition() && AMgr.shouldInlineCall())) + if (!(MD->isThisDeclarationADefinition() && AMgr.shouldInlineCall())) { // FIXME: conservative method call evaluation. + CheckerVisit(MCE, Dst, PreVisitChecks, PostVisitStmtCallback); return; + } + ExplodedNodeSet SetupThis; const StackFrameContext *SFC = AMgr.getStackFrame(MD, Pred->getLocationContext(), MCE, @@ -171,15 +179,20 @@ void GRExprEngine::VisitCXXMemberCallExpr(const CXXMemberCallExpr *MCE, Builder->getIndex()); const CXXThisRegion *ThisR = getCXXThisRegion(MD, SFC); CallEnter Loc(MCE, SFC->getAnalysisContext(), Pred->getLocationContext()); - for (ExplodedNodeSet::iterator I = AllArgsEvaluated.begin(), - E = AllArgsEvaluated.end(); I != E; ++I) { + for (ExplodedNodeSet::iterator I = PreVisitChecks.begin(), + E = PreVisitChecks.end(); I != E; ++I) { // Set up 'this' region. const GRState *state = GetState(*I); state = state->bindLoc(loc::MemRegionVal(ThisR),state->getSVal(ObjArgExpr)); - ExplodedNode *N = Builder->generateNode(Loc, state, *I); - if (N) - Dst.Add(N); + SetupThis.Add(Builder->generateNode(Loc, state, *I)); } + + // FIXME: Perform the actual method call. Right now all we do is evaluate + // the arguments. + + // Perform post-visit. + CheckerVisit(MCE, Dst, /* FIXME: don't forget to update later */ SetupThis, + PostVisitStmtCallback); } void GRExprEngine::VisitCXXNewExpr(const CXXNewExpr *CNE, ExplodedNode *Pred, |

