From e775d853d3d687e682d9aa2af7b992a01ac3db98 Mon Sep 17 00:00:00 2001 From: Rintaro Ishizaki Date: Fri, 21 Jan 2022 10:12:08 -0800 Subject: [PATCH] [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 --- lib/IDE/CompileInstance.cpp | 5 +++++ test/SourceKit/Compile/basic.swift | 2 -- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/IDE/CompileInstance.cpp b/lib/IDE/CompileInstance.cpp index 8e382d19852..3ad8a14bf44 100644 --- a/lib/IDE/CompileInstance.cpp +++ b/lib/IDE/CompileInstance.cpp @@ -263,6 +263,11 @@ bool CompileInstance::setupCI( return false; } + // Since LLVM arguments are parsed into a global state, LLVM can't handle + // multiple argument sets in a process simultaneously. So let's ignore them. + // FIXME: Remove this if possible. + invocation.getFrontendOptions().LLVMArgs.clear(); + /// Declare the frontend to be used for multiple compilations. invocation.getFrontendOptions().ReuseFrontendForMutipleCompilations = true; diff --git a/test/SourceKit/Compile/basic.swift b/test/SourceKit/Compile/basic.swift index f2f780b0a35..b087fdcb74b 100644 --- a/test/SourceKit/Compile/basic.swift +++ b/test/SourceKit/Compile/basic.swift @@ -1,5 +1,3 @@ -// REQUIRES: rdar86809003 - // RUN: %empty-directory(%t) // RUN: %empty-directory(%t/out) // RUN: split-file %s %t