[PATCH] D104130: [flang] Handle multiple USE statements for the same module

Pete Steinfeld via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jun 11 09:52:47 PDT 2021


PeteSteinfeld created this revision.
Herald added a reviewer: sscalpone.
PeteSteinfeld requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

It's possible to have several USE statements for the same module that
have different mixes of rename clauses and ONLY clauses.  The presence
of a rename cause has the effect of hiding a previously associated name,
and the presence of an ONLY clause forces the name to be visible even in
the presence of a rename.

I fixed this by keeping track of the names that appear on rename and ONLY
clauses.  Then, when processing the USE association of a name, I check to see
if it previously appeared in a rename clause and not in a USE clause.  If so, I
remove its USE associated symbol.  Also, when USE associating all of the names
in a module, I do not USE associate names that have appeared in rename clauses.

I also added a test.

All of this work stemmed from analyzing the NAG test ../i/ig4.f90.  I ran
across a couple of other minor problem in the process that I also fixed.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D104130

Files:
  flang/lib/Semantics/resolve-names.cpp
  flang/test/Semantics/modfile41.f90

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D104130.351486.patch
Type: text/x-patch
Size: 9040 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210611/fba6427d/attachment.bin>


More information about the llvm-commits mailing list