[flang] Implement host association and import statements
authorTim Keith <tkeith@nvidia.com>
Wed, 22 Aug 2018 23:05:06 +0000 (16:05 -0700)
committerTim Keith <tkeith@nvidia.com>
Wed, 22 Aug 2018 23:05:06 +0000 (16:05 -0700)
commit5b39e7da108e6fff99f23ccb9900b9d8af46e3db
tree66626de2820bcd6ad81575af1bf0ace8a8badaf1
parent44937f6321df9bc1ce8a321e57983eb08f28e98e
[flang] Implement host association and import statements

Host association is done by search for symbols using `Scope::FindSymbol()`
which looks for the the name in the parent scope if the import rules
permit it.

Import statements are implemented using `importKind_` and `importNames_`
in class `Scope`. Most of the constraints are checked when the
`ImportStmt` is encountered. `CheckImports()` is called at the end of
the `SpecificationPart` to verify the names mentioned in the IMPORT
statement. That has to happen then so that we can detect if an imported
name is hidden by a declaration in the current scope.

Original-commit: flang-compiler/f18@0d50c8a8ba12692e6246c4e1a8a098f2850aba3a
Reviewed-on: https://github.com/flang-compiler/f18/pull/167
Tree-same-pre-rewrite: false
flang/lib/semantics/resolve-names.cc
flang/lib/semantics/scope.cc
flang/lib/semantics/scope.h
flang/lib/semantics/symbol.cc
flang/lib/semantics/unparse-with-symbols.cc
flang/test/semantics/CMakeLists.txt
flang/test/semantics/resolve28.f90 [new file with mode: 0644]
flang/test/semantics/resolve29.f90 [new file with mode: 0644]
flang/test/semantics/symbol02.f90 [new file with mode: 0644]
flang/test/semantics/symbol03.f90 [new file with mode: 0644]