[clang] [clang][dataflow] Fix handling of cyclical data structures in HTMLLogger. (PR #66887)

Sam McCall via cfe-commits cfe-commits at lists.llvm.org
Thu Sep 21 05:28:54 PDT 2023


================
@@ -123,13 +125,16 @@ class ModelDumper {
   }
   void dump(const StorageLocation &L) {
     JOS.attribute("location", llvm::to_string(&L));
-    if (!Visited.insert(&L).second)
-      return;
-
     JOS.attribute("type", L.getType().getAsString());
     if (auto *V = Env.getValue(L))
       dump(*V);
 
+    if (!Visited.insert(&L).second) {
+      JOS.attribute("[in_cycle]", " ");
----------------
sam-mccall wrote:

"[in_cycle]" => " " isn't a clear KV representation for this data!

what about "details" => "pruned, previously dumped", or so?

https://github.com/llvm/llvm-project/pull/66887


More information about the cfe-commits mailing list