summaryrefslogtreecommitdiffstats
path: root/clang/lib/Frontend/Rewrite/FrontendActions.cpp
diff options
context:
space:
mode:
authorRichard Smith <richard-llvm@metafoo.co.uk>2017-06-26 19:39:25 +0000
committerRichard Smith <richard-llvm@metafoo.co.uk>2017-06-26 19:39:25 +0000
commita21c8e14b609644f5a26416c0e585b4bae66a075 (patch)
tree49764adca13adda2728960b7d266129ce940e71e /clang/lib/Frontend/Rewrite/FrontendActions.cpp
parent695c69316bca9b3f81f1a777bb78753e85c1488b (diff)
downloadbcm5719-llvm-a21c8e14b609644f5a26416c0e585b4bae66a075.tar.gz
bcm5719-llvm-a21c8e14b609644f5a26416c0e585b4bae66a075.zip
When preprocessing with -frewrite-imports and -fmodule-file=, do not pass all
modules to preprocessing of nested .pcm files. Making those module files available results in loading more .pcm files than necessary, and potentially in misbehavior if a module makes itself visible during its own compilation (as parts of that module that have not yet been processed would then become visible). llvm-svn: 306320
Diffstat (limited to 'clang/lib/Frontend/Rewrite/FrontendActions.cpp')
-rw-r--r--clang/lib/Frontend/Rewrite/FrontendActions.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/clang/lib/Frontend/Rewrite/FrontendActions.cpp b/clang/lib/Frontend/Rewrite/FrontendActions.cpp
index f64fbdafd59..e93f737c47f 100644
--- a/clang/lib/Frontend/Rewrite/FrontendActions.cpp
+++ b/clang/lib/Frontend/Rewrite/FrontendActions.cpp
@@ -247,6 +247,8 @@ public:
Instance.getFrontendOpts().Inputs.clear();
Instance.getFrontendOpts().Inputs.emplace_back(
Filename, InputKind(InputKind::Unknown, InputKind::Precompiled));
+ Instance.getFrontendOpts().ModuleFiles.clear();
+ Instance.getFrontendOpts().ModuleMapFiles.clear();
// Don't recursively rewrite imports. We handle them all at the top level.
Instance.getPreprocessorOutputOpts().RewriteImports = false;
OpenPOWER on IntegriCloud