[flang-commits] [flang] d498080 - [flang] Intrinsic module procedure pure prefixes
V Donaldson via flang-commits
flang-commits at lists.llvm.org
Mon Jun 13 16:36:14 PDT 2022
Author: V Donaldson
Date: 2022-06-13T16:36:07-07:00
New Revision: d4980803b63cddd041bb8798cd3ca61fc8b4e3fd
URL: https://github.com/llvm/llvm-project/commit/d4980803b63cddd041bb8798cd3ca61fc8b4e3fd
DIFF: https://github.com/llvm/llvm-project/commit/d4980803b63cddd041bb8798cd3ca61fc8b4e3fd.diff
LOG: [flang] Intrinsic module procedure pure prefixes
Per 7.11.1p1 - All [ieee_arithmetic and ieee_exceptions] functions are
pure and all the subroutines are impure unless otherwise stated. Most of
these functions are elemental (and not impure), which implies pure.
Several of the remaining non-elemental functions are missing pure prefixes;
add them.
Added:
Modified:
flang/module/__fortran_ieee_exceptions.f90
flang/module/ieee_arithmetic.f90
Removed:
################################################################################
diff --git a/flang/module/__fortran_ieee_exceptions.f90 b/flang/module/__fortran_ieee_exceptions.f90
index 7232bbf53cd61..0b620f55cee84 100644
--- a/flang/module/__fortran_ieee_exceptions.f90
+++ b/flang/module/__fortran_ieee_exceptions.f90
@@ -124,13 +124,13 @@ end subroutine ieee_set_status
end interface
#define IEEE_SUPPORT_FLAG_R(XKIND) \
- logical function ieee_support_flag_a##XKIND(flag, x); \
+ pure logical function ieee_support_flag_a##XKIND(flag, x); \
import ieee_flag_type; \
type(ieee_flag_type), intent(in) :: flag; \
real(XKIND), intent(in) :: x(..); \
end function ieee_support_flag_a##XKIND;
interface ieee_support_flag
- logical function ieee_support_flag(flag)
+ pure logical function ieee_support_flag(flag)
import ieee_flag_type
type(ieee_flag_type), intent(in) :: flag
end function ieee_support_flag
diff --git a/flang/module/ieee_arithmetic.f90 b/flang/module/ieee_arithmetic.f90
index b2ac217aa86ae..365f803aca71e 100644
--- a/flang/module/ieee_arithmetic.f90
+++ b/flang/module/ieee_arithmetic.f90
@@ -514,7 +514,7 @@ pure logical function ieee_support_rounding_a##XKIND(round_value, x); \
real(XKIND), intent(in) :: x(..); \
end function ieee_support_rounding_a##XKIND;
interface ieee_support_rounding
- logical function ieee_support_rounding(round_value)
+ pure logical function ieee_support_rounding(round_value)
import ieee_round_type
type(ieee_round_type), intent(in) :: round_value
end function ieee_support_rounding
More information about the flang-commits
mailing list