[clang] [Lifetime Safety] Highlight lifetimebound calls in alias chain diagnostics (PR #206337)
via cfe-commits
cfe-commits at lists.llvm.org
Mon Jul 6 01:44:12 PDT 2026
================
@@ -1146,9 +1162,11 @@ void FactsGenerator::handleFunctionCall(const Expr *Call,
// destination origin lists may have different lengths.
// FIXME: Handle origin-shape mismatches gracefully so we can also flow
// inner origins.
- CurrentBlockFacts.push_back(FactMgr.createFact<OriginFlowFact>(
- CallList->getOuterOriginID(), ArgList->getOuterOriginID(),
- KillSrc));
+ auto *F = FactMgr.createFact<OriginFlowFact>(
+ CallList->getOuterOriginID(), ArgList->getOuterOriginID(), KillSrc);
+ if (std::optional<LifetimeBoundInfo> Info = GetLifetimeBoundInfo(I))
+ FactMgr.setLifetimeBoundInfo(F, *Info);
----------------
NeKon69 wrote:
I think that instead of this we can have a local variable with `LifetimeBoundInfo` for each param in the loop (or inside some condition), so we can avoid this check here. (because right now this check happens 2 times, inside `IsArgLifetimeBound` and here)
https://github.com/llvm/llvm-project/pull/206337
More information about the cfe-commits
mailing list