Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
  • Loading branch information
vgvassilev and github-actions[bot] authored Feb 12, 2024
1 parent c0a8b55 commit 41f91c0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion lib/Differentiator/CladUtils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -634,7 +634,7 @@ namespace clad {
}

void SetSwitchCaseSubStmt(SwitchCase* SC, Stmt* subStmt) {
if (auto caseStmt = dyn_cast<CaseStmt>(SC))
if (auto *caseStmt = dyn_cast<CaseStmt>(SC))
caseStmt->setSubStmt(subStmt);
else
cast<DefaultStmt>(SC)->setSubStmt(subStmt);
Expand Down
10 changes: 5 additions & 5 deletions lib/Differentiator/ReverseModeVisitor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3296,10 +3296,10 @@ Expr* getArraySizeExpr(const ArrayType* AT, ASTContext& context,
condExpr = GlobalStoreAndRef(condDiff.getExpr(), "_cond").getExpr();
}

auto activeBreakContHandler = PushBreakContStmtHandler(
auto *activeBreakContHandler = PushBreakContStmtHandler(
/*forSwitchStmt=*/true);
activeBreakContHandler->BeginCFSwitchStmtScope();
auto SSData = PushSwitchStmtInfo();
auto *SSData = PushSwitchStmtInfo();

if (isInsideLoop)
SSData->switchStmtCond = condTape->Last();
Expand Down Expand Up @@ -3350,8 +3350,8 @@ Expr* getArraySizeExpr(const ArrayType* AT, ASTContext& context,
// ```
if (SSData->defaultIfBreakExpr) {
Expr* breakCond = nullptr;
for (auto SC : SSData->cases) {
if (auto CS = dyn_cast<CaseStmt>(SC)) {
for (auto *SC : SSData->cases) {
if (auto *CS = dyn_cast<CaseStmt>(SC)) {
if (breakCond) {
breakCond = BuildOp(BinaryOperatorKind::BO_LAnd, breakCond,
BuildOp(BinaryOperatorKind::BO_NE,
Expand Down Expand Up @@ -3407,7 +3407,7 @@ Expr* getArraySizeExpr(const ArrayType* AT, ASTContext& context,
Expr* lhsClone = (CS->getLHS() ? Clone(CS->getLHS()) : nullptr);
Expr* rhsClone = (CS->getRHS() ? Clone(CS->getRHS()) : nullptr);

auto newSC = clad_compat::CaseStmt_Create(m_Sema.getASTContext(), lhsClone,
auto *newSC = clad_compat::CaseStmt_Create(m_Sema.getASTContext(), lhsClone,
rhsClone, noLoc, noLoc, noLoc);

Expr* ifCond = BuildOp(BinaryOperatorKind::BO_EQ, newSC->getLHS(),
Expand Down

0 comments on commit 41f91c0

Please sign in to comment.