This revision was automatically updated to reflect the committed changes.
Closed by commit rL363894: [analyzer] Fix JSON dumps for dynamic type 
information. (authored by dergachev, committed by ).
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

Changed prior to commit:
  https://reviews.llvm.org/D62716?vs=202360&id=205702#toc

Repository:
  rL LLVM

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D62716/new/

https://reviews.llvm.org/D62716

Files:
  cfe/trunk/lib/StaticAnalyzer/Core/DynamicTypeMap.cpp
  cfe/trunk/test/Analysis/dump_egraph.cpp


Index: cfe/trunk/lib/StaticAnalyzer/Core/DynamicTypeMap.cpp
===================================================================
--- cfe/trunk/lib/StaticAnalyzer/Core/DynamicTypeMap.cpp
+++ cfe/trunk/lib/StaticAnalyzer/Core/DynamicTypeMap.cpp
@@ -72,12 +72,12 @@
     Out << "{ \"region\": \"" << MR << "\", \"dyn_type\": ";
     if (DTI.isValid()) {
       Out << '\"' << DTI.getType()->getPointeeType().getAsString()
-          << "\" \"sub_classable\": "
+          << "\", \"sub_classable\": "
           << (DTI.canBeASubClass() ? "true" : "false");
     } else {
       Out << "null"; // Invalid type info
     }
-    Out << "\" }";
+    Out << "}";
 
     if (std::next(I) != DTM.end())
       Out << ',';
Index: cfe/trunk/test/Analysis/dump_egraph.cpp
===================================================================
--- cfe/trunk/test/Analysis/dump_egraph.cpp
+++ cfe/trunk/test/Analysis/dump_egraph.cpp
@@ -14,11 +14,14 @@
 void foo() {
   // Test that dumping symbols conjured on null statements doesn't crash.
   T t;
+
+  new S;
 }
 
 // CHECK: \"location_context\": \"#0 Call\", \"calling\": \"foo\", 
\"call_line\": null, \"items\": 
[\l&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\{ \"lctx_id\": 1, 
\"stmt_id\": {{[0-9]+}}, \"kind\": \"construct into local variable\", 
\"argument_index\": null, \"pretty\": \"T t;\", \"value\": \"&t\"
 
 // CHECK: \"location_context\": \"#0 Call\", \"calling\": \"T::T\", 
\"call_line\": \"16\", \"items\": 
[\l&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\{ \"lctx_id\": 2, 
\"init_id\": {{[0-9]+}}, \"kind\": \"construct into member variable\", 
\"argument_index\": null, \"pretty\": \"s\", \"value\": \"&t-\>s\"
 
-// CHECK: \"cluster\": \"t\", \"items\": 
[\l&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\{ \"kind\": \"Default\", 
\"offset\": 0, \"value\": \"conj_$3\{int, LC3, no stmt, #1\}\"
+// CHECK: \"cluster\": \"t\", \"items\": 
[\l&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\{ \"kind\": \"Default\", 
\"offset\": 0, \"value\": \"conj_$2\{int, LC5, no stmt, #1\}\"
 
+// CHECK: \"dynamic_types\": [\l\{ \"region\": 
\"HeapSymRegion\{conj_$1\{struct S *, LC1, S{{[0-9]+}}, #1\}\}\", \"dyn_type\": 
\"struct S\", \"sub_classable\": false\}\l


Index: cfe/trunk/lib/StaticAnalyzer/Core/DynamicTypeMap.cpp
===================================================================
--- cfe/trunk/lib/StaticAnalyzer/Core/DynamicTypeMap.cpp
+++ cfe/trunk/lib/StaticAnalyzer/Core/DynamicTypeMap.cpp
@@ -72,12 +72,12 @@
     Out << "{ \"region\": \"" << MR << "\", \"dyn_type\": ";
     if (DTI.isValid()) {
       Out << '\"' << DTI.getType()->getPointeeType().getAsString()
-          << "\" \"sub_classable\": "
+          << "\", \"sub_classable\": "
           << (DTI.canBeASubClass() ? "true" : "false");
     } else {
       Out << "null"; // Invalid type info
     }
-    Out << "\" }";
+    Out << "}";
 
     if (std::next(I) != DTM.end())
       Out << ',';
Index: cfe/trunk/test/Analysis/dump_egraph.cpp
===================================================================
--- cfe/trunk/test/Analysis/dump_egraph.cpp
+++ cfe/trunk/test/Analysis/dump_egraph.cpp
@@ -14,11 +14,14 @@
 void foo() {
   // Test that dumping symbols conjured on null statements doesn't crash.
   T t;
+
+  new S;
 }
 
 // CHECK: \"location_context\": \"#0 Call\", \"calling\": \"foo\", \"call_line\": null, \"items\": [\l&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\{ \"lctx_id\": 1, \"stmt_id\": {{[0-9]+}}, \"kind\": \"construct into local variable\", \"argument_index\": null, \"pretty\": \"T t;\", \"value\": \"&t\"
 
 // CHECK: \"location_context\": \"#0 Call\", \"calling\": \"T::T\", \"call_line\": \"16\", \"items\": [\l&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\{ \"lctx_id\": 2, \"init_id\": {{[0-9]+}}, \"kind\": \"construct into member variable\", \"argument_index\": null, \"pretty\": \"s\", \"value\": \"&t-\>s\"
 
-// CHECK: \"cluster\": \"t\", \"items\": [\l&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\{ \"kind\": \"Default\", \"offset\": 0, \"value\": \"conj_$3\{int, LC3, no stmt, #1\}\"
+// CHECK: \"cluster\": \"t\", \"items\": [\l&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\{ \"kind\": \"Default\", \"offset\": 0, \"value\": \"conj_$2\{int, LC5, no stmt, #1\}\"
 
+// CHECK: \"dynamic_types\": [\l\{ \"region\": \"HeapSymRegion\{conj_$1\{struct S *, LC1, S{{[0-9]+}}, #1\}\}\", \"dyn_type\": \"struct S\", \"sub_classable\": false\}\l
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to