Skip to content

Commit c475356

Browse files
authored
[clang][bytecode][NFC] Only call getSource() when necessary (#125419)
1 parent fc89745 commit c475356

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

clang/lib/AST/ByteCode/Interp.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,17 +65,17 @@ static void diagnoseNonConstVariable(InterpState &S, CodePtr OpPC,
6565
const ValueDecl *VD);
6666
static bool diagnoseUnknownDecl(InterpState &S, CodePtr OpPC,
6767
const ValueDecl *D) {
68-
const SourceInfo &E = S.Current->getSource(OpPC);
6968

7069
if (isa<ParmVarDecl>(D)) {
7170
if (D->getType()->isReferenceType())
7271
return false;
7372

73+
const SourceInfo &Loc = S.Current->getSource(OpPC);
7474
if (S.getLangOpts().CPlusPlus11) {
75-
S.FFDiag(E, diag::note_constexpr_function_param_value_unknown) << D;
75+
S.FFDiag(Loc, diag::note_constexpr_function_param_value_unknown) << D;
7676
S.Note(D->getLocation(), diag::note_declared_at) << D->getSourceRange();
7777
} else {
78-
S.FFDiag(E);
78+
S.FFDiag(Loc);
7979
}
8080
return false;
8181
}

0 commit comments

Comments
 (0)