forked from OSchip/llvm-project
Expanded graph visualization interface to include specifying a range of
nodes to use a trim sources. llvm-svn: 48236
This commit is contained in:
parent
0b844f053f
commit
a7178c7429
|
@ -1814,28 +1814,39 @@ static void AddSources(llvm::SmallVector<GRExprEngine::NodeTy*, 10>& Sources,
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
void GRExprEngine::ViewGraph(bool trim) {
|
void GRExprEngine::ViewGraph(bool trim) {
|
||||||
#ifndef NDEBUG
|
#ifndef NDEBUG
|
||||||
GraphPrintCheckerState = this;
|
|
||||||
GraphPrintSourceManager = &getContext().getSourceManager();
|
|
||||||
|
|
||||||
if (trim) {
|
if (trim) {
|
||||||
llvm::SmallVector<NodeTy*, 10> Sources;
|
llvm::SmallVector<NodeTy*, 10> Sources;
|
||||||
AddSources(Sources, null_derefs_begin(), null_derefs_end());
|
AddSources(Sources, null_derefs_begin(), null_derefs_end());
|
||||||
AddSources(Sources, undef_derefs_begin(), undef_derefs_end());
|
AddSources(Sources, undef_derefs_begin(), undef_derefs_end());
|
||||||
|
|
||||||
GRExprEngine::GraphTy* TrimmedG = G.Trim(&Sources[0],
|
ViewGraph(&Sources[0], &Sources[0]+Sources.size());
|
||||||
&Sources[0]+Sources.size());
|
|
||||||
|
|
||||||
if (!TrimmedG)
|
|
||||||
llvm::cerr << "warning: Trimmed ExplodedGraph is empty.\n";
|
|
||||||
else {
|
|
||||||
llvm::ViewGraph(*TrimmedG->roots_begin(), "TrimmedGRExprEngine");
|
|
||||||
delete TrimmedG;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else
|
else {
|
||||||
|
GraphPrintCheckerState = this;
|
||||||
|
GraphPrintSourceManager = &getContext().getSourceManager();
|
||||||
|
|
||||||
llvm::ViewGraph(*G.roots_begin(), "GRExprEngine");
|
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;
|
GraphPrintCheckerState = NULL;
|
||||||
GraphPrintSourceManager = NULL;
|
GraphPrintSourceManager = NULL;
|
||||||
|
|
|
@ -153,6 +153,8 @@ public:
|
||||||
/// simulation.
|
/// simulation.
|
||||||
void ViewGraph(bool trim = false);
|
void ViewGraph(bool trim = false);
|
||||||
|
|
||||||
|
void ViewGraph(NodeTy** Beg, NodeTy** End);
|
||||||
|
|
||||||
/// getInitialState - Return the initial state used for the root vertex
|
/// getInitialState - Return the initial state used for the root vertex
|
||||||
/// in the ExplodedGraph.
|
/// in the ExplodedGraph.
|
||||||
ValueState* getInitialState();
|
ValueState* getInitialState();
|
||||||
|
|
Loading…
Reference in New Issue