From f8c99477d4b3e8c9faf0f316178e8ab92e281602 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Timm=20B=C3=A4der?= Date: Wed, 17 May 2023 10:26:50 +0200 Subject: [PATCH] [clang][Interp][NFC] Move dyn_cast check into if condition M is not used anywhere else. --- clang/lib/AST/Interp/InterpFrame.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/clang/lib/AST/Interp/InterpFrame.cpp b/clang/lib/AST/Interp/InterpFrame.cpp index a8c4aab..6acfbd3 100644 --- a/clang/lib/AST/Interp/InterpFrame.cpp +++ b/clang/lib/AST/Interp/InterpFrame.cpp @@ -147,8 +147,8 @@ void print(llvm::raw_ostream &OS, const Pointer &P, ASTContext &Ctx, void InterpFrame::describe(llvm::raw_ostream &OS) { const FunctionDecl *F = getCallee(); - auto *M = dyn_cast(F); - if (M && M->isInstance() && !isa(F)) { + if (const auto *M = dyn_cast(F); + M && M->isInstance() && !isa(F)) { print(OS, This, S.getCtx(), S.getCtx().getRecordType(M->getParent())); OS << "->"; } -- 2.7.4