diff options
author | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2011-02-28 01:26:35 +0000 |
---|---|---|
committer | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2011-02-28 01:26:35 +0000 |
commit | 312dbec867f6b8d6b86fd562c53352cd4db27468 (patch) | |
tree | 3f99be744eb115066a9d2be4a06a4749abe14f9f /include/clang/StaticAnalyzer/Core/CheckerManager.h | |
parent | 3fe71f445f76003649b5da24209e80225a7ee74f (diff) |
[analyzer] Migrate MallocChecker to CheckerV2.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126606 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/clang/StaticAnalyzer/Core/CheckerManager.h')
-rw-r--r-- | include/clang/StaticAnalyzer/Core/CheckerManager.h | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/include/clang/StaticAnalyzer/Core/CheckerManager.h b/include/clang/StaticAnalyzer/Core/CheckerManager.h index 1ad85d2e42..f7ee2bed8d 100644 --- a/include/clang/StaticAnalyzer/Core/CheckerManager.h +++ b/include/clang/StaticAnalyzer/Core/CheckerManager.h @@ -189,6 +189,12 @@ public: const Stmt *S, ExprEngine &Eng); + /// \brief Run checkers for binding of a value to a location. + void runCheckersForBind(ExplodedNodeSet &Dst, + const ExplodedNodeSet &Src, + SVal location, SVal val, + const Stmt *S, ExprEngine &Eng); + /// \brief Run checkers for end of analysis. void runCheckersForEndAnalysis(ExplodedGraph &G, BugReporter &BR, ExprEngine &Eng); @@ -214,6 +220,10 @@ public: const MemRegion * const *Begin, const MemRegion * const *End); + /// \brief Run checkers for handling assumptions on symbolic values. + const GRState *runCheckersForEvalAssume(const GRState *state, + SVal Cond, bool Assumption); + /// \brief Run checkers for evaluating a call. void runCheckersForEvalCall(ExplodedNodeSet &Dst, const ExplodedNodeSet &Src, @@ -243,6 +253,8 @@ public: typedef CheckerFn<const ObjCMessage &, CheckerContext &> CheckObjCMessageFunc; typedef CheckerFn<const SVal &/*location*/, bool/*isLoad*/, CheckerContext &> CheckLocationFunc; + typedef CheckerFn<const SVal &/*location*/, const SVal &/*val*/, + CheckerContext &> CheckBindFunc; typedef CheckerFn<ExplodedGraph &, BugReporter &, ExprEngine &> CheckEndAnalysisFunc; typedef CheckerFn<EndOfFunctionNodeBuilder &, ExprEngine &> CheckEndPathFunc; @@ -260,6 +272,8 @@ public: void _registerForLocation(CheckLocationFunc checkfn); + void _registerForBind(CheckBindFunc checkfn); + void _registerForEndAnalysis(CheckEndAnalysisFunc checkfn); void _registerForEndPath(CheckEndPathFunc checkfn); @@ -298,6 +312,21 @@ public: void _registerForRegionChanges(CheckRegionChangesFunc checkfn, WantsRegionChangeUpdateFunc wantUpdateFn); + class EvalAssumeFunc { + typedef const GRState * (*Func)(void *, const GRState *, + const SVal &/*cond*/, bool /*assumption*/); + Func Fn; + public: + void *Checker; + EvalAssumeFunc(void *checker, Func fn) : Fn(fn), Checker(checker) {} + const GRState *operator()(const GRState *state, + const SVal &cond, bool assumption) { + return Fn(Checker, state, cond, assumption); + } + }; + + void _registerForEvalAssume(EvalAssumeFunc checkfn); + class EvalCallFunc { typedef bool (*Func)(void *, const CallExpr *, CheckerContext &); Func Fn; @@ -380,6 +409,8 @@ private: std::vector<CheckLocationFunc> LocationCheckers; + std::vector<CheckBindFunc> BindCheckers; + std::vector<CheckEndAnalysisFunc> EndAnalysisCheckers; std::vector<CheckEndPathFunc> EndPathCheckers; @@ -394,6 +425,8 @@ private: }; std::vector<RegionChangesCheckerInfo> RegionChangesCheckers; + std::vector<EvalAssumeFunc> EvalAssumeCheckers; + std::vector<EvalCallFunc> EvalCallCheckers; }; |