[PATCH] D78834: Rework DATA statement semantics to use typed expressions

Peter Klausler via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Apr 24 15:12:14 PDT 2020


klausler created this revision.
klausler added reviewers: tskeith, sscalpone.
klausler added a project: Flang.
Herald added a reviewer: jdoerfert.
Herald added a reviewer: DavidTruby.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.
klausler updated this revision to Diff 260004.
klausler added a comment.

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


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.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D78834

Files:
  flang/include/flang/Evaluate/check-expression.h
  flang/include/flang/Evaluate/expression.h
  flang/include/flang/Evaluate/tools.h
  flang/include/flang/Evaluate/variable.h
  flang/include/flang/Parser/dump-parse-tree.h
  flang/include/flang/Parser/parse-tree.h
  flang/include/flang/Parser/tools.h
  flang/include/flang/Semantics/expression.h
  flang/lib/Evaluate/check-expression.cpp
  flang/lib/Evaluate/variable.cpp
  flang/lib/Parser/Fortran-parsers.cpp
  flang/lib/Semantics/check-data.cpp
  flang/lib/Semantics/check-data.h
  flang/lib/Semantics/expression.cpp
  flang/lib/Semantics/resolve-names.cpp
  flang/test/Semantics/assign04.f90
  flang/test/Semantics/data03.f90

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D78834.260004.patch
Type: text/x-patch
Size: 37842 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200424/239f3582/attachment.bin>


More information about the llvm-commits mailing list