-
Notifications
You must be signed in to change notification settings - Fork 11.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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 #97398.
- Loading branch information
Showing
10 changed files
with
142 additions
and
30 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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
! RUN: %python %S/test_modfile.py %s %flang_fc1 -fhermetic-module-files | ||
module m1 | ||
integer, parameter :: n = 123 | ||
end | ||
|
||
module m2 | ||
use m1 | ||
end | ||
|
||
module m3 | ||
use m1, m => n | ||
end | ||
|
||
module m4 | ||
use m2 | ||
use m3 | ||
end | ||
|
||
!Expect: m1.mod | ||
!module m1 | ||
!integer(4),parameter::n=123_4 | ||
!end | ||
|
||
!Expect: m2.mod | ||
!module m2 | ||
!use m1,only:n | ||
!end | ||
!module m1 | ||
!integer(4),parameter::n=123_4 | ||
!end | ||
|
||
!Expect: m3.mod | ||
!module m3 | ||
!use m1,only:m=>n | ||
!end | ||
!module m1 | ||
!integer(4),parameter::n=123_4 | ||
!end | ||
|
||
!Expect: m4.mod | ||
!module m4 | ||
!use m2,only:n | ||
!use m3,only:m | ||
!end | ||
!module m2 | ||
!use m1,only:n | ||
!end | ||
!module m3 | ||
!use m1,only:m=>n | ||
!end | ||
!module m1 | ||
!integer(4),parameter::n=123_4 | ||
!end |