================
@@ -1346,14 +1344,30 @@ static void runThinLTOBackend(
}
}
-void clang::EmitBackendOutput(
- DiagnosticsEngine &Diags, const HeaderSearchOptions &HeaderOpts,
- const CodeGenOptions &CGOpts, const clang::TargetOptions &TOpts,
- const LangOptions &LOpts, StringRef TDesc, llvm::Module *M,
- BackendAction Action, IntrusiveRefCntPtr<llvm::vfs::FileSystem> VFS,
- std::unique_ptr<raw_pwrite_stream> OS, BackendConsumer *BC) {
-
+void clang::emitBackendOutput(CompilerInstance &CI, StringRef TDesc,
+ llvm::Module *M, BackendAction Action,
+ IntrusiveRefCntPtr<llvm::vfs::FileSystem> VFS,
+ std::unique_ptr<raw_pwrite_stream> OS,
+ BackendConsumer *BC) {
llvm::TimeTraceScope TimeScope("Backend");
+ DiagnosticsEngine &Diags = CI.getDiagnostics();
+ const auto &HeaderOpts = CI.getHeaderSearchOpts();
+ const auto &CGOpts = CI.getCodeGenOpts();
+ const auto &TOpts = CI.getTargetOpts();
+ const auto &LOpts = CI.getLangOpts();
+
+ Timer timer;
+ if (CGOpts.TimePasses) {
+ CI.getFrontendTimer().stopTimer();
----------------
MaskRay wrote:
"Clang front-end" has a `TimeRegion` in
`clang/lib/Frontend/FrontendAction.cpp`.
This PR repurposes the "Clang front-end timer" (which included backend time) to
remove the backend part. If we don't stop "Clang front-end", "Clang front-end"
and "Backend" in the same group would double count the time...
I recalled another complaint
https://aras-p.info/blog/2019/01/12/Investigating-compile-times-and-Clang-ftime-report/
> “Clang front-end time report” seems to be time for “everything”, not just the
> frontend (Clang frontend, LLVM backend, and whatever else it did).
https://github.com/llvm/llvm-project/pull/122225
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits