Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[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
- Loading branch information
Showing
8 changed files
with
420 additions
and
99 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.