diff options
author | Ted Kremenek <kremenek@apple.com> | 2008-03-11 18:25:33 +0000 |
---|---|---|
committer | Ted Kremenek <kremenek@apple.com> | 2008-03-11 18:25:33 +0000 |
commit | 493d7a26d5ea319770ba904b43f2740d43b820cb (patch) | |
tree | 50a19a7b85d0aec74cb7ce9a3df3e3da53aec5bf | |
parent | 23f4127411d926fc6a1fe9af7c2bf97e653f16eb (diff) |
Expanded graph visualization interface to include specifying a range of
nodes to use a trim sources.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48236 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | Analysis/GRExprEngine.cpp | 39 | ||||
-rw-r--r-- | include/clang/Analysis/PathSensitive/GRExprEngine.h | 2 |
2 files changed, 27 insertions, 14 deletions
diff --git a/Analysis/GRExprEngine.cpp b/Analysis/GRExprEngine.cpp index 15fe88ec1c..6d1c03d537 100644 --- a/Analysis/GRExprEngine.cpp +++ b/Analysis/GRExprEngine.cpp @@ -1814,28 +1814,39 @@ static void AddSources(llvm::SmallVector<GRExprEngine::NodeTy*, 10>& Sources, #endif void GRExprEngine::ViewGraph(bool trim) { -#ifndef NDEBUG - GraphPrintCheckerState = this; - GraphPrintSourceManager = &getContext().getSourceManager(); - +#ifndef NDEBUG if (trim) { llvm::SmallVector<NodeTy*, 10> Sources; AddSources(Sources, null_derefs_begin(), null_derefs_end()); AddSources(Sources, undef_derefs_begin(), undef_derefs_end()); - GRExprEngine::GraphTy* TrimmedG = G.Trim(&Sources[0], - &Sources[0]+Sources.size()); - - if (!TrimmedG) - llvm::cerr << "warning: Trimmed ExplodedGraph is empty.\n"; - else { - llvm::ViewGraph(*TrimmedG->roots_begin(), "TrimmedGRExprEngine"); - delete TrimmedG; - } + ViewGraph(&Sources[0], &Sources[0]+Sources.size()); } - else + else { + GraphPrintCheckerState = this; + GraphPrintSourceManager = &getContext().getSourceManager(); + llvm::ViewGraph(*G.roots_begin(), "GRExprEngine"); + + GraphPrintCheckerState = NULL; + GraphPrintSourceManager = NULL; + } +#endif +} + +void GRExprEngine::ViewGraph(NodeTy** Beg, NodeTy** End) { +#ifndef NDEBUG + GraphPrintCheckerState = this; + GraphPrintSourceManager = &getContext().getSourceManager(); + GRExprEngine::GraphTy* TrimmedG = G.Trim(Beg, End); + + if (!TrimmedG) + llvm::cerr << "warning: Trimmed ExplodedGraph is empty.\n"; + else { + llvm::ViewGraph(*TrimmedG->roots_begin(), "TrimmedGRExprEngine"); + delete TrimmedG; + } GraphPrintCheckerState = NULL; GraphPrintSourceManager = NULL; diff --git a/include/clang/Analysis/PathSensitive/GRExprEngine.h b/include/clang/Analysis/PathSensitive/GRExprEngine.h index ad592b7477..1a4c814a5f 100644 --- a/include/clang/Analysis/PathSensitive/GRExprEngine.h +++ b/include/clang/Analysis/PathSensitive/GRExprEngine.h @@ -153,6 +153,8 @@ public: /// simulation. void ViewGraph(bool trim = false); + void ViewGraph(NodeTy** Beg, NodeTy** End); + /// getInitialState - Return the initial state used for the root vertex /// in the ExplodedGraph. ValueState* getInitialState(); |