File tree 1 file changed +7
-2
lines changed
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(
1418
1418
auto WrapGenModuleAction = getGenModuleActionWrapper ();
1419
1419
Instance.setGenModuleActionWrapper (WrapGenModuleAction);
1420
1420
1421
- // Share an output manager.
1422
1421
assert (hasOutputBackend () &&
1423
1422
" 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
+ }
1425
1430
1426
1431
if (ThreadSafeConfig) {
1427
1432
Instance.setModuleDepCollector (ThreadSafeConfig->getModuleDepCollector ());
You can’t perform that action at this time.
0 commit comments