[flang] Infrastructure improvements in utility routines
authorpeter klausler <pklausler@nvidia.com>
Wed, 20 Jan 2021 01:14:41 +0000 (17:14 -0800)
committerpeter klausler <pklausler@nvidia.com>
Wed, 20 Jan 2021 20:40:25 +0000 (12:40 -0800)
commit0996b590aaafe2de8378fd45a5094c13a4de3360
tree1168457e05c07a232cf375c33ebaa9dc43da44df
parent8dd58a509cc8b93a211c9b07b12e1548dc187fc3
[flang] Infrastructure improvements in utility routines

* IsArrayElement() needs another option to control whether it
  should ignore trailing component references.
* Add IsObjectPointer().
* Add const Scope& variants of IsFunction() and IsProcedure().
* Make TypeAndShape::Characterize() work with procedure bindings.
* Handle CHARACTER length in MeasureSizeInBytes().
* Fine-tune FindExternallyVisibleObject()'s handling of dummy arguments
  to conform with Fortran 2018: only INTENT(IN) and dummy pointers
  in pure functions signify; update two tests accordingly.

Also: resolve some stylistic inconsistencies and add a missing
"const" in the expression traversal template framework.

Differential Revision: https://reviews.llvm.org/D95011
flang/include/flang/Evaluate/call.h
flang/include/flang/Evaluate/tools.h
flang/include/flang/Evaluate/traverse.h
flang/lib/Evaluate/characteristics.cpp
flang/lib/Evaluate/tools.cpp
flang/lib/Semantics/tools.cpp
flang/test/Semantics/structconst03.f90
flang/test/Semantics/structconst04.f90