diff options
Diffstat (limited to 'include/clang/Analysis/PathSensitive')
4 files changed, 23 insertions, 18 deletions
diff --git a/include/clang/Analysis/PathSensitive/AnalysisManager.h b/include/clang/Analysis/PathSensitive/AnalysisManager.h index 503c809c88..deff4818ce 100644 --- a/include/clang/Analysis/PathSensitive/AnalysisManager.h +++ b/include/clang/Analysis/PathSensitive/AnalysisManager.h @@ -23,7 +23,7 @@ namespace clang { class AnalysisManager : public BugReporterData { AnalysisContextManager ContextMgr; - AnalysisContext *RootContext; + AnalysisContext *EntryContext; LocationContextManager LocCtxMgr; @@ -59,7 +59,7 @@ public: VisualizeEGDot(vizdot), VisualizeEGUbi(vizubi), PurgeDead(purge), EagerlyAssume(eager), TrimGraph(trim) { - RootContext = ContextMgr.getContext(d); + EntryContext = ContextMgr.getContext(d); } AnalysisManager(ASTContext &ctx, Diagnostic &diags, @@ -75,22 +75,22 @@ public: VisualizeEGDot(vizdot), VisualizeEGUbi(vizubi), PurgeDead(purge), EagerlyAssume(eager), TrimGraph(trim) { - RootContext = 0; + EntryContext = 0; } - void setContext(Decl *D) { - RootContext = ContextMgr.getContext(D); + void setEntryContext(Decl *D) { + EntryContext = ContextMgr.getContext(D); DisplayedFunction = false; } Decl *getCodeDecl() const { assert (AScope == ScopeDecl); - return RootContext->getDecl(); + return EntryContext->getDecl(); } Stmt *getBody() const { assert (AScope == ScopeDecl); - return RootContext->getBody(); + return EntryContext->getBody(); } StoreManagerCreator getStoreManagerCreator() { @@ -102,15 +102,15 @@ public: } virtual CFG *getCFG() { - return RootContext->getCFG(); + return EntryContext->getCFG(); } virtual ParentMap &getParentMap() { - return RootContext->getParentMap(); + return EntryContext->getParentMap(); } virtual LiveVariables *getLiveVariables() { - return RootContext->getLiveVariables(); + return EntryContext->getLiveVariables(); } virtual ASTContext &getContext() { @@ -133,8 +133,8 @@ public: return PD.get(); } - StackFrameContext *getRootStackFrame() { - return LocCtxMgr.getStackFrame(RootContext, 0, 0); + StackFrameContext *getEntryStackFrame() { + return LocCtxMgr.getStackFrame(EntryContext, 0, 0); } bool shouldVisualizeGraphviz() const { return VisualizeEGDot; } diff --git a/include/clang/Analysis/PathSensitive/ExplodedGraph.h b/include/clang/Analysis/PathSensitive/ExplodedGraph.h index d3da3c105f..9b6507420b 100644 --- a/include/clang/Analysis/PathSensitive/ExplodedGraph.h +++ b/include/clang/Analysis/PathSensitive/ExplodedGraph.h @@ -39,7 +39,6 @@ class ASTContext; //===----------------------------------------------------------------------===// class ExplodedNode : public llvm::FoldingSetNode { -protected: friend class ExplodedGraph; friend class GRCoreEngine; friend class GRStmtNodeBuilder; @@ -111,6 +110,10 @@ public: /// getLocation - Returns the edge associated with the given node. ProgramPoint getLocation() const { return Location; } + const LocationContext *getLocationContext() const { + return getLocation().getContext(); + } + const GRState* getState() const { return State; } diff --git a/include/clang/Analysis/PathSensitive/GRCoreEngine.h b/include/clang/Analysis/PathSensitive/GRCoreEngine.h index e26f376a36..29336a195a 100644 --- a/include/clang/Analysis/PathSensitive/GRCoreEngine.h +++ b/include/clang/Analysis/PathSensitive/GRCoreEngine.h @@ -124,7 +124,7 @@ public: /// ExecuteWorkList - Run the worklist algorithm for a maximum number of /// steps. Returns true if there is still simulation state on the worklist. - bool ExecuteWorkList(unsigned Steps); + bool ExecuteWorkList(const LocationContext *L, unsigned Steps); CFG& getCFG() { return G->getCFG(); } }; diff --git a/include/clang/Analysis/PathSensitive/GRExprEngine.h b/include/clang/Analysis/PathSensitive/GRExprEngine.h index 7b29039714..dcf4e56d11 100644 --- a/include/clang/Analysis/PathSensitive/GRExprEngine.h +++ b/include/clang/Analysis/PathSensitive/GRExprEngine.h @@ -16,6 +16,7 @@ #ifndef LLVM_CLANG_ANALYSIS_GREXPRENGINE #define LLVM_CLANG_ANALYSIS_GREXPRENGINE +#include "clang/Analysis/PathSensitive/AnalysisManager.h" #include "clang/Analysis/PathSensitive/GRSubEngine.h" #include "clang/Analysis/PathSensitive/GRCoreEngine.h" #include "clang/Analysis/PathSensitive/GRState.h" @@ -33,7 +34,8 @@ namespace clang { class Checker; class GRExprEngine : public GRSubEngine { -protected: + AnalysisManager &AMgr; + GRCoreEngine CoreEngine; /// G - the simulation graph. @@ -201,15 +203,15 @@ public: public: GRExprEngine(CFG& cfg, Decl& CD, ASTContext& Ctx, LiveVariables& L, - BugReporterData& BRD, + AnalysisManager &mgr, bool purgeDead, bool eagerlyAssume = true, StoreManagerCreator SMC = CreateBasicStoreManager, ConstraintManagerCreator CMC = CreateBasicConstraintManager); ~GRExprEngine(); - void ExecuteWorkList(unsigned Steps = 150000) { - CoreEngine.ExecuteWorkList(Steps); + void ExecuteWorkList(const LocationContext *L, unsigned Steps = 150000) { + CoreEngine.ExecuteWorkList(L, Steps); } /// getContext - Return the ASTContext associated with this analysis. |