In the CoarrayChecker, add checks for the constraints C1177 and
C1178 for event-wait-stmt. Add event-post-stmt to the check
for the constraints for sync-stat-list. Add a check for the
constraint C1176 on event-variable.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Things generally look good, and everything builds and tests correctly. But if there's no problem moving the query functions to the Semantics directory, we should do that.
flang/include/flang/Evaluate/tools.h | ||
---|---|---|
1204–1205 | Is Evaluate/tools.h the right place for these functions? Note that the function IsOrContainsEventOrLockComponent() is in Semantics/tools.h. It also looks like all references to these functions come from within the Semantics directory. Putting them all in the same files and directory makes more sense to me. |
flang/include/flang/Evaluate/tools.h | ||
---|---|---|
1204–1205 | Thanks for the feedback. I put these new functions in Evaluate/tools.h since IsTeamType and IsEventTypeOrLockType are both there. I don't have a strong feeling where they should go, but if I move the new functions, then I think those other functions should probably also be moved. What do you think? |
flang/include/flang/Evaluate/tools.h | ||
---|---|---|
1204–1205 | Gee, IsTeamType is referenced in Evaluate/intrinsics.cpp, so it can't be moved even though it's logically related to the other functions. But IsEventTypeOrLockType is only referenced from the Semantics directory. For locality of reference, it make sense to me to move them. |
flang/include/flang/Evaluate/tools.h | ||
---|---|---|
1204–1205 | What you said about IsTeamType reminded me, I will need to call IsEventType from Evaluate/intrinsics.cpp as well when I add event_query to the list of intrinsic subroutines. I will not need to call IsLockType from that file. What would you think in that case? Still move IsEventType, IsLockType, and IsEventTypeOrLockType? Or just the last two that don't/won't have references in the Evaluate directory? @klausler It looks like you originally wrote IsEventTypeOrLockType and IsTeamType, do you have an opinion on this? |
Unfortunately, I let this patch sitting for a while, but I would like to push this soon. @PeteSteinfeld, thank you for the review and for the acceptance of the patch. Previously, I replied to your comment about moving IsEventType and IsLockType and stating that because of future planned changes to support event_query, it seems to me that these new functions should remain where they are now in this patch. Please let me know if you disagree, otherwise I plan to push this differential within the next couple days based on the revision having been accepted. Let me know if you would like me to hold off for further discussion, thanks.
@ktras, this change is causing some of our internal tests to fail. Here's a small test case that illustrates the problem. This test should compile without error, but it gets a semantic error saying:
bug.f90:4:17: error: The event-variable must be a coarray event post (x[1])
Here's the source of the test:
subroutine bug use iso_fortran_env type(event_type), save :: x[*] event post (x[1]) end
@PeteSteinfeld, thanks for letting me know. You are right that the event-variable in an event-post-stmt is allowed to be a coindexed-object. It seems like the using the function evaluate::IsCoarray, as I did, to make sure that event-variable is a coarray disallows coindexed-objects. I will make some changes and open a new differential to address this.
Is Evaluate/tools.h the right place for these functions?
Note that the function IsOrContainsEventOrLockComponent() is in Semantics/tools.h. It also looks like all references to these functions come from within the Semantics directory. Putting them all in the same files and directory makes more sense to me.