summaryrefslogtreecommitdiffstats
path: root/clang/lib/Frontend/FrontendActions.cpp
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2017-08-31 06:26:43 +0000
committerBoris Kolpackov <boris@codesynthesis.com>2017-08-31 06:26:43 +0000
commitd30446fd773e9571a287bb2c3e5d06ab86f7e18b (patch)
tree33333cfa1ff0bf4559655240ddc861f4c9ee9147 /clang/lib/Frontend/FrontendActions.cpp
parentb8198f02e689b2234c09c1171539ecfa3a0f59b2 (diff)
downloadbcm5719-llvm-d30446fd773e9571a287bb2c3e5d06ab86f7e18b.tar.gz
bcm5719-llvm-d30446fd773e9571a287bb2c3e5d06ab86f7e18b.zip
[modules] Add ability to specify module name to module file mapping (reapply)
Extend the -fmodule-file option to support the [<name>=]<file> value format. If the name is omitted, then the old semantics is preserved (the module file is loaded whether needed or not). If the name is specified, then the mapping is treated as just another prebuilt module search mechanism, similar to -fprebuilt-module-path, and the module file is only loaded if actually used (e.g., via import). With one exception: this mapping also overrides module file references embedded in other modules (which can be useful if module files are moved/renamed as often happens during remote compilation). This override semantics requires some extra work: we now store the module name in addition to the file name in the serialized AST representation. Reviewed By: rsmith Differential Revision: https://reviews.llvm.org/D35020 llvm-svn: 312220
Diffstat (limited to 'clang/lib/Frontend/FrontendActions.cpp')
-rw-r--r--clang/lib/Frontend/FrontendActions.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/clang/lib/Frontend/FrontendActions.cpp b/clang/lib/Frontend/FrontendActions.cpp
index d42400183a4..3e3483d2c6b 100644
--- a/clang/lib/Frontend/FrontendActions.cpp
+++ b/clang/lib/Frontend/FrontendActions.cpp
@@ -185,8 +185,8 @@ GenerateModuleFromModuleMapAction::CreateOutputFile(CompilerInstance &CI,
HeaderSearch &HS = CI.getPreprocessor().getHeaderSearchInfo();
CI.getFrontendOpts().OutputFile =
- HS.getModuleFileName(CI.getLangOpts().CurrentModule, ModuleMapFile,
- /*UsePrebuiltPath=*/false);
+ HS.getCachedModuleFileName(CI.getLangOpts().CurrentModule,
+ ModuleMapFile);
}
// We use createOutputFile here because this is exposed via libclang, and we
OpenPOWER on IntegriCloud