]> granicus.if.org Git - clang/commitdiff
[analyzer] Print type for SymbolRegionValues when dumping to stream
authorDominic Chen <d.c.ddcc@gmail.com>
Mon, 5 Dec 2016 20:30:11 +0000 (20:30 +0000)
committerDominic Chen <d.c.ddcc@gmail.com>
Mon, 5 Dec 2016 20:30:11 +0000 (20:30 +0000)
Reviewers: NoQ, dcoughlin, zaks.anna

Subscribers: cfe-commits

Differential Revision: https://reviews.llvm.org/D27365

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@288696 91177308-0d34-0410-b5e6-96231b3b80d8

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

index 6b99ca510be72a12b7d6abda21b23f442011b876..4be85661b645f12bc44e2eba82b9a149cc121621 100644 (file)
@@ -85,7 +85,8 @@ void SymbolMetadata::dumpToStream(raw_ostream &os) const {
 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 {
index 14e12eca190fcd5221b726eda5f890d2fc416854..69e18cb1e686a2bab423287e1f3128c8dcedbd82 100644 (file)
@@ -7,7 +7,7 @@ void clang_analyzer_printState();
 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)