Page MenuHomePhabricator

Rework DATA statement semantics to use typed expressions

Authored by klausler on Apr 24 2020, 2:59 PM.



Updates recent work on DATA statement semantic checking in
flang/lib/Semantics/check-data.{h,cpp} to use the compiler's
internal representation for typed expressions rather than working
on the raw parse tree. Saves the analyzed expressions for DATA
statement values as parse tree decorations because they'll soon be
needed in lowering. Corrects wording of some error messages.

Fixes a bug in constant expression checking: structure constructors
are not constant expressions if they set an allocatable component
to anything other than NULL.

Includes infrastructure changes to make this work, some renaming
to reflect the fact that the implied DO loop indices tracked by
expression analysis are not (just) from array constructors, remove
some dead code, and improve some comments.

Diff Detail

Event Timeline

klausler created this revision.Apr 24 2020, 2:59 PM
Herald added a project: Restricted Project. · View Herald Transcript
klausler updated this revision to Diff 260004.Apr 24 2020, 3:05 PM

Removed change to io-error.cpp that shouldn't be committed.

tskeith accepted this revision.Apr 24 2020, 3:23 PM
This revision is now accepted and ready to land.Apr 24 2020, 3:23 PM
schweitz accepted this revision.Apr 24 2020, 5:41 PM
anchu-rajendran accepted this revision.Apr 25 2020, 2:55 AM
This revision was automatically updated to reflect the committed changes.