Skip to content

Commit c3d3eb7

Browse files
committed
[Driver] Always parse response files as GNU command line arguments
clang parses response files in GNU mode, even on Windows except - If you explicitly pass `--rsp-quoting=windows` in the command line invocation or - If no `--rsp-quoting` is specified and clang is running `cl` mode, which is the case if clang is invoked as `cl` or `clang-cl`, which is the compatibility mode to Window’s `cl` compiler as far as I can tell. The Swift driver always outputs response files in GNU mode (swiftlang/swift-driver#1000). Since Swift does not need to support a compatibility mode with another compiler, there is no need for it to parse response files in Windows mode. We should unconditionally parse the response files in GNU mode.
1 parent 844d103 commit c3d3eb7

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

lib/Driver/FrontendUtil.cpp

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,7 @@ void swift::driver::ExpandResponseFilesWithRetry(llvm::StringSaver &Saver,
3131
llvm::SmallVectorImpl<const char *> &Args) {
3232
const unsigned MAX_COUNT = 30;
3333
for (unsigned I = 0; I != MAX_COUNT; ++I) {
34-
if (llvm::cl::ExpandResponseFiles(Saver,
35-
llvm::Triple(llvm::sys::getProcessTriple()).isOSWindows()
36-
? llvm::cl::TokenizeWindowsCommandLine
37-
: llvm::cl::TokenizeGNUCommandLine,
38-
Args)) {
34+
if (llvm::cl::ExpandResponseFiles(Saver, llvm::Triple(llvm::cl::TokenizeGNUCommandLine, Args)) {
3935
return;
4036
}
4137
}

0 commit comments

Comments
 (0)