class BugType;
class PathDiagnosticClient;
class Diagnostic;
- class ParentMap;
class BugReporterData;
class GRExprEngine {
/// G - the simulation graph.
GraphTy& G;
- /// Parents - a lazily created map from Stmt* to parents.
- ParentMap* Parents;
-
/// Liveness - live-variables information the ValueDecl* and block-level
/// Expr* in the CFG. Used to prune out dead state.
LiveVariables& Liveness;
GraphTy& getGraph() { return G; }
const GraphTy& getGraph() const { return G; }
-
- /// getParentMap - Return a map from Stmt* to parents for the function/method
- /// body being analyzed. This map is lazily constructed as needed.
- ParentMap& getParentMap();
-
+
typedef BugTypeSet::iterator bug_type_iterator;
typedef BugTypeSet::const_iterator const_bug_type_iterator;
//
//===----------------------------------------------------------------------===//
-#include "clang/AST/ParentMap.h"
#include "clang/Analysis/PathSensitive/GRExprEngine.h"
#include "clang/Analysis/PathSensitive/BugReporter.h"
#include "clang/Basic/SourceManager.h"
LiveVariables& L)
: CoreEngine(cfg, CD, Ctx, *this),
G(CoreEngine.getGraph()),
- Parents(0),
Liveness(L),
Builder(NULL),
StateMgr(G.getContext(), G.getAllocator()),
delete *I;
delete [] NSExceptionInstanceRaiseSelectors;
-
- delete Parents;
-}
-
-ParentMap& GRExprEngine::getParentMap() {
- if (!Parents) {
- Stmt* Body = getGraph().getCodeDecl().getCodeBody();
- Parents = new ParentMap(Body);
- }
-
- return *Parents;
}
//===----------------------------------------------------------------------===//