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
This commit is contained in:
Mehdi Amini 2017-01-08 22:30:43 +00:00
parent 09ad678bc4
commit e4c7f12274
1 changed files with 1 additions and 1 deletions

View File

@ -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;
}