File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -1418,10 +1418,15 @@ std::unique_ptr<CompilerInstance> CompilerInstance::cloneForModuleCompileImpl(
14181418 auto WrapGenModuleAction = getGenModuleActionWrapper ();
14191419 Instance.setGenModuleActionWrapper (WrapGenModuleAction);
14201420
1421- // Share an output manager.
14221421 assert (hasOutputBackend () &&
14231422 " Expected an output manager to already be set up" );
1424- Instance.setOutputBackend (&getOutputBackend ());
1423+ if (ThreadSafeConfig) {
1424+ // Create a clone of the existing output (pointing to the same destination).
1425+ Instance.setOutputBackend (getOutputBackend ().clone ());
1426+ } else {
1427+ // Share the existing output manager.
1428+ Instance.setOutputBackend (&getOutputBackend ());
1429+ }
14251430
14261431 if (ThreadSafeConfig) {
14271432 Instance.setModuleDepCollector (ThreadSafeConfig->getModuleDepCollector ());
You can’t perform that action at this time.
0 commit comments