diff options
author | Mehdi Amini <mehdi.amini@apple.com> | 2017-01-08 22:30:43 +0000 |
---|---|---|
committer | Mehdi Amini <mehdi.amini@apple.com> | 2017-01-08 22:30:43 +0000 |
commit | e4c7f122748b6d0a9cfc8b5a5c1a010b72dfff14 (patch) | |
tree | 8685a50a86a8d9fc74dc121c156e349f08127cef /llvm/lib/Support/CommandLine.cpp | |
parent | 09ad678bc40d86486cb69e58bb466c92cd278750 (diff) | |
download | llvm-e4c7f122748b6d0a9cfc8b5a5c1a010b72dfff14.zip llvm-e4c7f122748b6d0a9cfc8b5a5c1a010b72dfff14.tar.gz llvm-e4c7f122748b6d0a9cfc8b5a5c1a010b72dfff14.tar.bz2 |
CommandLine option: Relax the assertion introduced in r290467 to allows for empty string
This is used in LDC for custom boolean commandline options, setArgStr
is called with an empty string before using AddLiteralOption.
llvm-svn: 291406
Diffstat (limited to 'llvm/lib/Support/CommandLine.cpp')
-rw-r--r-- | llvm/lib/Support/CommandLine.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/Support/CommandLine.cpp b/llvm/lib/Support/CommandLine.cpp index 0a98970..3889902 100644 --- a/llvm/lib/Support/CommandLine.cpp +++ b/llvm/lib/Support/CommandLine.cpp @@ -373,7 +373,7 @@ void Option::removeArgument() { GlobalParser->removeOption(this); } void Option::setArgStr(StringRef S) { if (FullyInitialized) GlobalParser->updateArgStr(this, S); - assert(S[0] != '-' && "Option can't start with '-"); + assert((S.empty() || S[0] != '-') && "Option can't start with '-"); ArgStr = S; } |