[PATCH] D36045: Extend syntax of response files

Serge Pavlov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat Jul 29 01:13:52 PDT 2017


sepavloff created this revision.

This change adds two extensions to the syntax of response files, which are
included into command line by constructs `@file`. These extensions are:

- line continuation using trailing backslash, and
- one line comments started by `#`.

Processing of response files, made in GCC by libiberty, treats backslash only
as an escape of the next character. It means that using trailing backslash
for line continuation prevents from using files with newline in their names.
Such filenames are rarely used and drop of their support does not look
restrictive.

On Windows backslash is a normal symbol and using it for line split is not
implemented.

Line where the first non-whitespace character is `#` is considered a
comments and is ignored. This behavior is consistent with sh/ksh/bash on
unix-like systems and PowerShell on Windows. With such extension a file with
name like `#file` cannot be used at the beginning of line. This problem is
easily solved by using names like `./#file`, `\#file` or by putting file
name in quotes.


https://reviews.llvm.org/D36045

Files:
  lib/Support/CommandLine.cpp
  unittests/Support/CommandLineTest.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D36045.108780.patch
Type: text/x-patch
Size: 5936 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170729/a746a9ea/attachment.bin>


More information about the llvm-commits mailing list