================
@@ -64,29 +93,42 @@ 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()) {
+ OriginList *VDList = getOriginsList(*VD);
+ if (!VDList)
+ continue;
+ OriginList *InitList = getOriginsList(*InitExpr);
+ assert(InitList && "VarDecl had origins but InitExpr did not");
+ flow(VDList, InitList, /*Kill=*/true);
+ }
}
void FactsGenerator::VisitDeclRefExpr(const DeclRefExpr *DRE) {
+ // Skip function references as they are lifetimes are not interesting. Skip
----------------
ymand wrote:
```suggestion
// Skip function references as their lifetimes are not interesting. Skip
```
https://github.com/llvm/llvm-project/pull/168344
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits