From: Ted Kremenek Date: Mon, 2 Nov 2009 23:19:29 +0000 (+0000) Subject: Remove GRExprEngine::CheckerVisitLocation(). It was only called in one place, so... X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=0296c22557b3735e2ffeff690eb46fb0e9152bcc;p=clang Remove GRExprEngine::CheckerVisitLocation(). It was only called in one place, so we inlined it in to GRExprEngine::EvalLocation(). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85838 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/include/clang/Analysis/PathSensitive/GRExprEngine.h b/include/clang/Analysis/PathSensitive/GRExprEngine.h index 90124c279d..cfb9ce95ea 100644 --- a/include/clang/Analysis/PathSensitive/GRExprEngine.h +++ b/include/clang/Analysis/PathSensitive/GRExprEngine.h @@ -412,9 +412,6 @@ protected: void CheckerVisit(Stmt *S, ExplodedNodeSet &Dst, ExplodedNodeSet &Src, bool isPrevisit); - ExplodedNode *CheckerVisitLocation(Stmt *S, ExplodedNode *Pred, - const GRState *state, SVal V); - /// Visit - Transfer function logic for all statements. Dispatches to /// other functions that handle specific kinds of statements. void Visit(Stmt* S, ExplodedNode* Pred, ExplodedNodeSet& Dst); diff --git a/lib/Analysis/GRExprEngine.cpp b/lib/Analysis/GRExprEngine.cpp index 2ac10bbb6e..f9020eea21 100644 --- a/lib/Analysis/GRExprEngine.cpp +++ b/lib/Analysis/GRExprEngine.cpp @@ -139,21 +139,6 @@ void GRExprEngine::CheckerVisit(Stmt *S, ExplodedNodeSet &Dst, // automatically. } -ExplodedNode *GRExprEngine::CheckerVisitLocation(Stmt *S, ExplodedNode *Pred, - const GRState *state, SVal V) { - if (Checkers.empty()) - return Pred; - - for (CheckersOrdered::iterator I = Checkers.begin(), - E = Checkers.end(); I != E; ++I) { - Pred = I->second->CheckLocation(S, Pred, state, V, *this); - if (!Pred) - break; - } - - return Pred; -} - //===----------------------------------------------------------------------===// // Engine construction and deletion. //===----------------------------------------------------------------------===// @@ -1207,11 +1192,18 @@ ExplodedNode* GRExprEngine::EvalLocation(Stmt* Ex, ExplodedNode* Pred, SaveAndRestore OldTag(Builder->Tag); Builder->Tag = tag; - if (location.isUnknown()) + if (location.isUnknown() || Checkers.empty()) return Pred; - return CheckerVisitLocation(Ex, Pred, state, location); - + + for (CheckersOrdered::iterator I=Checkers.begin(), E=Checkers.end(); I!=E;++I) + { + Pred = I->second->CheckLocation(Ex, Pred, state, location, *this); + if (!Pred) + break; + } + + return Pred; // FIXME: Temporarily disable out-of-bounds checking until we make // the logic reflect recent changes to CastRegion and friends.