Expanded ValueState pretty-printing to use an optional "CheckerStatePrinter"
object to pretty-print the component of a state that is specific to a checker.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48237 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/Analysis/ValueState.cpp b/Analysis/ValueState.cpp
index 1d428f1..1fc4df9 100644
--- a/Analysis/ValueState.cpp
+++ b/Analysis/ValueState.cpp
@@ -476,13 +476,16 @@
return I;
}
-void ValueState::printDOT(std::ostream& Out) const {
- print(Out, "\\l", "\\|");
+void ValueState::printDOT(std::ostream& Out, CheckerStatePrinter* P) const {
+ print(Out, P, "\\l", "\\|");
}
-void ValueState::print(std::ostream& Out,
- const char* nl,
- const char* sep) const {
+void ValueState::printStdErr(CheckerStatePrinter* P) const {
+ print(*llvm::cerr, P);
+}
+
+void ValueState::print(std::ostream& Out, CheckerStatePrinter* P,
+ const char* nl, const char* sep) const {
// Print Variable Bindings
Out << "Variables:" << nl;
@@ -570,4 +573,9 @@
}
}
}
+
+ // Print checker-specific data.
+
+ if (P && CheckerState)
+ P->PrintCheckerState(Out, CheckerState, nl, sep);
}