[clang] [llvm] Added instant events and marking defered templated instantiation. (PR #103039)

Utkarsh Saxena via cfe-commits cfe-commits at lists.llvm.org
Mon Sep 30 15:13:58 PDT 2024


================
@@ -145,27 +180,32 @@ struct llvm::TimeTraceProfiler {
     DurationType Duration = E.End - E.Start;
 
     // Only include sections longer or equal to TimeTraceGranularity msec.
-    if (duration_cast<microseconds>(Duration).count() >= TimeTraceGranularity)
+    if (duration_cast<microseconds>(Duration).count() >= TimeTraceGranularity) {
       Entries.emplace_back(E);
+      if (&Stack.back()->Event == &E) {
----------------
usx95 wrote:

I think instead of this check, we should instead find the entry in stack which corresponds to this entry (similar to how the entry is deleted from the stack).

I think this is primarily because ending an async event can end a non-top element of the stack.

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


More information about the cfe-commits mailing list