[PATCH] D27365: [analyzer] Print type for SymbolRegionValues when dumping to stream

Dominic Chen via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Dec 2 14:41:00 PST 2016


ddcc created this revision.
ddcc added reviewers: NoQ, dcoughlin, zaks.anna.
ddcc added a subscriber: cfe-commits.

https://reviews.llvm.org/D27365

Files:
  lib/StaticAnalyzer/Core/SymbolManager.cpp
  test/Analysis/expr-inspection.c


Index: test/Analysis/expr-inspection.c
===================================================================
--- test/Analysis/expr-inspection.c
+++ test/Analysis/expr-inspection.c
@@ -7,7 +7,7 @@
 void clang_analyzer_numTimesReached();
 
 void foo(int x) {
-  clang_analyzer_dump(x); // expected-warning{{reg_$0<x>}}
+  clang_analyzer_dump(x); // expected-warning{{reg_$0<int x>}}
   int y = 1;
   clang_analyzer_printState();
   for (; y < 3; ++y)
Index: lib/StaticAnalyzer/Core/SymbolManager.cpp
===================================================================
--- lib/StaticAnalyzer/Core/SymbolManager.cpp
+++ lib/StaticAnalyzer/Core/SymbolManager.cpp
@@ -85,7 +85,8 @@
 void SymbolData::anchor() { }
 
 void SymbolRegionValue::dumpToStream(raw_ostream &os) const {
-  os << "reg_$" << getSymbolID() << "<" << R << ">";
+  os << "reg_$" << getSymbolID()
+     << "<" << getType().getAsString() << " " << R << ">";
 }
 
 bool SymExpr::symbol_iterator::operator==(const symbol_iterator &X) const {


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D27365.80135.patch
Type: text/x-patch
Size: 1001 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20161202/d4ed2c8e/attachment.bin>


More information about the cfe-commits mailing list