[llvm] r196620 - Support: Fix handling of args that begin with @ but aren't files

Justin Bogner mail at justinbogner.com
Fri Dec 6 14:56:20 PST 2013


Author: bogner
Date: Fri Dec  6 16:56:19 2013
New Revision: 196620

URL: http://llvm.org/viewvc/llvm-project?rev=196620&view=rev
Log:
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

Modified:
    llvm/trunk/lib/Support/CommandLine.cpp

Modified: llvm/trunk/lib/Support/CommandLine.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Support/CommandLine.cpp?rev=196620&r1=196619&r2=196620&view=diff
==============================================================================
--- llvm/trunk/lib/Support/CommandLine.cpp (original)
+++ llvm/trunk/lib/Support/CommandLine.cpp Fri Dec  6 16:56:19 2013
@@ -655,7 +655,10 @@ bool cl::ExpandResponseFiles(StringSaver
     // 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);





More information about the llvm-commits mailing list