[flang-commits] [flang] [Flang] KIND De-Templatization (PR #206907)
Michael Kruse via flang-commits
flang-commits at lists.llvm.org
Thu Aug 13 06:31:58 PDT 2026
================
@@ -2206,10 +2307,10 @@ Expr<T> FoldOperation(FoldingContext &context, Divide<T> &&x) {
if constexpr (T::category == TypeCategory::Real) {
if (folded->second.IsZero() && context.moduleFileName().has_value()) {
using IntType = typename T::Scalar::Word;
- auto intNumerator{folded->first.template ToInteger<IntType>()};
+ auto intNumerator{folded->first.ToInteger()};
isCanonicalNaNOrInf = intNumerator.flags == RealFlags{} &&
- intNumerator.value >= IntType{-1} &&
- intNumerator.value <= IntType{1};
+ intNumerator.value >= IntType{-1, 16} &&
+ intNumerator.value <= IntType{1, 16};
----------------
Meinersbur wrote:
It's a trade-off: One gets more type-safety, but this PR will become more verbose with all with all the enum-class casts. I will experiment and see how much I can reduce it with local aliases (Eg. `SubscriptIntKind` etc. already exist).
https://github.com/llvm/llvm-project/pull/206907
More information about the flang-commits
mailing list