Support: Fix handling of args that begin with @ but aren't files

Command line arguments that begin with @ but aren't a path to an
existing file currently cause later @file arguments to be ignored.

Correctly skip over these arguments instead of trying to read a
non-existent file 20 times and giving up.

Since the problem manifests in the clang driver, the test is in that
repository.

Fixes rdar://problem/15590906

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@196620 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Justin Bogner 2013-12-06 22:56:19 +00:00
parent a2bfea9743
commit 74999cfe0c

View File

@ -655,7 +655,10 @@ bool cl::ExpandResponseFiles(StringSaver &Saver, TokenizerCallback Tokenizer,
// the cwd of the process or the response file?
SmallVector<const char *, 0> ExpandedArgv;
if (!ExpandResponseFile(Arg + 1, Saver, Tokenizer, ExpandedArgv)) {
// We couldn't read this file, so we leave it in the argument stream and
// move on.
AllExpanded = false;
++I;
continue;
}
Argv.erase(Argv.begin() + I);