[flang] Fix Symbol::Rank for ProcEntityDetails
authorPeter Klausler <pklausler@nvidia.com>
Wed, 6 Apr 2022 22:55:53 +0000 (15:55 -0700)
committerPeter Klausler <pklausler@nvidia.com>
Fri, 15 Apr 2022 16:54:48 +0000 (09:54 -0700)
commitca2be81e34a6d87edb8e555dfac94ab68ee20f70
tree3f8d9ae509195a55a035bca7486555afd07e6196
parentbed8212157bbf298cddf2e156940452e5067ea05
[flang] Fix Symbol::Rank for ProcEntityDetails

When a procedure pointer or procedure dummy argument has a
defined interface, the rank of the pointer (or dummy) is the
rank of the interface.

Also tweak code discovered in shape analysis when investigating
this problam so that it returns a vector of emptied extents rather
than std::nullopt when the extents are not scope-invariant, so that
the rank can at least be known.

Differential Revision: https://reviews.llvm.org/D123727
flang/include/flang/Semantics/symbol.h
flang/lib/Evaluate/shape.cpp
flang/test/Evaluate/rewrite01.f90