================
@@ -524,13 +525,20 @@ class LifetimeChecker {
   /// Given a chain of origins that shows how a loan propagates, this function
   /// extracts the corresponding expressions for each origin. Origins that 
refer
   /// to declarations (rather than expressions) are skipped.
-  llvm::SmallVector<const Expr *>
-  getExprChain(llvm::ArrayRef<OriginID> OriginFlowChain) {
-    llvm::SmallVector<const Expr *> rs;
-    for (const OriginID CurrOID : OriginFlowChain)
-      if (const Expr *CurrExpr =
-              FactMgr.getOriginMgr().getOrigin(CurrOID).getExpr())
-        rs.push_back(CurrExpr);
+  llvm::SmallVector<LifetimeSafetyAliasChainEntry>
+  getAliasChain(llvm::ArrayRef<const OriginFlowFact *> OriginFlowChain) {
+    llvm::SmallVector<LifetimeSafetyAliasChainEntry> rs;
+    for (const OriginFlowFact *Flow : OriginFlowChain) {
+      const Expr *CurrExpr =
+          FactMgr.getOriginMgr().getOrigin(Flow->getSrcOriginID()).getExpr();
+      if (!CurrExpr)
+        continue;
+
+      LifetimeSafetyAliasChainEntry Entry;
+      Entry.E = CurrExpr;
+      Entry.LifetimeBound = FactMgr.getLifetimeBoundInfo(Flow);
+      rs.push_back(Entry);
----------------
NeKon69 wrote:

You can inline this:

```suggestion
      rs.push_back({CurrExpr, FactMgr.getLifetimeBoundInfo(Flow));
```

https://github.com/llvm/llvm-project/pull/206337
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to