[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


================
@@ -88,10 +88,12 @@ class ModelDumper {
 
   void dump(Value &V) {
     JOS.attribute("value_id", llvm::to_string(&V));
-    if (!Visited.insert(&V).second)
-      return;
-
     JOS.attribute("kind", debugString(V.getKind()));
+    if (!Visited.insert(&V).second) {
----------------
sam-mccall wrote:

the reordering here looks good, including `kind` is safe & useful

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


More information about the cfe-commits mailing list