diff --git a/lib/Differentiator/BaseForwardModeVisitor.cpp b/lib/Differentiator/BaseForwardModeVisitor.cpp index 7a70f3bcb..910574ddb 100644 --- a/lib/Differentiator/BaseForwardModeVisitor.cpp +++ b/lib/Differentiator/BaseForwardModeVisitor.cpp @@ -1389,7 +1389,7 @@ StmtDiff BaseForwardModeVisitor::VisitUnaryOperator(const UnaryOperator* UnOp) { Expr* derivedOp = BuildOp(UO_Minus, diff.getExpr_dx()); return {op, derivedOp}; } else { - unsupportedOpWarn(UnOp->getEndLoc()); + unsupportedOpWarn(UnOp->getOperatorLoc()); auto zero = ConstantFolder::synthesizeLiteral(m_Context.IntTy, m_Context, 0); return StmtDiff(op, zero); @@ -1529,7 +1529,7 @@ BaseForwardModeVisitor::VisitBinaryOperator(const BinaryOperator* BinOp) { opDiff = BuildOp(opCode, Ldiff.getExpr_dx(), Rdiff.getExpr()); } else { // FIXME: add support for other binary operators - unsupportedOpWarn(BinOp->getEndLoc()); + unsupportedOpWarn(BinOp->getOperatorLoc()); opDiff = ConstantFolder::synthesizeLiteral(m_Context.IntTy, m_Context, 0); } if (opDiff) diff --git a/lib/Differentiator/ReverseModeVisitor.cpp b/lib/Differentiator/ReverseModeVisitor.cpp index db0a5c2a6..9ce0fa489 100644 --- a/lib/Differentiator/ReverseModeVisitor.cpp +++ b/lib/Differentiator/ReverseModeVisitor.cpp @@ -2269,7 +2269,7 @@ Expr* getArraySizeExpr(const ArrayType* AT, ASTContext& context, // discontinuity in the function space. // FIXME: We should support boolean differentiation or ignore it // completely - unsupportedOpWarn(UnOp->getEndLoc()); + unsupportedOpWarn(UnOp->getOperatorLoc()); diff = Visit(E); ResultRef = diff.getExpr_dx(); } @@ -2676,7 +2676,7 @@ Expr* getArraySizeExpr(const ArrayType* AT, ASTContext& context, // FIXME: We should support boolean differentiation or ignore it // completely if (!BinOp->isComparisonOp() && !BinOp->isLogicalOp()) - unsupportedOpWarn(BinOp->getEndLoc()); + unsupportedOpWarn(BinOp->getOperatorLoc()); return BuildOp(opCode, Visit(L).getExpr(), Visit(R).getExpr()); }