Skip to content

Commit f58459d

Browse files
committed
Address perf regression
1 parent 6711aa9 commit f58459d

File tree

3 files changed

+6
-4
lines changed

3 files changed

+6
-4
lines changed

clang/include/clang/Sema/Sema.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13140,8 +13140,10 @@ class Sema final : public SemaBase {
1314013140
if (PushedCodeSynthesisContext)
1314113141
S.popCodeSynthesisContext();
1314213142

13143-
if (auto *FD = dyn_cast<FunctionDecl>(S.CurContext))
13143+
if (auto *FD = dyn_cast<FunctionDecl>(S.CurContext)) {
1314413144
FD->setWillHaveBody(false);
13145+
S.CheckImmediateEscalatingFunctionDefinition(FD, S.getCurFunction());
13146+
}
1314513147

1314613148
S.PopExpressionEvaluationContext();
1314713149
S.PopFunctionScopeInfo();

clang/lib/Sema/SemaDecl.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16396,6 +16396,9 @@ Decl *Sema::ActOnFinishFunctionBody(Decl *dcl, Stmt *Body,
1639616396
// the declaration context below. Otherwise, we're unable to transform
1639716397
// 'this' expressions when transforming immediate context functions.
1639816398

16399+
if(FD)
16400+
CheckImmediateEscalatingFunctionDefinition(FD, getCurFunction());
16401+
1639916402
if (!IsInstantiation)
1640016403
PopDeclContext();
1640116404

clang/lib/Sema/SemaExpr.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17881,9 +17881,6 @@ void Sema::PopExpressionEvaluationContext() {
1788117881
WarnOnPendingNoDerefs(Rec);
1788217882
HandleImmediateInvocations(*this, Rec);
1788317883

17884-
if (auto *FD = dyn_cast<FunctionDecl>(CurContext); FD && getCurFunction())
17885-
CheckImmediateEscalatingFunctionDefinition(FD, getCurFunction());
17886-
1788717884
// Warn on any volatile-qualified simple-assignments that are not discarded-
1788817885
// value expressions nor unevaluated operands (those cases get removed from
1788917886
// this list by CheckUnusedVolatileAssignment).

0 commit comments

Comments
 (0)