From daf41722bd54e03cc5a367d35b2208ff652f553d Mon Sep 17 00:00:00 2001 From: Artem Dergachev Date: Tue, 13 Aug 2019 23:04:56 +0000 Subject: [PATCH] [analyzer] exploded-graph-rewriter: Implement displaying Store pointers. They're useful when trying to understand what's going on inside your LazyCompoundValues. Differential Revision: https://reviews.llvm.org/D65427 llvm-svn: 368769 --- clang/test/Analysis/exploded-graph-rewriter/escapes.c | 2 +- clang/test/Analysis/exploded-graph-rewriter/store.dot | 1 + clang/utils/analyzer/exploded-graph-rewriter.py | 4 ++++ 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/clang/test/Analysis/exploded-graph-rewriter/escapes.c b/clang/test/Analysis/exploded-graph-rewriter/escapes.c index 84de679..ea8c899 100644 --- a/clang/test/Analysis/exploded-graph-rewriter/escapes.c +++ b/clang/test/Analysis/exploded-graph-rewriter/escapes.c @@ -9,7 +9,7 @@ // UNSUPPORTED: system-windows void escapes() { - // CHECK: Store: + // CHECK: Store: (0x{{[0-9a-f]*}}) // CHECK-SAME: foo0 // CHECK-SAME: &Element\{"foo",0 S64b,char\} // CHECK: Environment: diff --git a/clang/test/Analysis/exploded-graph-rewriter/store.dot b/clang/test/Analysis/exploded-graph-rewriter/store.dot index d47a022..7267dd4 100644 --- a/clang/test/Analysis/exploded-graph-rewriter/store.dot +++ b/clang/test/Analysis/exploded-graph-rewriter/store.dot @@ -4,6 +4,7 @@ // UNSUPPORTED: system-windows // CHECK: Store: +// CHECK-SAME: (0x2) // CHECK-SAME: // CHECK-SAME: // CHECK-SAME:
diff --git a/clang/utils/analyzer/exploded-graph-rewriter.py b/clang/utils/analyzer/exploded-graph-rewriter.py index d612cfc..ced5c36 100755 --- a/clang/utils/analyzer/exploded-graph-rewriter.py +++ b/clang/utils/analyzer/exploded-graph-rewriter.py @@ -644,6 +644,10 @@ class DotDumpVisitor(object): if st is None: self._dump(' Nothing!') else: + if self._dark_mode: + self._dump(' (%s)' % st.ptr) + else: + self._dump(' (%s)' % st.ptr) if prev_st is not None: if s.store.is_different(prev_st): self._dump('
') -- 2.7.4