Skip to content

Commit 8314b31

Browse files
committed
[llvm][support] show name of overlapping cl opt
1 parent 117041d commit 8314b31

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

llvm/include/llvm/Support/CommandLine.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -863,7 +863,10 @@ template <class DataType> class parser : public generic_parser_base {
863863
///
864864
template <class DT>
865865
void addLiteralOption(StringRef Name, const DT &V, StringRef HelpStr) {
866-
assert(findOption(Name) == Values.size() && "Option already exists!");
866+
#ifndef NDEBUG
867+
if (findOption(Name) != Values.size())
868+
report_fatal_error("Option " + Name + " already exists!");
869+
#endif
867870
OptionInfo X(Name, static_cast<DataType>(V), HelpStr);
868871
Values.push_back(X);
869872
AddLiteralOption(Owner, Name);

0 commit comments

Comments
 (0)