Skip to content

Commit

Permalink
Apply suggestions from clang-tidy.
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 Nov 16, 2023
1 parent cec731f commit 7d6183c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion include/clad/Differentiator/TBRAnalyzer.h
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ class TBRAnalyzer : public clang::ConstStmtVisitor<TBRAnalyzer> {

VarsData() = default;

Check warning on line 164 in include/clad/Differentiator/TBRAnalyzer.h

View check run for this annotation

Codecov / codecov/patch

include/clad/Differentiator/TBRAnalyzer.h#L164

Added line #L164 was not covered by tests
VarsData(const VarsData& other) = default;
VarsData(VarsData&& other): data(std::move(other.data)), prev(other.prev) {}
VarsData(VarsData&& other) noexcept : data(std::move(other.data)), prev(other.prev) {}
VarsData& operator=(const VarsData& other) = delete;
VarsData& operator=(VarsData&& other) noexcept {
if (&data == &other.data) {
Expand Down
6 changes: 3 additions & 3 deletions lib/Differentiator/ReverseModeVisitor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2977,7 +2977,7 @@ Expr* getArraySizeExpr(const ArrayType* AT, ASTContext& context,
return DelayedStoreResult{*this, StmtDiff{Cloned, Cloned},
/*isConstant*/ isConst,
/*isInsideLoop*/ false,
/*needsUpdate=*/ false};
/*pNeedsUpdate=*/ false};

Check warning on line 2980 in lib/Differentiator/ReverseModeVisitor.cpp

View check run for this annotation

Codecov / codecov/patch

lib/Differentiator/ReverseModeVisitor.cpp#L2980

Added line #L2980 was not covered by tests
}
if (isInsideLoop) {
Expr* dummy = E;
Expand All @@ -2987,15 +2987,15 @@ Expr* getArraySizeExpr(const ArrayType* AT, ASTContext& context,
return DelayedStoreResult{*this,
StmtDiff{Push, Pop},
/*isConstant*/ false,
/*isInsideLoop*/ true, /*needsUpdate=*/ true};
/*isInsideLoop*/ true, /*pNeedsUpdate=*/ true};
}
Expr* Ref = BuildDeclRef(GlobalStoreImpl(
getNonConstType(E->getType(), m_Context, m_Sema), prefix));
// Return reference to the declaration instead of original expression.
return DelayedStoreResult{*this,
StmtDiff{Ref, Ref},
/*isConstant*/ false,
/*isInsideLoop*/ false, /*needsUpdate=*/ true};
/*isInsideLoop*/ false, /*pNeedsUpdate=*/ true};
}

ReverseModeVisitor::LoopCounter::LoopCounter(ReverseModeVisitor& RMV)
Expand Down

0 comments on commit 7d6183c

Please sign in to comment.