[clang] [LifetimeSafety] Implement multi-level origins (PR #168344)
Utkarsh Saxena via cfe-commits
cfe-commits at lists.llvm.org
Tue Dec 2 09:39:23 PST 2025
================
@@ -64,29 +93,48 @@ void FactsGenerator::run() {
void FactsGenerator::VisitDeclStmt(const DeclStmt *DS) {
for (const Decl *D : DS->decls())
if (const auto *VD = dyn_cast<VarDecl>(D))
- if (hasOrigin(VD))
- if (const Expr *InitExpr = VD->getInit())
- killAndFlowOrigin(*VD, *InitExpr);
+ if (const Expr *InitExpr = VD->getInit()) {
+ OriginTree *VDTree = getTree(*VD);
+ if (!VDTree)
+ continue;
+ OriginTree *InitTree = getTree(*InitExpr);
+ assert(InitTree && "VarDecl had origins but InitExpr did not");
+ // Special handling for rvalue references initialized with xvalues.
----------------
usx95 wrote:
I think you are right. Removed this. I remember the `flow` was crashing earlier (while building LLVM) but it does not anymore.
https://github.com/llvm/llvm-project/pull/168344
More information about the cfe-commits
mailing list