[flang][driver] Support parsing response files
authorDiana Picus <diana.picus@linaro.org>
Tue, 3 May 2022 09:44:35 +0000 (09:44 +0000)
committerDiana Picus <diana.picus@linaro.org>
Wed, 18 May 2022 08:25:45 +0000 (08:25 +0000)
commit1c0b03f6e706978f2e87408f7fd5e4c846d6c9a8
treec95c3f4b5bcc99a877f571e3bd5bb8b0b82f4ea3
parent00999fb6e14231de14db292510c854e1bf3baded
[flang][driver] Support parsing response files

Add support for reading response files in the flang driver. Response
files contain command line arguments and are used whenever a command
becomes longer than the shell/environment limit. Response files are
recognized via the special "@path/to/response/file.rsp" syntax, which
distinguishes them from other file inputs.

This patch hardcodes GNU tokenization, since we don't have a CL mode for
the driver. In the future we might want to add a --rsp-quoting command
line option, like clang has, to accommodate Windows platforms.

Differential Revision: https://reviews.llvm.org/D124846
flang/test/Driver/response-file.f90 [new file with mode: 0644]
flang/tools/flang-driver/driver.cpp