mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Clear any LLVMArgs when initializing the CompilerInvocation for SourceKit's ASTManager
SourceKit doesn't use them and if any unrecognised LLVM options are passed to llvm::cl::ParseCommandLineOptions() it calls exit(), bringing down SourceKit. Also use fprintf instead of llvm::errs() in Logging.cpp as it uses a global C++ object that had already been destructed when logging the above failure. Resolves rdar://problem/38314383
This commit is contained in:
@@ -459,6 +459,9 @@ bool SwiftASTManager::initCompilerInvocation(CompilerInvocation &Invocation,
|
||||
// SwiftONoneSupport module.
|
||||
FrontendOpts.RequestedAction = FrontendOptions::ActionType::Typecheck;
|
||||
|
||||
// We don't care about LLVMArgs
|
||||
FrontendOpts.LLVMArgs.clear();
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user