[llvm-branch-commits] [clang] [LifetimeSafety][NFC] Add field-labeled child edges to OriginNode and generalize subtree walks (PR #201510)

Gábor Horváth via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Fri Jun 12 02:11:27 PDT 2026


================
@@ -77,17 +77,25 @@ void GlobalEscapeFact::dump(llvm::raw_ostream &OS, const LoanManager &,
   OS << ", via Global)\n";
 }
 
+// Recursively prints every origin in the subtree rooted at `N`.
+static void dumpUsedOrigins(const OriginNode *N, const FieldDecl *FD,
+                            const OriginManager &OM, llvm::raw_ostream &OS,
+                            bool &First) {
+  if (!N)
+    return;
+  if (!First)
+    OS << ", ";
+  First = false;
+  OM.dump(N->getOriginID(), OS, FD);
+  for (const OriginNode::Edge &E : N->children())
----------------
Xazax-hun wrote:

Are we not using forEachOrigin here because we want the DFS order? If that is the case that might worth a comment. 

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


More information about the llvm-branch-commits mailing list