This is an archive of the discontinued LLVM Phabricator instance.

[flang] Fix classification of shape inquiries in specification exprs
ClosedPublic

Authored by klausler on Jan 12 2021, 3:41 PM.

Details

Summary
In some contexts, including the motivating case of determining whether
the expressions that define the shape of a variable are "constant expressions"
in the sense of the Fortran standard, expression rewriting via Fold()
is not necessary, and should not be required.  The inquiry intrinsics LBOUND,
UBOUND, and SIZE work correctly now in specification expressions and are
classified correctly as being constant expressions (or not).  Getting this right
led to a fair amount of API clean-up as a consequence, including the
folding of shapes and TypeAndShape objects, and new APIs for shapes
that do not fold for those cases where folding isn't needed.  Further,
the symbol-testing predicate APIs in Evaluate/tools.h now all resolve any
associations of their symbols and work transparently on use-, host-, and
construct-association symbols; the tools used to resolve those associations have
been defined and documented more precisely, and their clients adjusted as needed.

Diff Detail

Event Timeline

klausler created this revision.Jan 12 2021, 3:41 PM
klausler requested review of this revision.Jan 12 2021, 3:41 PM
Herald added a project: Restricted Project. · View Herald TranscriptJan 12 2021, 3:41 PM
tskeith accepted this revision.Jan 12 2021, 6:30 PM
This revision is now accepted and ready to land.Jan 12 2021, 6:30 PM
This revision was landed with ongoing or failed builds.Jan 13 2021, 10:07 AM
This revision was automatically updated to reflect the committed changes.