Skip to content

Commit e775d85

Browse files
committed
[SourceKit] Ignore LLVM arguments in 'compile' request
LLVM arguments processing is a process global state. At this point, there's no way to localize it to a CompilerInstance. For now, ignore any LLVM arguemnts, so options from another compilation doesn't affect other compilations. rdar://86809003
1 parent 972e3aa commit e775d85

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

lib/IDE/CompileInstance.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -263,6 +263,11 @@ bool CompileInstance::setupCI(
263263
return false;
264264
}
265265

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+
266271
/// Declare the frontend to be used for multiple compilations.
267272
invocation.getFrontendOptions().ReuseFrontendForMutipleCompilations = true;
268273

test/SourceKit/Compile/basic.swift

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
// REQUIRES: rdar86809003
2-
31
// RUN: %empty-directory(%t)
42
// RUN: %empty-directory(%t/out)
53
// RUN: split-file %s %t

0 commit comments

Comments
 (0)