From df2617db61a376bb833d13cb3903418397df631e Mon Sep 17 00:00:00 2001 From: kchristin Date: Mon, 2 Sep 2024 23:50:53 +0300 Subject: [PATCH] Remove check for nonRealType before calling synthesizeLiteral --- lib/Differentiator/BaseForwardModeVisitor.cpp | 4 ---- 1 file changed, 4 deletions(-) diff --git a/lib/Differentiator/BaseForwardModeVisitor.cpp b/lib/Differentiator/BaseForwardModeVisitor.cpp index dbd8ca440..9635e19f8 100644 --- a/lib/Differentiator/BaseForwardModeVisitor.cpp +++ b/lib/Differentiator/BaseForwardModeVisitor.cpp @@ -1071,8 +1071,6 @@ StmtDiff BaseForwardModeVisitor::VisitDeclRefExpr(const DeclRefExpr* DRE) { if (clonedDRE->getType()->isPointerType()) return StmtDiff(clonedDRE, nullptr); QualType literalTy = utils::GetValueType(clonedDRE->getType()); - if (!literalTy->isRealType()) - literalTy = m_Context.IntTy; return StmtDiff(clonedDRE, ConstantFolder::synthesizeLiteral( literalTy, m_Context, /*val=*/0)); } @@ -1379,8 +1377,6 @@ StmtDiff BaseForwardModeVisitor::VisitUnaryOperator(const UnaryOperator* UnOp) { return StmtDiff(op, BuildOp(opKind, dx)); QualType literalTy = utils::GetValueType(UnOp->getSubExpr()->getType()->getPointeeType()); - if (!literalTy->isRealType()) - literalTy = m_Context.IntTy; return StmtDiff( op, ConstantFolder::synthesizeLiteral(literalTy, m_Context, /*val=*/0)); } else if (opKind == UnaryOperatorKind::UO_AddrOf) {