aboutsummaryrefslogtreecommitdiff
path: root/flang/lib/Evaluate/intrinsics.cpp
diff options
context:
space:
mode:
authorPeter Klausler <35819229+klausler@users.noreply.github.com>2024-04-08 11:57:01 -0700
committerGitHub <noreply@github.com>2024-04-08 11:57:01 -0700
commite1ad2735c3e7b0af94159f585458c7383255f03e (patch)
tree40f0c02245e571ea9e31a4446bd3a126cd788df9 /flang/lib/Evaluate/intrinsics.cpp
parent97e3f605d5b574899d9f012032349bbf84c4dcfb (diff)
downloadllvm-e1ad2735c3e7b0af94159f585458c7383255f03e.zip
llvm-e1ad2735c3e7b0af94159f585458c7383255f03e.tar.gz
llvm-e1ad2735c3e7b0af94159f585458c7383255f03e.tar.bz2
[flang] Clean up ISO_FORTRAN_ENV, fix NUMERIC_STORAGE_SIZE (#87566)
Address TODOs in the intrinsic module ISO_FORTRAN_ENV, and extend the implementation of NUMERIC_STORAGE_SIZE so that the calculation of its value is deferred until it is needed so that the effects of -fdefault-integer-8 or -fdefault-real-8 are reflected. Emit a warning when NUMERIC_STORAGE_SIZE is used from the module file and the default integer and real sizes do not match. Fixes https://github.com/llvm/llvm-project/issues/87476.
Diffstat (limited to 'flang/lib/Evaluate/intrinsics.cpp')
-rw-r--r--flang/lib/Evaluate/intrinsics.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/flang/lib/Evaluate/intrinsics.cpp b/flang/lib/Evaluate/intrinsics.cpp
index 9b98d22..7226d69 100644
--- a/flang/lib/Evaluate/intrinsics.cpp
+++ b/flang/lib/Evaluate/intrinsics.cpp
@@ -903,6 +903,8 @@ static const IntrinsicInterface genericIntrinsicFunction[]{
{"back", AnyLogical, Rank::elemental, Optionality::optional},
DefaultingKIND},
KINDInt},
+ {"__builtin_compiler_options", {}, DefaultChar},
+ {"__builtin_compiler_version", {}, DefaultChar},
{"__builtin_fma", {{"f1", SameReal}, {"f2", SameReal}, {"f3", SameReal}},
SameReal},
{"__builtin_ieee_is_nan", {{"a", AnyFloating}}, DefaultLogical},
@@ -941,8 +943,7 @@ static const IntrinsicInterface genericIntrinsicFunction[]{
{"__builtin_ieee_support_underflow_control",
{{"x", AnyReal, Rank::elemental, Optionality::optional}},
DefaultLogical},
- {"__builtin_compiler_options", {}, DefaultChar},
- {"__builtin_compiler_version", {}, DefaultChar},
+ {"__builtin_numeric_storage_size", {}, DefaultInt},
};
// TODO: Coarray intrinsic functions