[clang] [LifetimeSafety] Implement multi-level origins (PR #168344)

Gábor Horváth via cfe-commits cfe-commits at lists.llvm.org
Mon Dec 15 04:09:54 PST 2025


================
@@ -358,13 +513,13 @@ llvm::SmallVector<Fact *> FactsGenerator::issuePlaceholderLoans() {
 
   llvm::SmallVector<Fact *> PlaceholderLoanFacts;
   for (const ParmVarDecl *PVD : FD->parameters()) {
-    if (hasOrigin(PVD)) {
-      const PlaceholderLoan *L =
-          FactMgr.getLoanMgr().createLoan<PlaceholderLoan>(PVD);
-      OriginID OID = FactMgr.getOriginMgr().getOrCreate(*PVD);
-      PlaceholderLoanFacts.push_back(
-          FactMgr.createFact<IssueFact>(L->getID(), OID));
-    }
+    OriginList *List = getOriginsList(*PVD);
+    if (!List)
+      continue;
+    const PlaceholderLoan *L =
+        FactMgr.getLoanMgr().createLoan<PlaceholderLoan>(PVD);
+    PlaceholderLoanFacts.push_back(
----------------
Xazax-hun wrote:

What is the main reason to not create placeholder loans for the nested origins?

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


More information about the cfe-commits mailing list