From 58d3136c4d46ffe438dab2c03974136b21c2c562 Mon Sep 17 00:00:00 2001 From: "petro.zarytskyi" Date: Tue, 21 Nov 2023 13:57:29 +0200 Subject: [PATCH] Remove redundant dynamic casts. --- lib/Differentiator/TBRAnalyzer.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/lib/Differentiator/TBRAnalyzer.cpp b/lib/Differentiator/TBRAnalyzer.cpp index 6fbf5fc5f..d1433e4ab 100644 --- a/lib/Differentiator/TBRAnalyzer.cpp +++ b/lib/Differentiator/TBRAnalyzer.cpp @@ -554,8 +554,7 @@ bool TBRAnalyzer::VisitDeclRefExpr(DeclRefExpr* DRE) { addVar(VD); } - if (const auto* E = dyn_cast(DRE)) - setIsRequired(E); + setIsRequired(DRE); return true; } @@ -772,7 +771,7 @@ bool TBRAnalyzer::VisitCXXConstructExpr(clang::CXXConstructExpr* CE) { } bool TBRAnalyzer::VisitMemberExpr(clang::MemberExpr* ME) { - setIsRequired(dyn_cast(ME)); + setIsRequired(ME); return true; } @@ -780,7 +779,7 @@ bool TBRAnalyzer::VisitArraySubscriptExpr(clang::ArraySubscriptExpr* ASE) { setMode(0); TraverseStmt(ASE->getBase()); resetMode(); - setIsRequired(dyn_cast(ASE)); + setIsRequired(ASE); setMode(Mode::kMarkingMode | Mode::kNonLinearMode); TraverseStmt(ASE->getIdx()); resetMode();