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

Craig E Rasmussen via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 7 12:46:14 PDT 2021


craig.rasmussen added a comment.

Added line comments.



================
Comment at: flang/include/flang/Evaluate/type.h:132
 
+  static constexpr DynamicType MissingDerivedType() {
+    DynamicType result;
----------------
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.



================
Comment at: flang/include/flang/Evaluate/type.h:226
     AssumedTypeKind = -3, // TYPE(*)
+    MissingDerivedKind = -4, // kind for missing optional dummy arguments
+                             // used to specify some intrinsic functions
----------------
An special enum value is not really needed (I'm pretty sure) as a kind value of 0 could be used.  Having a special kind value could be useful for later analysis but no usage identified at the moment.


================
Comment at: flang/lib/Evaluate/intrinsics.cpp:1688
         dummyArgs.emplace_back(dummyArgs[sameDummyArg.value()]);
+      } else if (d.typePattern.kindCode == KindCode::teamType) {
+        characteristics::TypeAndShape typeAndShape{
----------------
Since there is no actual argument at this point a semantics::DerivedTypeSpec can't be created from it.  Nor does it seem possible to create a DerivedTypeSpec from the context as it is a FoldingContext not a semantics::SemanticsContext.


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

https://reviews.llvm.org/D100897



More information about the llvm-commits mailing list