summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Support/CommandLine.cpp
diff options
context:
space:
mode:
authorMehdi Amini <mehdi.amini@apple.com>2016-12-23 23:55:26 +0000
committerMehdi Amini <mehdi.amini@apple.com>2016-12-23 23:55:26 +0000
commit4fe6a8c826bd963ed87a1b98490ed87755e34201 (patch)
tree3a78bac5a20b1dcf1577fdfb09a199326b187fc2 /llvm/lib/Support/CommandLine.cpp
parent70a02b0923181214f3995822b489eeddea93b693 (diff)
downloadbcm5719-llvm-4fe6a8c826bd963ed87a1b98490ed87755e34201.tar.gz
bcm5719-llvm-4fe6a8c826bd963ed87a1b98490ed87755e34201.zip
Add an assertion for cl::opt names: they can't start with '-'
llvm-svn: 290467
Diffstat (limited to 'llvm/lib/Support/CommandLine.cpp')
-rw-r--r--llvm/lib/Support/CommandLine.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/llvm/lib/Support/CommandLine.cpp b/llvm/lib/Support/CommandLine.cpp
index fa1782c9941..0a989706b43 100644
--- a/llvm/lib/Support/CommandLine.cpp
+++ b/llvm/lib/Support/CommandLine.cpp
@@ -373,6 +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 '-");
ArgStr = S;
}
OpenPOWER on IntegriCloud