[PATCH] D100897: [flang] Make 'team_number()' an intrinsic function

Peter Klausler via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 7 13:43:10 PDT 2021


klausler added inline comments.


================
Comment at: flang/include/flang/Evaluate/type.h:132
 
+  static constexpr DynamicType MissingDerivedType() {
+    DynamicType result;
----------------
craig.rasmussen wrote:
> 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.
So when the optional argument is absent, the type is *not* TEAM_TYPE from ISO_FORTRAN_ENV, even if that type is available?


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D100897/new/

https://reviews.llvm.org/D100897



More information about the llvm-commits mailing list