[clang-tools-extra] [clang-doc] add ftime profiling (PR #97644)

Paul Kirth via cfe-commits cfe-commits at lists.llvm.org
Fri Jul 12 07:52:36 PDT 2024


================
@@ -13,12 +13,17 @@
 #include "clang/Index/USRGeneration.h"
 #include "llvm/ADT/StringExtras.h"
 #include "llvm/Support/Error.h"
+#include "llvm/Support/TimeProfiler.h"
 
 namespace clang {
 namespace doc {
 
 void MapASTVisitor::HandleTranslationUnit(ASTContext &Context) {
+  if (CDCtx.FTimeTrace)
+    llvm::timeTraceProfilerInitialize(CDCtx.Granularity, "clang-doc");
----------------
ilovepi wrote:

There’s lots of ways to initialize/teardown things so I’m fine with it the way it is, but I wanted to know if there was a reason it wasn’t in those other places. 

I’d take another look at how this gets used in other tools, and follow whatever seems to be common. 

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


More information about the cfe-commits mailing list