[clang] [analyzer] Add time-trace scopes for high-level analyzer steps (PR #125508)

Gábor Horváth via cfe-commits cfe-commits at lists.llvm.org
Tue Feb 4 06:14:40 PST 2025


================
@@ -179,8 +181,40 @@ bool CoreEngine::ExecuteWorkList(const LocationContext *L, unsigned MaxSteps,
   return WList->hasWork();
 }
 
-void CoreEngine::dispatchWorkItem(ExplodedNode* Pred, ProgramPoint Loc,
-                                  const WorkListUnit& WU) {
+static std::string timeTraceScopeName(const ProgramPoint &Loc) {
+  if (llvm::timeTraceProfilerEnabled()) {
+    return llvm::formatv("Loc {0}",
+                         ProgramPoint::getProgramPointKindName(Loc.getKind()))
+        .str();
+  }
+  return "";
+}
+
+static llvm::TimeTraceMetadata timeTraceMetadata(const ExplodedNode *Pred,
+                                                 const ProgramPoint &Loc) {
+  // If time-trace profiler is not enabled, this function is never called.
+  assert(llvm::timeTraceProfilerEnabled());
+  std::string str;
----------------
Xazax-hun wrote:

Some lowercase names here as well. 

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


More information about the cfe-commits mailing list