15 #include "llvm/ADT/STLExtras.h"
22 if (dump_mask & eDumpOptionType)
23 strm.
Printf(
"(%s)", GetTypeAsCString());
26 if (dump_mask & eDumpOptionValue) {
27 if (dump_mask & eDumpOptionType)
29 strm.
PutCString(m_current_value ?
"true" :
"false");
33 Status OptionValueBoolean::SetValueFromString(llvm::StringRef value_str,
45 bool value = OptionArgParser::ToBoolean(value_str,
false, &success);
47 m_value_was_set =
true;
48 m_current_value = value;
51 if (value_str.size() == 0)
52 error.SetErrorString(
"invalid boolean string value <empty>");
54 error.SetErrorStringWithFormat(
"invalid boolean string value: '%s'",
55 value_str.str().c_str());
64 error = OptionValue::SetValueFromString(value_str, op);
72 llvm::StringRef autocomplete_entries[] = {
"true",
"false",
"on",
"off",
73 "yes",
"no",
"1",
"0"};
75 auto entries = llvm::makeArrayRef(autocomplete_entries);
79 entries = entries.take_front(2);
81 for (
auto entry : entries)