@@ -1232,10 +1232,10 @@ Parser::DeclGroupPtrTy Parser::ParseDeclarationOrFunctionDefinition(
1232
1232
ParsingDeclSpec *DS, AccessSpecifier AS) {
1233
1233
// Add an enclosing time trace scope for a bunch of small scopes with
1234
1234
// "EvaluateAsConstExpr".
1235
- llvm::TimeTraceScope TimeScope (
1236
- " ParseDeclarationOrFunctionDefinition " ,
1237
- Tok. getLocation ().printToString (
1238
- Actions. getASTContext (). getSourceManager ()) );
1235
+ llvm::TimeTraceScope TimeScope (" ParseDeclarationOrFunctionDefinition " , [&]() {
1236
+ return Tok. getLocation (). printToString (
1237
+ Actions. getASTContext ().getSourceManager ());
1238
+ } );
1239
1239
1240
1240
if (DS) {
1241
1241
return ParseDeclOrFunctionDefInternal (Attrs, DeclSpecAttrs, *DS, AS);
@@ -1267,9 +1267,9 @@ Parser::DeclGroupPtrTy Parser::ParseDeclarationOrFunctionDefinition(
1267
1267
Decl *Parser::ParseFunctionDefinition (ParsingDeclarator &D,
1268
1268
const ParsedTemplateInfo &TemplateInfo,
1269
1269
LateParsedAttrList *LateParsedAttrs) {
1270
- llvm::TimeTraceScope TimeScope (
1271
- " ParseFunctionDefinition " ,
1272
- Actions. GetNameForDeclarator (D). getName (). getAsString () );
1270
+ llvm::TimeTraceScope TimeScope (" ParseFunctionDefinition " , [&]() {
1271
+ return Actions. GetNameForDeclarator (D). getName (). getAsString ();
1272
+ } );
1273
1273
1274
1274
// Poison SEH identifiers so they are flagged as illegal in function bodies.
1275
1275
PoisonSEHIdentifiersRAIIObject PoisonSEHIdentifiers (*this , true );
0 commit comments