From 6e560b94d785409f4d013233dcdcaf4cbe95dc5e Mon Sep 17 00:00:00 2001 From: kchristin Date: Sun, 3 Nov 2024 18:08:59 +0200 Subject: [PATCH] Fix clang-tidy suggestion --- lib/Differentiator/ReverseModeVisitor.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/Differentiator/ReverseModeVisitor.cpp b/lib/Differentiator/ReverseModeVisitor.cpp index 91082f376..ee5b8e259 100644 --- a/lib/Differentiator/ReverseModeVisitor.cpp +++ b/lib/Differentiator/ReverseModeVisitor.cpp @@ -1767,10 +1767,10 @@ Expr* getArraySizeExpr(const ArrayType* AT, ASTContext& context, llvm::MutableArrayRef(DerivedCallArgs), Loc) .get(); if (FD->getNameAsString() == "cudaMalloc") { - if (auto addrOp = dyn_cast(DerivedCallArgs[0])) { - if (addrOp->getOpcode() == UO_AddrOf) { + if (auto* addrOp = dyn_cast(DerivedCallArgs[0])) + if (addrOp->getOpcode() == UO_AddrOf) DerivedCallArgs[0] = addrOp->getSubExpr(); // get the pointer - } + llvm::SmallVector args = {DerivedCallArgs[0], getZeroInit(m_Context.IntTy), DerivedCallArgs[1]};