Skip to content

Commit

Permalink
[clang][Interp][NFC] Move dyn_cast check into if condition
Browse files Browse the repository at this point in the history
M is not used anywhere else.
  • Loading branch information
tbaederr committed May 17, 2023
1 parent 43377cc commit f8c9947
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions clang/lib/AST/Interp/InterpFrame.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<CXXMethodDecl>(F);
if (M && M->isInstance() && !isa<CXXConstructorDecl>(F)) {
if (const auto *M = dyn_cast<CXXMethodDecl>(F);
M && M->isInstance() && !isa<CXXConstructorDecl>(F)) {
print(OS, This, S.getCtx(), S.getCtx().getRecordType(M->getParent()));
OS << "->";
}
Expand Down

0 comments on commit f8c9947

Please sign in to comment.