[flang] Process procedure declarations and derived types.
authorTim Keith <tkeith@nvidia.com>
Tue, 5 Jun 2018 19:18:35 +0000 (12:18 -0700)
committerTim Keith <tkeith@nvidia.com>
Tue, 5 Jun 2018 19:18:35 +0000 (12:18 -0700)
commit348ccb784e4dda00b40fde201b38302441ae853c
tree112eb67322f2df909146b62debfcc5a5c7f2d3ca
parente820c545d768ba90b9d56913bd4b4ebc744eed2a
[flang] Process procedure declarations and derived types.

Add ObjectEntityDetails and ProcEntityDetails to distinguish between an
entity from an object-decl and one from a proc-decl. When we don't know,
it stays as EntityDetails until it is resolved. DeclareEntity() in
DeclarationVisitor creates this kind of symbol.

Add flags to Symbol as a convenient place for boolean flags common to
many kinds of symbols. Use it to mark symbols known to be functions or
subroutines so that we can report errors when they are used incorrectly.
Improve handling of EXTERNAL statement.

Handle ProcDecl nodes and add symbols for them.

Partial processing of derived types. Data component declarations are
processed and added to the derived type. Define TypeBoundProc and
TypeBoundGeneric in type.h. Procedure components, type-bound procedures,
etc. are not handled yet and nothing is done with the derived type once
it is created. Eliminate DerivedTypeDefBuilder in favor of just setting
fields in derivedTypeData_.

Add GetDeclTypeSpec to go with BeginDeclTypeSpec and EndDeclTypeSpec, to
avoid directly access the private variable.

Add tests in resolve20.f90 for errors related to procedure declarations.
Add missing copyrights to other tests.

Original-commit: flang-compiler/f18@40e65c14656a1c60eae5a8fdfbdcab062ad6f1d2
Reviewed-on: https://github.com/flang-compiler/f18/pull/97
Tree-same-pre-rewrite: false
15 files changed:
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/resolve09.f90
flang/test/semantics/resolve12.f90
flang/test/semantics/resolve13.f90
flang/test/semantics/resolve14.f90
flang/test/semantics/resolve15.f90
flang/test/semantics/resolve16.f90
flang/test/semantics/resolve17.f90
flang/test/semantics/resolve18.f90
flang/test/semantics/resolve19.f90
flang/test/semantics/resolve20.f90 [new file with mode: 0644]