diff options
Diffstat (limited to 'include/clang/Checker')
-rw-r--r-- | include/clang/Checker/PathSensitive/AnalysisManager.h | 17 | ||||
-rw-r--r-- | include/clang/Checker/PathSensitive/GRExprEngine.h | 2 | ||||
-rw-r--r-- | include/clang/Checker/PathSensitive/Store.h | 14 |
3 files changed, 26 insertions, 7 deletions
diff --git a/include/clang/Checker/PathSensitive/AnalysisManager.h b/include/clang/Checker/PathSensitive/AnalysisManager.h index 0c59d7b..3c7cb68 100644 --- a/include/clang/Checker/PathSensitive/AnalysisManager.h +++ b/include/clang/Checker/PathSensitive/AnalysisManager.h @@ -37,8 +37,12 @@ class AnalysisManager : public BugReporterData { enum AnalysisScope { ScopeTU, ScopeDecl } AScope; + // The maximum number of exploded nodes the analyzer will generate. unsigned MaxNodes; + // The maximum number of times the analyzer will go through a loop. + unsigned MaxLoop; + bool VisualizeEGDot; bool VisualizeEGUbi; bool PurgeDead; @@ -52,19 +56,22 @@ class AnalysisManager : public BugReporterData { // bifurcates paths. bool EagerlyAssume; bool TrimGraph; + bool InlineCall; public: AnalysisManager(ASTContext &ctx, Diagnostic &diags, const LangOptions &lang, PathDiagnosticClient *pd, StoreManagerCreator storemgr, ConstraintManagerCreator constraintmgr, unsigned maxnodes, - bool vizdot, bool vizubi, bool purge, bool eager, bool trim) + unsigned maxloop, + bool vizdot, bool vizubi, bool purge, bool eager, bool trim, + bool inlinecall) : Ctx(ctx), Diags(diags), LangInfo(lang), PD(pd), CreateStoreMgr(storemgr), CreateConstraintMgr(constraintmgr), - AScope(ScopeDecl), MaxNodes(maxnodes), + AScope(ScopeDecl), MaxNodes(maxnodes), MaxLoop(maxloop), VisualizeEGDot(vizdot), VisualizeEGUbi(vizubi), PurgeDead(purge), - EagerlyAssume(eager), TrimGraph(trim) {} + EagerlyAssume(eager), TrimGraph(trim), InlineCall(inlinecall) {} ~AnalysisManager() { FlushDiagnostics(); } @@ -108,6 +115,8 @@ public: unsigned getMaxNodes() const { return MaxNodes; } + unsigned getMaxLoop() const { return MaxLoop; } + bool shouldVisualizeGraphviz() const { return VisualizeEGDot; } bool shouldVisualizeUbigraph() const { return VisualizeEGUbi; } @@ -122,6 +131,8 @@ public: bool shouldEagerlyAssume() const { return EagerlyAssume; } + bool shouldInlineCall() const { return InlineCall; } + CFG *getCFG(Decl const *D) { return AnaCtxMgr.getContext(D)->getCFG(); } diff --git a/include/clang/Checker/PathSensitive/GRExprEngine.h b/include/clang/Checker/PathSensitive/GRExprEngine.h index f04ca75..ac407f6 100644 --- a/include/clang/Checker/PathSensitive/GRExprEngine.h +++ b/include/clang/Checker/PathSensitive/GRExprEngine.h @@ -456,6 +456,8 @@ private: void EvalLocation(ExplodedNodeSet &Dst, Stmt *S, ExplodedNode* Pred, const GRState* St, SVal location, const void *tag, bool isLoad); + + bool InlineCall(ExplodedNodeSet &Dst, const CallExpr *CE, ExplodedNode *Pred); }; } // end clang namespace diff --git a/include/clang/Checker/PathSensitive/Store.h b/include/clang/Checker/PathSensitive/Store.h index 41d7c2b..f3155b9 100644 --- a/include/clang/Checker/PathSensitive/Store.h +++ b/include/clang/Checker/PathSensitive/Store.h @@ -18,6 +18,7 @@ #include "clang/Checker/PathSensitive/SVals.h" #include "clang/Checker/PathSensitive/ValueManager.h" #include "llvm/ADT/DenseSet.h" +#include "llvm/ADT/Optional.h" namespace clang { @@ -143,9 +144,9 @@ public: return UnknownVal(); } - virtual Store RemoveDeadBindings(Store store, Stmt* Loc, - const StackFrameContext *LCtx, - SymbolReaper& SymReaper, + virtual const GRState *RemoveDeadBindings(GRState &state, Stmt* Loc, + const StackFrameContext *LCtx, + SymbolReaper& SymReaper, llvm::SmallVectorImpl<const MemRegion*>& RegionRoots) = 0; virtual Store BindDecl(Store store, const VarRegion *VR, SVal initVal) = 0; @@ -167,10 +168,15 @@ public: // FIXME: Make out-of-line. virtual const GRState *setExtent(const GRState *state, - const MemRegion *region, SVal extent) { + const MemRegion *region, SVal extent) { return state; } + virtual llvm::Optional<SVal> getExtent(const GRState *state, + const MemRegion *R) { + return llvm::Optional<SVal>(); + } + /// EnterStackFrame - Let the StoreManager to do something when execution /// engine is about to execute into a callee. virtual const GRState *EnterStackFrame(const GRState *state, |