================
@@ -396,14 +393,16 @@ void OriginManager::collectMissingOrigins(Stmt
&FunctionBody,
Collector.TraverseStmt(const_cast<Stmt *>(&FunctionBody));
}
-void OriginManager::collectLifetimeAnnotatedOriginTypes(
- const AnalysisDeclContext &AC) {
+void OriginManager::collectLifetimeAnnotatedOriginTypes(const CFG &Cfg) {
+ // The CFG has every evaluated statement as an element, including the
+ // constructor initializers and the default member initializers they use (see
+ // setLifetimeSafetyCFGBuildOptions), so these are the calls the facts are
+ // generated for.
LifetimeAnnotatedOriginTypeCollector Collector;
- if (Stmt *Body = AC.getBody())
- Collector.TraverseStmt(Body);
- if (const auto *CD = dyn_cast<CXXConstructorDecl>(AC.getDecl()))
- for (const auto *Init : CD->inits())
- Collector.TraverseStmt(Init->getInit());
+ for (const CFGBlock *Block : Cfg)
----------------
NeKon69 wrote:
Any reason not to use `PostOrderCFGView` like we do when generating facts? That
could also improve performance a bit since we will avoid collecting types for
dead branches etc.
https://github.com/llvm/llvm-project/pull/246623
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits