[flang-commits] [PATCH] D100897: [flang] Make 'team_number()' an intrinsic function
Craig E Rasmussen via Phabricator via flang-commits
flang-commits at lists.llvm.org
Wed Jul 7 13:26:51 PDT 2021
craig.rasmussen added inline comments.
================
Comment at: flang/include/flang/Evaluate/type.h:132
+ static constexpr DynamicType MissingDerivedType() {
+ DynamicType result;
----------------
klausler wrote:
> craig.rasmussen wrote:
> > This function (whatever it is named) is critical to get team_number to work with a missing optional team arguments. Otherwise the check
> >
> > CHECK(IsValidKindOfIntrinsicType(category_, kind_));
> >
> > disallows the construction of a DynamicType that is not an intrinsic type.
> >
> When the derived type TEAM_TYPE from intrinsic module ISO_FORTRAN_ENV is available, this MissingDerivedType() is not required, right?
Correct. This is tested by the new test team_number.f90 (added in this patch). If the actual argument is available the dummy argument is created from the actual with
auto dc{characteristics::DummyArgument::FromActual(
std::string{d.keyword}, *expr, context)};
see semantics.cpp line 1651. Although to be clear, the derived type TEAM_TYPE will have already been loaded from ISO_FORTRAN_ENV via a USE statement by this time, it is just not directly available.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D100897/new/
https://reviews.llvm.org/D100897
More information about the flang-commits
mailing list