[all-commits] [llvm/llvm-project] 659879: [flang] Add -fhermetic-module-files (#98083)

Peter Klausler via All-commits all-commits at lists.llvm.org
Thu Jul 11 14:03:05 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 65987954d9903e4fa3dfbf1ccac9d942d4af1fbb
      https://github.com/llvm/llvm-project/commit/65987954d9903e4fa3dfbf1ccac9d942d4af1fbb
  Author: Peter Klausler <35819229+klausler at users.noreply.github.com>
  Date:   2024-07-11 (Thu, 11 Jul 2024)

  Changed paths:
    M clang/include/clang/Driver/Options.td
    M clang/lib/Driver/ToolChains/Flang.cpp
    M flang/include/flang/Frontend/CompilerInvocation.h
    M flang/include/flang/Semantics/semantics.h
    M flang/lib/Frontend/CompilerInvocation.cpp
    M flang/lib/Frontend/FrontendAction.cpp
    M flang/lib/Semantics/mod-file.cpp
    M flang/lib/Semantics/mod-file.h
    M flang/lib/Semantics/semantics.cpp
    A flang/test/Semantics/modfile65.f90

  Log Message:
  -----------
  [flang] Add -fhermetic-module-files (#98083)

Module files emitted by this Fortran compiler are valid Fortran source
files. Symbols that are USE-associated into modules are represented in
their module files with USE statements and special comments with hash
codes in them to ensure that those USE statements resolve to the same
modules that were used to build the module when its module file was
generated.

This scheme prevents unchecked module file growth in large applications
by not emitting USE-associated symbols redundantly. This problem can be
especially bad when derived type definitions must be repeated in the
module files of their clients, and the clients of those modules, and so
on. However, this scheme has the disadvantage that clients of modules
must be compiled with dependent modules in the module search path.

This new -fhermetic-module-files option causes module file output to be
free of dependences on any non-intrinsic module files; dependent modules
are instead emitted as part of the module file, rather than being
USE-associated. It is intended for top level library module files that
are shipped with binary libraries when it is not convenient to collect
and ship their dependent module files as well.

Fixes https://github.com/llvm/llvm-project/issues/97398.



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list