r288696 - [analyzer] Print type for SymbolRegionValues when dumping to stream

Dominic Chen via cfe-commits cfe-commits at lists.llvm.org
Mon Dec 5 12:30:11 PST 2016


Author: ddcc
Date: Mon Dec  5 14:30:11 2016
New Revision: 288696

URL: http://llvm.org/viewvc/llvm-project?rev=288696&view=rev
Log:
[analyzer] Print type for SymbolRegionValues when dumping to stream

Reviewers: NoQ, dcoughlin, zaks.anna

Subscribers: cfe-commits

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

Modified:
    cfe/trunk/lib/StaticAnalyzer/Core/SymbolManager.cpp
    cfe/trunk/test/Analysis/expr-inspection.c

Modified: cfe/trunk/lib/StaticAnalyzer/Core/SymbolManager.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/StaticAnalyzer/Core/SymbolManager.cpp?rev=288696&r1=288695&r2=288696&view=diff
==============================================================================
--- cfe/trunk/lib/StaticAnalyzer/Core/SymbolManager.cpp (original)
+++ cfe/trunk/lib/StaticAnalyzer/Core/SymbolManager.cpp Mon Dec  5 14:30:11 2016
@@ -85,7 +85,8 @@ void SymbolMetadata::dumpToStream(raw_os
 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 {

Modified: cfe/trunk/test/Analysis/expr-inspection.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Analysis/expr-inspection.c?rev=288696&r1=288695&r2=288696&view=diff
==============================================================================
--- cfe/trunk/test/Analysis/expr-inspection.c (original)
+++ cfe/trunk/test/Analysis/expr-inspection.c Mon Dec  5 14:30:11 2016
@@ -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)




More information about the cfe-commits mailing list