Skip to content

Commit

Permalink
Fix clang-tidy suggestion
Browse files Browse the repository at this point in the history
  • Loading branch information
kchristin22 committed Nov 3, 2024
1 parent cdda9fc commit 6e560b9
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/Differentiator/ReverseModeVisitor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1767,10 +1767,10 @@ Expr* getArraySizeExpr(const ArrayType* AT, ASTContext& context,
llvm::MutableArrayRef<Expr*>(DerivedCallArgs), Loc)
.get();
if (FD->getNameAsString() == "cudaMalloc") {
if (auto addrOp = dyn_cast<UnaryOperator>(DerivedCallArgs[0])) {
if (addrOp->getOpcode() == UO_AddrOf) {
if (auto* addrOp = dyn_cast<UnaryOperator>(DerivedCallArgs[0]))
if (addrOp->getOpcode() == UO_AddrOf)
DerivedCallArgs[0] = addrOp->getSubExpr(); // get the pointer
}

llvm::SmallVector<Expr*, 3> args = {DerivedCallArgs[0],
getZeroInit(m_Context.IntTy),
DerivedCallArgs[1]};
Expand Down

0 comments on commit 6e560b9

Please sign in to comment.