Commit Graph

4 Commits

Author SHA1 Message Date
Richard Smith 47972afd10 [modules] Simplify -cc1 interface for enabling implicit module maps.
We used to have a flag to enable module maps, and two more flags to enable
implicit module maps. This is all redundant; we don't need any flag for
enabling module maps in the abstract, and we don't usually have -fno- flags for
-cc1. We now have just a single flag, -fimplicit-module-maps, that enables
implicitly searching the file system for module map files and loading them.

The driver interface is unchanged for now. We should probably rename
-fmodule-maps to -fimplicit-module-maps at some point.

llvm-svn: 239789
2015-06-16 00:08:24 +00:00
Ben Langmuir ed98258482 Check module signature when the module has already been loaded
We may need to verify the signature on subsequent imports as well, just
like we verify the size/modtime:
@import A;
@import B; // imports A
@import C; // imports A

llvm-svn: 221569
2014-11-08 00:34:30 +00:00
NAKAMURA Takumi ed7e1cbc4c clang/test/Modules: Remove "REQUIRES:shell" since they work for me.
llvm-svn: 221261
2014-11-04 12:59:18 +00:00
Ben Langmuir 487ea14a46 Add a "signature" to AST files to verify that they haven't changed
Since the order of the IDs in the AST file (e.g. DeclIDs, SelectorIDs)
is not stable, it is not safe to load an AST file that depends on
another AST file that has been rebuilt since the importer was built,
even if "nothing changed". We previously used size and modtime to check
this, but I've seen cases where a module rebuilt quickly enough to foil
this check and caused very hard to debug build errors.

To save cycles when we're loading the AST, we just generate a random
nonce value and check that it hasn't changed when we load an imported
module, rather than actually hash the whole file.

This is slightly complicated by the fact that we need to verify the
signature inside addModule, since we might otherwise consider that a
mdoule is "OutOfDate" when really it is the importer that is out of
date. I didn't see any regressions in module load time after this
change.

llvm-svn: 220493
2014-10-23 18:05:36 +00:00