[clang] Add time trace scopes to addToCallGraph & getCFG (PR #174717)

Utkarsh Saxena via cfe-commits cfe-commits at lists.llvm.org
Thu Jan 8 09:21:43 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 would not worry too much of the overhead here as this is a smallish string (`AddToCallGraph`). I have seen larger string to work fine (like fully qualified templated names:smile: )  
Wrt to a having a common larger parent, callers can choose to do this explicitly or we can introduce `ArrayRef` API as well later if needed.

https://github.com/llvm/llvm-project/pull/174717


More information about the cfe-commits mailing list