Skip to content

Commit

Permalink
Use already added macros for ImplicitCastExpr create
Browse files Browse the repository at this point in the history
  • Loading branch information
kchristin22 committed Oct 8, 2024
1 parent 2d624ca commit 2445732
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 8 deletions.
6 changes: 0 additions & 6 deletions include/clad/Differentiator/Compatibility.h
Original file line number Diff line number Diff line change
Expand Up @@ -730,11 +730,5 @@ template <typename X, typename Y> 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
5 changes: 3 additions & 2 deletions lib/Differentiator/ConstantFolder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -147,9 +147,10 @@ namespace clad {
QT->isSignedIntegerOrEnumerationType());
Result = clad::synthesizeLiteral(
dyn_cast<EnumType>(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);
Expand Down

0 comments on commit 2445732

Please sign in to comment.