[flang] Resolve array specifications of entities.
authorTim Keith <tkeith@nvidia.com>
Thu, 12 Apr 2018 19:59:42 +0000 (12:59 -0700)
committerTim Keith <tkeith@nvidia.com>
Thu, 12 Apr 2018 19:59:42 +0000 (12:59 -0700)
commit8ca01883bcf34692b0b0bcfdf97d048a32cd6f27
tree1508bb6d135c2937ad41beb10ddea8177c390a32
parentd32620ac6d192a08e95b8ae35ad682916c236db3
[flang] Resolve array specifications of entities.

Add ArraySpecVisitor to recognize the various forms of array specifications.
They are tracked in arraySpec_ and attrArraySpec_. Both are needed because
a declaration like `integer, dimension(4) :: x(2,2), y` has two different
array-specs.

The method DeclareEntity was extracted out to handle the common part for
EntityDecl, ObjectDecl, and DimensionStmt. AllocatableStmt and TargetStmt
are now handled through their contained ObjectDecl.

The test resolve07 checks the interactions between these kinds of declarations.

Rename ComponentArraySpec to ArraySpec as it doesn't just occur in components.

Fix some 'begin' and 'end' methods to start with upper-case letters.

Original-commit: flang-compiler/f18@3d4d7430b559a135a3eddf8291449106195406a0
Reviewed-on: https://github.com/flang-compiler/f18/pull/53
flang/lib/semantics/make-types.cc
flang/lib/semantics/resolve-names.cc
flang/lib/semantics/symbol.cc
flang/lib/semantics/symbol.h
flang/lib/semantics/type.cc
flang/lib/semantics/type.h
flang/test/semantics/resolve01.f90
flang/test/semantics/resolve07.f90 [new file with mode: 0644]