[flang-commits] [PATCH] D127703: [flang] Intrinsic module procedure pure prefixes

vdonaldson via Phabricator via flang-commits flang-commits at lists.llvm.org
Mon Jun 13 16:01:14 PDT 2022


vdonaldson created this revision.
vdonaldson added a project: Flang.
Herald added a subscriber: jdoerfert.
Herald added a project: All.
vdonaldson requested review of this revision.

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.


https://reviews.llvm.org/D127703

Files:
  flang/module/__fortran_ieee_exceptions.f90
  flang/module/ieee_arithmetic.f90


Index: flang/module/ieee_arithmetic.f90
===================================================================
--- flang/module/ieee_arithmetic.f90
+++ flang/module/ieee_arithmetic.f90
@@ -514,7 +514,7 @@
     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
Index: flang/module/__fortran_ieee_exceptions.f90
===================================================================
--- flang/module/__fortran_ieee_exceptions.f90
+++ flang/module/__fortran_ieee_exceptions.f90
@@ -124,13 +124,13 @@
   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


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D127703.436593.patch
Type: text/x-patch
Size: 1390 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/flang-commits/attachments/20220613/27d0b0d1/attachment-0001.bin>


More information about the flang-commits mailing list