File tree Expand file tree Collapse file tree 2 files changed +9
-3
lines changed Expand file tree Collapse file tree 2 files changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -263,6 +263,11 @@ bool CompileInstance::setupCI(
263
263
return false ;
264
264
}
265
265
266
+ // Since LLVM arguments are parsed into a global state, LLVM can't handle
267
+ // multiple argument sets in a process simultaneously. So let's ignore them.
268
+ // FIXME: Remove this if possible.
269
+ invocation.getFrontendOptions ().LLVMArgs .clear ();
270
+
266
271
// / Declare the frontend to be used for multiple compilations.
267
272
invocation.getFrontendOptions ().ReuseFrontendForMutipleCompilations = true ;
268
273
@@ -289,7 +294,7 @@ void CompileInstance::performSema(
289
294
if (CI && ArgsHash == CachedArgHash &&
290
295
CachedReuseCount < Opts.MaxASTReuseCount ) {
291
296
CI->getASTContext ().CancellationFlag = CancellationFlag;
292
- if (performCachedSemaIfPossible (DiagC)) {
297
+ if (! performCachedSemaIfPossible (DiagC)) {
293
298
// If we compileted cacehd Sema operation. We're done.
294
299
++CachedReuseCount;
295
300
return ;
@@ -307,6 +312,9 @@ void CompileInstance::performSema(
307
312
return ;
308
313
}
309
314
315
+ CI->addDiagnosticConsumer (DiagC);
316
+ SWIFT_DEFER { CI->removeDiagnosticConsumer (DiagC); };
317
+
310
318
// CI is potentially reusable.
311
319
CachedArgHash = ArgsHash;
312
320
Original file line number Diff line number Diff line change 1
- // REQUIRES: rdar86809003
2
-
3
1
// RUN: %empty-directory(%t)
4
2
// RUN: %empty-directory(%t/out)
5
3
// RUN: split-file %s %t
You can’t perform that action at this time.
0 commit comments