[clang] Adding use-after-return in Lifetime Analysis (PR #165370)

Utkarsh Saxena via cfe-commits cfe-commits at lists.llvm.org
Thu Oct 30 12:28:26 PDT 2025


================
@@ -166,7 +169,8 @@ void FactsGenerator::VisitReturnStmt(const ReturnStmt *RS) {
   if (const Expr *RetExpr = RS->getRetValue()) {
     if (hasOrigin(RetExpr)) {
       OriginID OID = FactMgr.getOriginMgr().getOrCreate(*RetExpr);
-      CurrentBlockFacts.push_back(FactMgr.createFact<ReturnOfOriginFact>(OID));
----------------
usx95 wrote:

Just to make sure this is intentional:
I do not think we have a need of `ReturnOfOriginFact` after this change so deleting this fact makes sense to me. If we go this way, we need to delete `ReturnOfOriginFact` definition altogether as well.

WDYT @Xazax-hun, I remember you had some thoughts about still keeping it around. 

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


More information about the cfe-commits mailing list