[PCH+Modules] Load -fmodule-map-file content before including PCHs
authorBruno Cardoso Lopes <bruno.cardoso@gmail.com>
Thu, 19 Jul 2018 12:32:06 +0000 (12:32 +0000)
committerBruno Cardoso Lopes <bruno.cardoso@gmail.com>
Thu, 19 Jul 2018 12:32:06 +0000 (12:32 +0000)
commit7315d2d721508cc684371dc5495fb6007076b479
tree844c2a0f817eee403b5e26f04c915a83f9ae6dbc
parent4b0028a3d16d83e24ae963fc417eea5cb6d99329
[PCH+Modules] Load -fmodule-map-file content before including PCHs

Consider:
1) Generate PCH with -fmodules and -fmodule-map-file
2) Use PCH with -fmodules and the same -fmodule-map-file

If we don't load -fmodule-map-file content before including PCHs,
the modules that are dependencies in PCHs cannot get loaded,
since there's no matching module map file when reading back the AST.

rdar://problem/40852867

Differential Revision: https://reviews.llvm.org/D48685

llvm-svn: 337447
clang/lib/Frontend/FrontendAction.cpp
clang/test/Modules/module-imported-by-pch-with-modulemap.m [new file with mode: 0644]