Skip to content

Commit f66e7d2

Browse files
committed
Use the TimeTraceScope constructor accepting a function reference instead of the one accepting a string to avoid the compile-time regression.
1 parent 5b75038 commit f66e7d2

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

clang/lib/Parse/Parser.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1232,10 +1232,10 @@ Parser::DeclGroupPtrTy Parser::ParseDeclarationOrFunctionDefinition(
12321232
ParsingDeclSpec *DS, AccessSpecifier AS) {
12331233
// Add an enclosing time trace scope for a bunch of small scopes with
12341234
// "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+
});
12391239

12401240
if (DS) {
12411241
return ParseDeclOrFunctionDefInternal(Attrs, DeclSpecAttrs, *DS, AS);
@@ -1267,9 +1267,9 @@ Parser::DeclGroupPtrTy Parser::ParseDeclarationOrFunctionDefinition(
12671267
Decl *Parser::ParseFunctionDefinition(ParsingDeclarator &D,
12681268
const ParsedTemplateInfo &TemplateInfo,
12691269
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+
});
12731273

12741274
// Poison SEH identifiers so they are flagged as illegal in function bodies.
12751275
PoisonSEHIdentifiersRAIIObject PoisonSEHIdentifiers(*this, true);

0 commit comments

Comments
 (0)