aboutsummaryrefslogtreecommitdiff
path: root/contrib/llvm-project/clang/lib/Parse/ParseAST.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/llvm-project/clang/lib/Parse/ParseAST.cpp')
-rw-r--r--contrib/llvm-project/clang/lib/Parse/ParseAST.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/contrib/llvm-project/clang/lib/Parse/ParseAST.cpp b/contrib/llvm-project/clang/lib/Parse/ParseAST.cpp
index 77ab3b556da5..e008cc0e38ce 100644
--- a/contrib/llvm-project/clang/lib/Parse/ParseAST.cpp
+++ b/contrib/llvm-project/clang/lib/Parse/ParseAST.cpp
@@ -152,7 +152,15 @@ void clang::ParseAST(Sema &S, bool PrintStats, bool SkipFunctionBodies) {
bool HaveLexer = S.getPreprocessor().getCurrentLexer();
if (HaveLexer) {
- llvm::TimeTraceScope TimeScope("Frontend");
+ llvm::TimeTraceScope TimeScope("Frontend", [&]() {
+ llvm::TimeTraceMetadata M;
+ if (llvm::isTimeTraceVerbose()) {
+ const SourceManager &SM = S.getSourceManager();
+ if (const auto *FE = SM.getFileEntryForID(SM.getMainFileID()))
+ M.File = FE->tryGetRealPathName();
+ }
+ return M;
+ });
P.Initialize();
Parser::DeclGroupPtrTy ADecl;
Sema::ModuleImportState ImportState;