Commit graph

4 commits

Author SHA1 Message Date
Tim Keith f62f8b655d [flang] Implement reading of module files
When a use-stmt is encountered for a module that isn't in the global
scope, search for and read the appropriate `.mod` file. To perform the
search, pass the search directories in to ResolveNames.

For modules that were read from `.mod` files, we have to keep the cooked
source from being deleted so that the names so that references to names
stay valid. So we store the cooked source in the Scope of the module as
a `unique_ptr`.

Add `Symbol::Flag::ModFile` to distinguish module symbols that were read
from a `.mod` file rather than from the current compilation. Use it to
prevent writing those back out.

Fix test_errors.sh to run the compiler in the temp subdirectory --
otherwise tests could be affected by `.mod` files left from previous
tests.

Original-commit: flang-compiler/f18@207065999c
Reviewed-on: https://github.com/flang-compiler/f18/pull/145
2018-07-25 10:11:38 -07:00
Tim Keith 6568929bf5 [flang] Update module file documentation
Address some review comments, add more information.

Original-commit: flang-compiler/f18@75c97b6f9b
Reviewed-on: https://github.com/flang-compiler/f18/pull/131
2018-07-18 12:39:34 -07:00
Tim Keith 5934a01c58 [flang] Fix typo
Original-commit: flang-compiler/f18@242ff9d229
Reviewed-on: https://github.com/flang-compiler/f18/pull/126
Tree-same-pre-rewrite: false
2018-07-16 16:45:58 -07:00
Tim Keith dda6fa8eba [flang] Initial documentation for .mod files
Original-commit: flang-compiler/f18@f1809b833f
Reviewed-on: https://github.com/flang-compiler/f18/pull/126
Tree-same-pre-rewrite: false
2018-07-16 16:26:14 -07:00