From 2445732261d26e1abed27f0902dac5f4144b0460 Mon Sep 17 00:00:00 2001 From: kchristin Date: Tue, 8 Oct 2024 11:57:03 +0300 Subject: [PATCH] Use already added macros for ImplicitCastExpr create --- include/clad/Differentiator/Compatibility.h | 6 ------ lib/Differentiator/ConstantFolder.cpp | 5 +++-- 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/include/clad/Differentiator/Compatibility.h b/include/clad/Differentiator/Compatibility.h index f2265c995..efd3d629c 100644 --- a/include/clad/Differentiator/Compatibility.h +++ b/include/clad/Differentiator/Compatibility.h @@ -730,11 +730,5 @@ template bool isa_and_nonnull(const Y* Val) { } #endif -#if CLANG_VERSION_MAJOR < 13 -const auto VK_R = ExprValueKind::VK_RValue; -#else -const auto VK_R = ExprValueKind::VK_PRValue; -#endif - } // namespace clad_compat #endif //CLAD_COMPATIBILITY diff --git a/lib/Differentiator/ConstantFolder.cpp b/lib/Differentiator/ConstantFolder.cpp index daea278fe..de9e2f89d 100644 --- a/lib/Differentiator/ConstantFolder.cpp +++ b/lib/Differentiator/ConstantFolder.cpp @@ -147,9 +147,10 @@ namespace clad { QT->isSignedIntegerOrEnumerationType()); Result = clad::synthesizeLiteral( dyn_cast(QT)->getDecl()->getIntegerType(), C, APVal); - Expr* cast = ImplicitCastExpr::Create( + Expr* cast = ImplicitCastExpr_Create( C, QT, clang::CastKind::CK_IntegralCast, Result, nullptr, - clad_compat::VK_R, FPOptionsOverride()); + CLAD_COMPAT_ExprValueKind_R_or_PR_Value + CLAD_COMPAT_CLANG12_CastExpr_DefaultFPO); Result = cast; } else if (QT->isPointerType()) { Result = clad::synthesizeLiteral(QT, C);