summaryrefslogtreecommitdiffstats
path: root/contrib/llvm/tools/lldb/source/Interpreter/Options.cpp
diff options
context:
space:
mode:
authoremaste <emaste@FreeBSD.org>2014-03-19 13:11:35 +0000
committeremaste <emaste@FreeBSD.org>2014-03-19 13:11:35 +0000
commit958843c32b7a29741f2e45996b5b3e89f9e108b0 (patch)
tree95ae4ffabc848a86b94be3ad3cd42471cdb66b06 /contrib/llvm/tools/lldb/source/Interpreter/Options.cpp
parent2a9993c246f3a2463ccd6b8786781e5b97a35065 (diff)
downloadFreeBSD-src-958843c32b7a29741f2e45996b5b3e89f9e108b0.zip
FreeBSD-src-958843c32b7a29741f2e45996b5b3e89f9e108b0.tar.gz
MFC r258054: Update LLDB to upstream r194122 snapshot
Inludes minor changes relative to upstream, for compatibility with FreeBSD's in-tree LLVM 3.3: - Reverted LLDB r191806, restoring use of previous API. - Reverted part of LLDB r189317, restoring previous enum names. - Work around missing LLVM r192504, using previous registerEHFrames API (limited functionality). - Removed PlatformWindows header include and init/terminate calls. Sponsored by: DARPA, AFRL
Diffstat (limited to 'contrib/llvm/tools/lldb/source/Interpreter/Options.cpp')
-rw-r--r--contrib/llvm/tools/lldb/source/Interpreter/Options.cpp28
1 files changed, 20 insertions, 8 deletions
diff --git a/contrib/llvm/tools/lldb/source/Interpreter/Options.cpp b/contrib/llvm/tools/lldb/source/Interpreter/Options.cpp
index 293d753..8d245cc 100644
--- a/contrib/llvm/tools/lldb/source/Interpreter/Options.cpp
+++ b/contrib/llvm/tools/lldb/source/Interpreter/Options.cpp
@@ -256,7 +256,7 @@ Options::NumCommandOptions ()
return i;
}
-struct option *
+Option *
Options::GetLongOptions ()
{
// Check to see if this has already been done.
@@ -444,13 +444,13 @@ PrintOption (const OptionDefinition &opt_def,
strm.Printf ("--%s", opt_def.long_option);
switch (opt_def.option_has_arg)
{
- case no_argument:
+ case OptionParser::eNoArgument:
break;
- case required_argument:
+ case OptionParser::eRequiredArgument:
strm.Printf (" <%s>", CommandObject::GetArgumentName (opt_def.argument_type));
break;
- case optional_argument:
+ case OptionParser::eOptionalArgument:
strm.Printf ("%s[<%s>]",
show_short_option ? "" : "=",
CommandObject::GetArgumentName (opt_def.argument_type));
@@ -529,7 +529,7 @@ Options::GenerateOptionUsage
// Add current option to the end of out_stream.
if (opt_defs[i].required == true &&
- opt_defs[i].option_has_arg == no_argument)
+ opt_defs[i].option_has_arg == OptionParser::eNoArgument)
{
options.insert (opt_defs[i].short_option);
}
@@ -560,7 +560,7 @@ Options::GenerateOptionUsage
// Add current option to the end of out_stream.
if (opt_defs[i].required == false &&
- opt_defs[i].option_has_arg == no_argument)
+ opt_defs[i].option_has_arg == OptionParser::eNoArgument)
{
options.insert (opt_defs[i].short_option);
}
@@ -591,7 +591,7 @@ Options::GenerateOptionUsage
{
if (opt_defs[i].usage_mask & opt_set_mask && isprint8(opt_defs[i].short_option))
{
- if (opt_defs[i].required && opt_defs[i].option_has_arg != no_argument)
+ if (opt_defs[i].required && opt_defs[i].option_has_arg != OptionParser::eNoArgument)
PrintOption (opt_defs[i], eDisplayBestOption, " ", NULL, true, strm);
}
}
@@ -604,7 +604,7 @@ Options::GenerateOptionUsage
{
// Add current option to the end of out_stream.
- if (!opt_defs[i].required && opt_defs[i].option_has_arg != no_argument)
+ if (!opt_defs[i].required && opt_defs[i].option_has_arg != OptionParser::eNoArgument)
PrintOption (opt_defs[i], eDisplayBestOption, " ", NULL, true, strm);
}
}
@@ -992,6 +992,18 @@ OptionGroupOptions::Append (OptionGroup* group)
}
}
+const OptionGroup*
+OptionGroupOptions::GetGroupWithOption (char short_opt)
+{
+ for (uint32_t i = 0; i < m_option_defs.size(); i++)
+ {
+ OptionDefinition opt_def = m_option_defs[i];
+ if (opt_def.short_option == short_opt)
+ return m_option_infos[i].option_group;
+ }
+ return NULL;
+}
+
void
OptionGroupOptions::Append (OptionGroup* group,
uint32_t src_mask,
OpenPOWER on IntegriCloud