[flang] Fix bug in writing PRIVATE subprograms to .mod file
authorTim Keith <tkeith@nvidia.com>
Mon, 24 Jun 2019 19:35:17 +0000 (12:35 -0700)
committerTim Keith <tkeith@nvidia.com>
Mon, 24 Jun 2019 19:35:17 +0000 (12:35 -0700)
commit86132a15dc5dd551b48f5abc12e57f4324475701
treeb142bea716daaa371931dce36ef30819653b3337
parentba7731ec6b25f428b787d57344aaf666ce3c1cd3
[flang] Fix bug in writing PRIVATE subprograms to .mod file

Subprograms can't have the PRIVATE prefix on them when they are defined.
So if they are private, add a private-stmt for them.

Fixes flang-compiler/f18#519

Original-commit: flang-compiler/f18@d3670aa176cbc79a7d26fc927e9d1e1349900756
Reviewed-on: https://github.com/flang-compiler/f18/pull/523
flang/lib/semantics/mod-file.cc
flang/test/semantics/modfile01.f90