[clang-tools-extra] [clang-doc] add ftime profiling (PR #97644)
Paul Kirth via cfe-commits
cfe-commits at lists.llvm.org
Tue Jul 9 18:07:07 PDT 2024
================
@@ -362,6 +395,17 @@ Example usage for a project using a compile commands database:
if (Err) {
llvm::outs() << "warning: " << toString(std::move(Err)) << "\n";
}
-
+ llvm::timeTraceProfilerEnd();
+
+ if (FTimeTrace) {
+ std::error_code EC;
+ llvm::raw_fd_ostream OS("clang-doc-tracing.json", EC,
+ llvm::sys::fs::OF_Text);
+ if (!EC) {
+ llvm::timeTraceProfilerWrite(OS);
+ } else {
+ llvm::errs() << "Error opening file: " << EC.message() << "\n";
----------------
ilovepi wrote:
shouldn't we be returning an error value from main here?
https://github.com/llvm/llvm-project/pull/97644
More information about the cfe-commits
mailing list