summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorJustin Bogner <mail@justinbogner.com>2013-12-06 22:56:19 +0000
committerJustin Bogner <mail@justinbogner.com>2013-12-06 22:56:19 +0000
commit67ae9912a6471f4ec9666b456914e0fb8ead1bf1 (patch)
tree5645273338258157f78882903f9bce4b4a502a8a /llvm/lib
parent93a07c2185d1eb4fd441cf0343f9b77f9611fdc1 (diff)
downloadbcm5719-llvm-67ae9912a6471f4ec9666b456914e0fb8ead1bf1.tar.gz
bcm5719-llvm-67ae9912a6471f4ec9666b456914e0fb8ead1bf1.zip
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 llvm-svn: 196620
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/Support/CommandLine.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/llvm/lib/Support/CommandLine.cpp b/llvm/lib/Support/CommandLine.cpp
index 9acaa08bbcc..7ed4dead041 100644
--- a/llvm/lib/Support/CommandLine.cpp
+++ b/llvm/lib/Support/CommandLine.cpp
@@ -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);
OpenPOWER on IntegriCloud