diff options
Diffstat (limited to 'clang/lib/Frontend/CompilerInstance.cpp')
-rw-r--r-- | clang/lib/Frontend/CompilerInstance.cpp | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/clang/lib/Frontend/CompilerInstance.cpp b/clang/lib/Frontend/CompilerInstance.cpp index 2d6ab87..cbc9c9d 100644 --- a/clang/lib/Frontend/CompilerInstance.cpp +++ b/clang/lib/Frontend/CompilerInstance.cpp @@ -1257,10 +1257,14 @@ std::unique_ptr<CompilerInstance> CompilerInstance::cloneForModuleCompileImpl( Instance.GetDependencyDirectives = GetDependencyDirectives->cloneFor(Instance.getFileManager()); - // If we're collecting module dependencies, we need to share a collector - // between all of the module CompilerInstances. Other than that, we don't - // want to produce any dependency output from the module build. - Instance.setModuleDepCollector(getModuleDepCollector()); + if (ThreadSafeConfig) { + Instance.setModuleDepCollector(ThreadSafeConfig->getModuleDepCollector()); + } else { + // If we're collecting module dependencies, we need to share a collector + // between all of the module CompilerInstances. Other than that, we don't + // want to produce any dependency output from the module build. + Instance.setModuleDepCollector(getModuleDepCollector()); + } Inv.getDependencyOutputOpts() = DependencyOutputOptions(); return InstancePtr; |