[PATCH] D90494: [flang] Allow array constructor implied DO loop indices as constant expressions

Peter Klausler via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Oct 30 12:59:15 PDT 2020


klausler created this revision.
klausler added a reviewer: jeanPerier.
klausler added a project: Flang.
Herald added subscribers: llvm-commits, jdoerfert.
Herald added a project: LLVM.
klausler requested review of this revision.

When the bounds of an implied DO loop in an array constructor are
constant, the index variable of that loop is considered a constant
expression and can be used as such in the items in the value list
of the implied DO loop.  Since the KIND type parameter values of items
in the value list can depend on the various values taken by such an
index, it is not possible to represent those values with a single
typed expression.  So implement such loops by taking multiple passes
over the parse tree of the implied DO loop instead.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D90494

Files:
  flang/include/flang/Parser/message.h
  flang/include/flang/Semantics/expression.h
  flang/lib/Semantics/expression.cpp
  flang/test/Evaluate/folding13.f90
  flang/test/Semantics/array-constr-values.f90

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D90494.301999.patch
Type: text/x-patch
Size: 16436 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20201030/ed7bd0a0/attachment.bin>


More information about the llvm-commits mailing list