aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Frontend/CompilerInstance.cpp
diff options
context:
space:
mode:
authorBenjamin Kramer <benny.kra@googlemail.com>2018-11-05 12:46:02 +0000
committerBenjamin Kramer <benny.kra@googlemail.com>2018-11-05 12:46:02 +0000
commit5904c41ed26dd1031acb0dbc991c3fd272ceb21f (patch)
treef4b460339416b1717630eda20bc8e71b8a1a8c6f /clang/lib/Frontend/CompilerInstance.cpp
parent5f60861be706191866341c52b6ce5bbcb1c024ed (diff)
downloadllvm-5904c41ed26dd1031acb0dbc991c3fd272ceb21f.zip
llvm-5904c41ed26dd1031acb0dbc991c3fd272ceb21f.tar.gz
llvm-5904c41ed26dd1031acb0dbc991c3fd272ceb21f.tar.bz2
Reapply "Fix regression in behavior of clang -x c++-header -fmodule-name=XXX"
This reverts commit r345963. We have a path forward now. Original commit message: The driver accidentally stopped passing the input filenames on to -cc1 in this mode due to confusion over what action was being requested. This change also fixes a couple of crashes I encountered when passing multiple files to such a -cc1 invocation. llvm-svn: 346130
Diffstat (limited to 'clang/lib/Frontend/CompilerInstance.cpp')
-rw-r--r--clang/lib/Frontend/CompilerInstance.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/clang/lib/Frontend/CompilerInstance.cpp b/clang/lib/Frontend/CompilerInstance.cpp
index a9c51d4..719474d 100644
--- a/clang/lib/Frontend/CompilerInstance.cpp
+++ b/clang/lib/Frontend/CompilerInstance.cpp
@@ -372,6 +372,9 @@ static void InitializeFileRemapping(DiagnosticsEngine &Diags,
void CompilerInstance::createPreprocessor(TranslationUnitKind TUKind) {
const PreprocessorOptions &PPOpts = getPreprocessorOpts();
+ // The module manager holds a reference to the old preprocessor (if any).
+ ModuleManager.reset();
+
// Create a PTH manager if we are using some form of a token cache.
PTHManager *PTHMgr = nullptr;
if (!PPOpts.TokenCache.empty())