OSDN Git Service

[flang] Fix bugs in .mod file for abstract interface
authorTim Keith <tkeith@nvidia.com>
Mon, 28 Dec 2020 16:50:30 +0000 (08:50 -0800)
committerTim Keith <tkeith@nvidia.com>
Mon, 28 Dec 2020 16:50:32 +0000 (08:50 -0800)
commitd55627d221be8154cbdf454fa727afcc3f716b08
treef095168f1a8cd28c981a697cc50d1da830e1d495
parent496fb70b141ccbfaba9761294f3b4b97717096a3
[flang] Fix bugs in .mod file for abstract interface

When an abstract interface is defined, add the ABSTRACT attribute to
subprogram symbols that define the interface body. Make use of that
when writing .mod files to include "abstract" on the interface statement.

Also, fix a problem with the order of symbols in a .mod file. Sometimes
a name is mentioned before the "real" declaration, e.g. in an access
statement. We want the order to be based on the real definitions. In
these cases we replace the symbol name with an identical name with a
different source location. Then by sorting based on the source location
we get symbols in the right order.

Differential Revision: https://reviews.llvm.org/D93572
flang/lib/Semantics/mod-file.cpp
flang/lib/Semantics/resolve-names.cpp
flang/test/Semantics/modfile10.f90
flang/test/Semantics/procinterface01.f90
flang/test/Semantics/symbol15.f90