Skip to content

Commit f17b9a7

Browse files
authored
[clang][ExprConst][NFC] Only call getExprLoc() once (#141473)
It's potentially costly, so only do it once.
1 parent 1cf5466 commit f17b9a7

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

clang/lib/AST/ExprConstant.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8468,10 +8468,11 @@ class ExprEvaluatorBase
84688468

84698469
const FunctionDecl *Definition = nullptr;
84708470
Stmt *Body = FD->getBody(Definition);
8471+
SourceLocation Loc = E->getExprLoc();
84718472

8472-
if (!CheckConstexprFunction(Info, E->getExprLoc(), FD, Definition, Body) ||
8473-
!HandleFunctionCall(E->getExprLoc(), Definition, This, E, Args, Call,
8474-
Body, Info, Result, ResultSlot))
8473+
if (!CheckConstexprFunction(Info, Loc, FD, Definition, Body) ||
8474+
!HandleFunctionCall(Loc, Definition, This, E, Args, Call, Body, Info,
8475+
Result, ResultSlot))
84758476
return false;
84768477

84778478
if (!CovariantAdjustmentPath.empty() &&

0 commit comments

Comments
 (0)