Skip to content

Commit

Permalink
Remove redundant dynamic casts.
Browse files Browse the repository at this point in the history
  • Loading branch information
PetroZarytskyi committed Nov 21, 2023
1 parent b5fe282 commit 58d3136
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions lib/Differentiator/TBRAnalyzer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -554,8 +554,7 @@ bool TBRAnalyzer::VisitDeclRefExpr(DeclRefExpr* DRE) {
addVar(VD);
}

if (const auto* E = dyn_cast<clang::Expr>(DRE))
setIsRequired(E);
setIsRequired(DRE);

return true;
}
Expand Down Expand Up @@ -772,15 +771,15 @@ bool TBRAnalyzer::VisitCXXConstructExpr(clang::CXXConstructExpr* CE) {
}

bool TBRAnalyzer::VisitMemberExpr(clang::MemberExpr* ME) {
setIsRequired(dyn_cast<clang::Expr>(ME));
setIsRequired(ME);
return true;
}

bool TBRAnalyzer::VisitArraySubscriptExpr(clang::ArraySubscriptExpr* ASE) {
setMode(0);
TraverseStmt(ASE->getBase());
resetMode();
setIsRequired(dyn_cast<clang::Expr>(ASE));
setIsRequired(ASE);
setMode(Mode::kMarkingMode | Mode::kNonLinearMode);
TraverseStmt(ASE->getIdx());
resetMode();
Expand Down

0 comments on commit 58d3136

Please sign in to comment.