[clang] [llvm] Add source file name for template instantiations in -ftime-trace (PR #98320)
Ilya Biryukov via cfe-commits
cfe-commits at lists.llvm.org
Thu Jul 18 01:09:34 PDT 2024
================
@@ -3426,11 +3426,16 @@ Sema::InstantiateClass(SourceLocation PointOfInstantiation,
return true;
llvm::TimeTraceScope TimeScope("InstantiateClass", [&]() {
- std::string Name;
- llvm::raw_string_ostream OS(Name);
+ llvm::TimeTraceMetadata M;
+ llvm::raw_string_ostream OS(M.Detail);
Instantiation->getNameForDiagnostic(OS, getPrintingPolicy(),
/*Qualified=*/true);
- return Name;
+ if (llvm::isTimeTraceVerbose()) {
----------------
ilya-biryukov wrote:
NIT: you might want to extract this into a function to share code.
Something like `RecordLocationInMetadata`.
It's not a big deal, though, with just few uses.
https://github.com/llvm/llvm-project/pull/98320
More information about the cfe-commits
mailing list