[flang] Fix renames in module files
authorTim Keith <tkeith@nvidia.com>
Thu, 12 Sep 2019 16:24:04 +0000 (09:24 -0700)
committerGitHub <noreply@github.com>
Mon, 16 Sep 2019 14:54:27 +0000 (07:54 -0700)
commit0b86ab186d593c1c4e61f3586a4b0d2b3b07f8a7
tree5fc65058907859a9fa63fedfc5be228422c4bd5d
parentce8b500d57cac7abb98b71cbb90e442eed843b2f
[flang] Fix renames in module files

When a module contains a use-association with rename, we have to be
careful to use the correct name (i.e. the local-name, not the use-name)
when writing out its `.mod` file.

When analyzing a `Name` in an expression, follow the use-association
for details, attributes, and constant values; but if we need to make a
`Designator` or `ProcedureDesignator`, use the local name.

Original-commit: flang-compiler/f18@8f07b803e141e34b3e512f8f02ef228186abe80f
Reviewed-on: https://github.com/flang-compiler/f18/pull/740
Tree-same-pre-rewrite: false
flang/lib/semantics/expression.cc
flang/test/semantics/modfile03.f90