mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
[Driver/SourceKit] Handle filelist driver args in getSingleFrontendInvocationFromDriverArguments
getSingleFrontendInvocationFromDriverArguments is set up to never produce file lists in the output frontend arguments, but since the driver accepts file lists as input arguments, this should too.
This commit is contained in:
@@ -19,6 +19,8 @@
|
||||
#include "swift/Driver/Job.h"
|
||||
#include "swift/Driver/ToolChain.h"
|
||||
#include "llvm/Option/ArgList.h"
|
||||
#include "llvm/Support/CommandLine.h"
|
||||
#include "llvm/Support/StringSaver.h"
|
||||
|
||||
using namespace swift;
|
||||
using namespace swift::driver;
|
||||
@@ -46,6 +48,16 @@ bool swift::driver::getSingleFrontendInvocationFromDriverArguments(
|
||||
Args.push_back("-driver-filelist-threshold");
|
||||
Args.push_back(neverThreshold.c_str());
|
||||
|
||||
// Expand any file list args.
|
||||
llvm::BumpPtrAllocator Allocator;
|
||||
llvm::StringSaver Saver(Allocator);
|
||||
llvm::cl::ExpandResponseFiles(
|
||||
Saver,
|
||||
llvm::Triple(llvm::sys::getProcessTriple()).isOSWindows()
|
||||
? llvm::cl::TokenizeWindowsCommandLine
|
||||
: llvm::cl::TokenizeGNUCommandLine,
|
||||
Args);
|
||||
|
||||
// Force the driver into batch mode by specifying "swiftc" as the name.
|
||||
Driver TheDriver("swiftc", "swiftc", Args, Diags);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user