This is an archive of the discontinued LLVM Phabricator instance.

[flang] Support for image selectors
ClosedPublic

Authored by PeteSteinfeld on Jul 7 2020, 12:34 PM.

Details

Summary

This change implements support for image selectors and image selector
specifications as described in section 9.6.

In check-coarray[.h,cpp] I changed the Leave() function for
parser::ImageSelectorSpec to take a parser::ImageSelector, which
contains a list of image selector specifications. This allows us to
detect when the same specification is used more than once. I also added
code to analyze the expressions for the image selector specifications to
expression.cpp and a test for all of the conditions to check at
compile-time.

Note that we do not check at compile-time to see if the value of the
cosubscripts are within the specified cobounds. We also do not check anything
related to selecting a valid team. We also do not check that the denotation of
the stat-variable is not dependent on the evaluation of an entity in the
same statement.

Diff Detail

Event Timeline

PeteSteinfeld created this revision.Jul 7 2020, 12:34 PM
Herald added a project: Restricted Project. · View Herald Transcript
PeteSteinfeld added a project: Restricted Project.Jul 7 2020, 12:35 PM
tskeith accepted this revision.Jul 7 2020, 1:31 PM
tskeith added inline comments.
flang/lib/Semantics/check-coarray.cpp
113

I think this should be "STAT variable..."

flang/lib/Semantics/expression.cpp
1090–1100

Because all of the cases are the same, this can be simplified to:

std::visit([&](const auto &x) { Analyze(x.v); }, imageSelSpec.u);
This revision is now accepted and ready to land.Jul 7 2020, 1:31 PM
PeteSteinfeld marked 2 inline comments as done.Jul 7 2020, 3:12 PM
PeteSteinfeld added inline comments.
flang/lib/Semantics/check-coarray.cpp
113

So it shall be written.

flang/lib/Semantics/expression.cpp
1090–1100

Thanks! I thought there might be something like this.

This revision was automatically updated to reflect the committed changes.