[clang] [NFC][analyzer] Clarify that ExplodedGraph has only one root (PR #139903)
DonĂ¡t Nagy via cfe-commits
cfe-commits at lists.llvm.org
Wed May 14 09:44:40 PDT 2025
================
@@ -46,8 +46,9 @@ void AnalyzerStatsChecker::checkEndAnalysis(ExplodedGraph &G,
llvm::SmallPtrSet<const CFGBlock*, 32> reachable;
// Root node should have the location context of the top most function.
- const ExplodedNode *GraphRoot = *G.roots_begin();
- const LocationContext *LC = GraphRoot->getLocation().getLocationContext();
+ // FIXME: Use `Eng.getRootLocationContext()` unless `G` can be different from
+ // the `ExplodedGraph` owned by Eng.
+ const LocationContext *LC = G.getRoot()->getLocation().getLocationContext();
----------------
NagyDonat wrote:
Yes, I verified that the graph is owned by `Eng` and replaced this complex call with `Eng.GetRootLocationContext()`. (By the way, why does this callback receive the exploded graph as a separate argument if it is already accessible via `Eng.getGraph()`?? Yet another thing to clean up...)
https://github.com/llvm/llvm-project/pull/139903
More information about the cfe-commits
mailing list