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

Ilya Biryukov via cfe-commits cfe-commits at lists.llvm.org
Thu Aug 29 09:46:30 PDT 2024


================
@@ -194,13 +236,15 @@ struct llvm::TimeTraceProfiler {
         J.attribute("pid", Pid);
         J.attribute("tid", int64_t(Tid));
         J.attribute("ts", StartUs);
-        if (E.AsyncEvent) {
+        if (TimeTraceEventType::AsyncEvent == E.EventType) {
           J.attribute("cat", E.Name);
           J.attribute("ph", "b");
           J.attribute("id", 0);
-        } else {
+        } else if (E.EventType == TimeTraceEventType::CompleteEvent) {
           J.attribute("ph", "X");
           J.attribute("dur", DurUs);
+        } else { // instant event
+          J.attribute("ph", "i");
----------------
ilya-biryukov wrote:

Suggestion: add `assert` checking this invariant.

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


More information about the cfe-commits mailing list