[all-commits] [llvm/llvm-project] 86f59d: [flang] Fix bugs related to merging generics durin...
Tim Keith via All-commits
all-commits at lists.llvm.org
Wed Dec 2 15:19:49 PST 2020
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: 86f59de13b8058280d468984727bd1e6727f2112
https://github.com/llvm/llvm-project/commit/86f59de13b8058280d468984727bd1e6727f2112
Author: Tim Keith <tkeith at nvidia.com>
Date: 2020-12-02 (Wed, 02 Dec 2020)
Changed paths:
M flang/include/flang/Semantics/symbol.h
M flang/lib/Semantics/check-declarations.cpp
M flang/lib/Semantics/mod-file.cpp
M flang/lib/Semantics/resolve-names.cpp
M flang/lib/Semantics/symbol.cpp
M flang/test/Semantics/getsymbols03-a.f90
M flang/test/Semantics/modfile07.f90
M flang/test/Semantics/resolve17.f90
Log Message:
-----------
[flang] Fix bugs related to merging generics during USE
When the same generic name is use-associated from two modules, the
generics are merged into a single one in the current scope. This change
fixes some bugs in that process.
When a generic is merged, it can have two specific procedures with the
same name as the generic (c.f. module m7c in modfile07.f90). We were
disallowing that by checking for duplicate names in the generic rather
than duplicate symbols. Changing `namesSeen` to `symbolsSeen` in
`ResolveSpecificsInGeneric` fixes that.
We weren't including each USE of those generics in the .mod file so in
some cases they were incorrect. Extend GenericDetails to specify all
use-associated symbols that are merged into the generic. This is used to
write out .mod files correctly.
The distinguishability check for specific procedures of a generic
sometimes have to refer to procedures from a use-associated generic in
error messages. In that case we don't have the source location of the
procedure so adapt the message to say where is was use-associated from.
This requires passing the scope through the checks to make that
determination.
Differential Revision: https://reviews.llvm.org/D92492
More information about the All-commits
mailing list