[PATCH] D36420: Emit warning if response file is not found

Serge Pavlov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 7 11:21:58 PDT 2017

sepavloff created this revision.

If construct `@foo` is specified in command line, CommandLine library
tries to consider `foo` as a name of response file and read options
from it. If file `foo` is not found, it tries to open file `@foo`.
This behavior is compatible with libiberty, used in GCC and other

On the other hand, if user specifies `@foo`, it almost certainly
means a response file named `foo`. If `foo` was not found, it is
some error like misspelling or wrong current directory but not a file
with name `@foo`. With this change CommandLine issues warning
`response file 'foo' not found` and continues execution as before.

Construct `@file` is a possible way to load configuration files
(see https://reviews.llvm.org/D24933). If it will be accepted,
CommandLibrary will not search for file `@file`, instead it will
try to load configuration file `file.cfg`. This warning could help
in identifying compatibility problems.



Index: lib/Support/CommandLine.cpp
--- lib/Support/CommandLine.cpp
+++ lib/Support/CommandLine.cpp
@@ -975,6 +975,8 @@
       // move on.
       AllExpanded = false;
+      // Emit warning if response file is not found, it might be misprint.
+      errs() << "Response file '" << Arg + 1 << "' not found\n";
     Argv.erase(Argv.begin() + I);

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D36420.110037.patch
Type: text/x-patch
Size: 447 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170807/f35a9aa6/attachment.bin>

More information about the llvm-commits mailing list