]> granicus.if.org Git - clang/commitdiff
[analyzer] Mark heap-based symbolic regions in debug dumps.
authorArtem Dergachev <artem.dergachev@gmail.com>
Tue, 5 Dec 2017 17:14:39 +0000 (17:14 +0000)
committerArtem Dergachev <artem.dergachev@gmail.com>
Tue, 5 Dec 2017 17:14:39 +0000 (17:14 +0000)
They are now printed as HeapSymRegion{$x} in order to discriminate between that
and regular SymRegion{$x}, which are two different regions, having different
parent reginos (memory spaces) - HeapSpaceRegion and UnknownSpaceRegion
respectively.

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

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

lib/StaticAnalyzer/Core/MemRegion.cpp

index 640e63d137b4bc2afe7ba531d6728e78bf6f6773..cb8ba6de3626538d00e41855147ce1931014b9b0 100644 (file)
@@ -472,6 +472,8 @@ void ObjCStringRegion::dumpToStream(raw_ostream &os) const {
 }
 
 void SymbolicRegion::dumpToStream(raw_ostream &os) const {
+  if (isa<HeapSpaceRegion>(getSuperRegion()))
+    os << "Heap";
   os << "SymRegion{" << sym << '}';
 }