diff options
author | Reid Kleckner <reid@kleckner.net> | 2014-08-22 19:29:17 +0000 |
---|---|---|
committer | Reid Kleckner <reid@kleckner.net> | 2014-08-22 19:29:17 +0000 |
commit | e3f146d941f11c97e2561778d640e6dab721463c (patch) | |
tree | 107d5a7fa1d7a4a383828697950bfe0d64fee75e /llvm/lib/Option/OptTable.cpp | |
parent | f3fc555e3b3e277d3f47150fd749f82dcca43f6c (diff) | |
download | llvm-e3f146d941f11c97e2561778d640e6dab721463c.zip llvm-e3f146d941f11c97e2561778d640e6dab721463c.tar.gz llvm-e3f146d941f11c97e2561778d640e6dab721463c.tar.bz2 |
Fix PR17239 by changing the semantics of the RemainingArgsClass Option kind
This patch contains the LLVM side of the fix of PR17239.
This bug that happens because the /link (clang-cl.exe argument) is
marked as "consume all remaining arguments". However, when inside a
response file, /link should only consume all remaining arguments inside
the response file where it is located, not the entire command line after
expansion.
My patch will change the semantics of the RemainingArgsClass kind to
always consume only until the end of the response file when the option
originally came from a response file. There are only two options in this
class: dash dash (--) and /link.
Reviewed By: rnk
Differential Revision: http://reviews.llvm.org/D4899
Patch by Rafael Auler!
llvm-svn: 216280
Diffstat (limited to 'llvm/lib/Option/OptTable.cpp')
-rw-r--r-- | llvm/lib/Option/OptTable.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/llvm/lib/Option/OptTable.cpp b/llvm/lib/Option/OptTable.cpp index ef9a3e75..dca02c1 100644 --- a/llvm/lib/Option/OptTable.cpp +++ b/llvm/lib/Option/OptTable.cpp @@ -264,6 +264,11 @@ InputArgList *OptTable::ParseArgs(const char *const *ArgBegin, MissingArgIndex = MissingArgCount = 0; unsigned Index = 0, End = ArgEnd - ArgBegin; while (Index < End) { + // Ingore nullptrs, they are response file's EOL markers + if (Args->getArgString(Index) == nullptr) { + ++Index; + continue; + } // Ignore empty arguments (other things may still take them as arguments). StringRef Str = Args->getArgString(Index); if (Str == "") { |