[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


================
@@ -114,27 +134,42 @@ struct llvm::TimeTraceProfiler {
     llvm::get_thread_name(ThreadName);
   }
 
-  TimeTraceProfilerEntry *begin(std::string Name,
-                                llvm::function_ref<std::string()> Detail,
-                                bool AsyncEvent = false) {
-    Stack.emplace_back(std::make_unique<TimeTraceProfilerEntry>(
+  TimeTraceProfilerEntry *
+  begin(std::string Name, llvm::function_ref<std::string()> Detail,
+        TimeTraceEventType EventType = TimeTraceEventType::CompleteEvent) {
+    assert(EventType != TimeTraceEventType::InstantEvent &&
+           "Instant Events don't have begin and end, they can only be "
+           "instantiated once");
----------------
usx95 wrote:

Lets just mention "Instant event can't have begin and end". (Also template instantiation is not something relevant to LLVM (lib/support) and is only one way of being used by Clang).

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


More information about the cfe-commits mailing list