[flang-commits] [PATCH] D118631: [flang] Distinguish intrinsic from non-intrinsic modules

Peter Klausler via Phabricator via flang-commits flang-commits at lists.llvm.org
Mon Jan 31 10:13:12 PST 2022


klausler created this revision.
klausler added a reviewer: PeteSteinfeld.
klausler added a project: Flang.
Herald added subscribers: mehdi_amini, jdoerfert.
Herald added a reviewer: sscalpone.
klausler requested review of this revision.

For "USE, INTRINSIC", search only for intrinsic modules;
for "USE, NON_INTRINSIC", do not recognize intrinsic modules.
Allow modules of both kinds with the same name to be used in
the same source file (but not in the same scoping unit, a
constraint of the standard that is now enforced).

The symbol table's scope tree now has a single instance of
a scope with a new kind, IntrinsicModules, whose children are
the USE'd intrinsic modules (explicit or not).  This separate
"top-level" scope is a child of the single global scope and
it allows both intrinsic and non-intrinsic modules of the same
name to exist in the symbol table.  Intrinsic modules' scopes'
symbols now have the INTRINSIC attribute set.

The search path directories need to make a distinction between
regular directories and the one(s) that point(s) to intrinsic
modules.  I allow for multiple intrinsic module directories in
the second search path, although only one is needed today.


https://reviews.llvm.org/D118631

Files:
  flang/include/flang/Parser/parsing.h
  flang/include/flang/Parser/provenance.h
  flang/include/flang/Semantics/scope.h
  flang/include/flang/Semantics/semantics.h
  flang/lib/Frontend/CompilerInvocation.cpp
  flang/lib/Lower/Mangler.cpp
  flang/lib/Parser/parsing.cpp
  flang/lib/Parser/provenance.cpp
  flang/lib/Semantics/mod-file.cpp
  flang/lib/Semantics/mod-file.h
  flang/lib/Semantics/resolve-names.cpp
  flang/lib/Semantics/resolve-names.h
  flang/lib/Semantics/scope.cpp
  flang/lib/Semantics/semantics.cpp
  flang/lib/Semantics/symbol.cpp
  flang/lib/Semantics/tools.cpp
  flang/test/Semantics/modfile43.f90

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D118631.404594.patch
Type: text/x-patch
Size: 26232 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/flang-commits/attachments/20220131/bcabf85c/attachment-0001.bin>


More information about the flang-commits mailing list