[clang] Add time trace scopes to addToCallGraph & getCFG (PR #174717)
Utkarsh Saxena via cfe-commits
cfe-commits at lists.llvm.org
Wed Jan 7 02:48:45 PST 2026
================
@@ -61,6 +62,7 @@ class CallGraph : public DynamicRecursiveASTVisitor {
///
/// Recursively walks the declaration to find all the dependent Decls as well.
void addToCallGraph(Decl *D) {
+ llvm::TimeTraceScope TimeProfile("AddToCallGraph");
----------------
usx95 wrote:
I agree that there could be better API to add multiple decl but I feel that is separate from what this change proposes to do and does not make this wrong. The caller will have multiple "AddToCallGraph" children in the time profile and the profiles would still be correct (if that is your concern).
This seems to be a common pattern for `-ftime-trace` in which callers can add more scopes on need basis for improved aggregation.
https://github.com/llvm/llvm-project/pull/174717
More information about the cfe-commits
mailing list