================
@@ -1255,8 +1256,12 @@ Parser::DeclGroupPtrTy 
Parser::ParseDeclarationOrFunctionDefinition(
   // Add an enclosing time trace scope for a bunch of small scopes with
   // "EvaluateAsConstExpr".
   llvm::TimeTraceScope TimeScope("ParseDeclarationOrFunctionDefinition", [&]() 
{
-    return Tok.getLocation().printToString(
-        Actions.getASTContext().getSourceManager());
+    llvm::TimeTraceMetadata M;
+    const SourceManager &SM = Actions.getASTContext().getSourceManager();
+    auto Loc = SM.getExpansionLoc(Tok.getLocation());
----------------
ilya-biryukov wrote:

Could we extract the function that fills `SourceLocation` into 
`TimeTraceMetadata`?
This can be done in a follow up, but we are starting to have too many places 
now that do the same thing and should all be changed together (e.g. if we'd 
want to spell filename in some other way or if we'd want to use something other 
than expansionLocation in the future, or we'd want to add a column, etc)

https://github.com/llvm/llvm-project/pull/106277
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to