Lines Matching +full:- +full:- +full:files
1 <!--===- docs/ModFiles.md
5 SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 -->
9 # Module Files
12 ---
14 ---
17 Module files hold information from a module that is necessary to compile
22 Module files must be searchable by module name. They are typically named
28 clear which compiler created a `.mod` file and files from multiple compilers
30 between the module name and extension, e.g. `<modulename>-f18.mod`. If this
31 is needed, Flang's fc1 accepts the option `-module-suffix` to alter the suffix
36 Module files will be Fortran source.
40 a single *type-declaration-statement*.
59 - Magic string to confirm it is an f18 `.mod` file
60 - Version information: to indicate the version of the file format, in case it changes,
62 - Checksum of the body of the current file
63 - Modules we depend on and the checksum of their module file when the current
65 - The source file that produced the `.mod` file? This could be used in error messages.
73 - extraneous spaces will be removed
74 - implicit types will be made explicit
75 - attributes will be written in a consistent order
76 - entity declarations will be combined into a single declaration
77 - function return types specified in a *prefix-spec* will be replaced by
79 - etc.
86 - private types that appear in the public API
87 - private components of non-private derived types
88 - private parameters used in non-private declarations (initial values, kind parameters)
89 - others?
92 in the `.mod` file. (Currently they are readable in PGI `.mod` files.)
98 Each use-associated symbol will be written as a separate *use-only* statement,
102 - Emit a single `USE` for each module, listing all of the symbols that were
103 use-associated in the *only-list*.
104 - Detect when all of the symbols from a module are imported (either by a *use-stmt*
105 without an *only-list* or because all of the public symbols of the module
106 have been listed in *only-list*s). In that case collapse them into a single *use-stmt*.
107 - Emit the *use-stmt*s that appeared in the original source.
109 ## Reading and writing module files
113 The compiler will have command-line options to specify where to search
114 for module files and where to write them. By default it will be the current
117 For PGI, `-I` specifies directories to search for include files and module
118 files. `-module` specifics a directory to write module files in as well as to
119 search for them. gfortran is similar except it uses `-J` instead of `-module`.
121 The search order for module files is:
122 1. The `-module` directory (Note: for gfortran the `-J` directory is not searched).
124 3. The `-I` directories in the order they appear on the command line
126 ### Writing module files
131 Module files will be written after semantics, i.e. after the compiler has
133 **NOTE:** PGI does create `.mod` files sometimes even when the module has a
140 ### Reading module files
150 When processing `.mod` files we know they are valid Fortran with these properties:
168 ## Hermetic modules files
170 Top-level module files for libraries can be build with `-fhermetic-module-files`.
171 This option causes these module files to contain copies of all of the non-intrinsic
172 modules on which they depend, so that non-top-level local modules and the