diff options
author | Kate Stone <katherine.stone@apple.com> | 2016-09-06 20:57:50 +0000 |
---|---|---|
committer | Kate Stone <katherine.stone@apple.com> | 2016-09-06 20:57:50 +0000 |
commit | b9c1b51e45b845debb76d8658edabca70ca56079 (patch) | |
tree | dfcb5a13ef2b014202340f47036da383eaee74aa /lldb/source/Interpreter/OptionGroupVariable.cpp | |
parent | d5aa73376966339caad04013510626ec2e42c760 (diff) | |
download | bcm5719-llvm-b9c1b51e45b845debb76d8658edabca70ca56079.tar.gz bcm5719-llvm-b9c1b51e45b845debb76d8658edabca70ca56079.zip |
*** This commit represents a complete reformatting of the LLDB source code
*** to conform to clang-format’s LLVM style. This kind of mass change has
*** two obvious implications:
Firstly, merging this particular commit into a downstream fork may be a huge
effort. Alternatively, it may be worth merging all changes up to this commit,
performing the same reformatting operation locally, and then discarding the
merge for this particular commit. The commands used to accomplish this
reformatting were as follows (with current working directory as the root of
the repository):
find . \( -iname "*.c" -or -iname "*.cpp" -or -iname "*.h" -or -iname "*.mm" \) -exec clang-format -i {} +
find . -iname "*.py" -exec autopep8 --in-place --aggressive --aggressive {} + ;
The version of clang-format used was 3.9.0, and autopep8 was 1.2.4.
Secondly, “blame” style tools will generally point to this commit instead of
a meaningful prior commit. There are alternatives available that will attempt
to look through this change and find the appropriate prior commit. YMMV.
llvm-svn: 280751
Diffstat (limited to 'lldb/source/Interpreter/OptionGroupVariable.cpp')
-rw-r--r-- | lldb/source/Interpreter/OptionGroupVariable.cpp | 212 |
1 files changed, 110 insertions, 102 deletions
diff --git a/lldb/source/Interpreter/OptionGroupVariable.cpp b/lldb/source/Interpreter/OptionGroupVariable.cpp index 6ee71aed800..253a2ede151 100644 --- a/lldb/source/Interpreter/OptionGroupVariable.cpp +++ b/lldb/source/Interpreter/OptionGroupVariable.cpp @@ -22,121 +22,129 @@ using namespace lldb; using namespace lldb_private; -// if you add any options here, remember to update the counters in OptionGroupVariable::GetNumDefinitions() -static OptionDefinition -g_option_table[] = -{ - { LLDB_OPT_SET_1 | LLDB_OPT_SET_2, false, "no-args", 'a', OptionParser::eNoArgument, nullptr, nullptr, 0, eArgTypeNone, "Omit function arguments."}, - { LLDB_OPT_SET_1 | LLDB_OPT_SET_2, false, "no-locals", 'l', OptionParser::eNoArgument, nullptr, nullptr, 0, eArgTypeNone, "Omit local variables."}, - { LLDB_OPT_SET_1 | LLDB_OPT_SET_2, false, "show-globals", 'g', OptionParser::eNoArgument, nullptr, nullptr, 0, eArgTypeNone, "Show the current frame source file global and static variables."}, - { LLDB_OPT_SET_1 | LLDB_OPT_SET_2, false, "show-declaration",'c', OptionParser::eNoArgument, nullptr, nullptr, 0, eArgTypeNone, "Show variable declaration information (source file and line where the variable was declared)."}, - { LLDB_OPT_SET_1 | LLDB_OPT_SET_2, false, "regex", 'r', OptionParser::eNoArgument, nullptr, nullptr, 0, eArgTypeRegularExpression, "The <variable-name> argument for name lookups are regular expressions."}, - { LLDB_OPT_SET_1 | LLDB_OPT_SET_2, false, "scope", 's', OptionParser::eNoArgument, nullptr, nullptr, 0, eArgTypeNone, "Show variable scope (argument, local, global, static)."}, - { LLDB_OPT_SET_1, false, "summary", 'y', OptionParser::eRequiredArgument, nullptr, nullptr, 0, eArgTypeName, "Specify the summary that the variable output should use."}, - { LLDB_OPT_SET_2, false, "summary-string", 'z', OptionParser::eRequiredArgument, nullptr, nullptr, 0, eArgTypeName, "Specify a summary string to use to format the variable output."}, +// if you add any options here, remember to update the counters in +// OptionGroupVariable::GetNumDefinitions() +static OptionDefinition g_option_table[] = { + {LLDB_OPT_SET_1 | LLDB_OPT_SET_2, false, "no-args", 'a', + OptionParser::eNoArgument, nullptr, nullptr, 0, eArgTypeNone, + "Omit function arguments."}, + {LLDB_OPT_SET_1 | LLDB_OPT_SET_2, false, "no-locals", 'l', + OptionParser::eNoArgument, nullptr, nullptr, 0, eArgTypeNone, + "Omit local variables."}, + {LLDB_OPT_SET_1 | LLDB_OPT_SET_2, false, "show-globals", 'g', + OptionParser::eNoArgument, nullptr, nullptr, 0, eArgTypeNone, + "Show the current frame source file global and static variables."}, + {LLDB_OPT_SET_1 | LLDB_OPT_SET_2, false, "show-declaration", 'c', + OptionParser::eNoArgument, nullptr, nullptr, 0, eArgTypeNone, + "Show variable declaration information (source file and line where the " + "variable was declared)."}, + {LLDB_OPT_SET_1 | LLDB_OPT_SET_2, false, "regex", 'r', + OptionParser::eNoArgument, nullptr, nullptr, 0, eArgTypeRegularExpression, + "The <variable-name> argument for name lookups are regular expressions."}, + {LLDB_OPT_SET_1 | LLDB_OPT_SET_2, false, "scope", 's', + OptionParser::eNoArgument, nullptr, nullptr, 0, eArgTypeNone, + "Show variable scope (argument, local, global, static)."}, + {LLDB_OPT_SET_1, false, "summary", 'y', OptionParser::eRequiredArgument, + nullptr, nullptr, 0, eArgTypeName, + "Specify the summary that the variable output should use."}, + {LLDB_OPT_SET_2, false, "summary-string", 'z', + OptionParser::eRequiredArgument, nullptr, nullptr, 0, eArgTypeName, + "Specify a summary string to use to format the variable output."}, }; -static Error -ValidateNamedSummary (const char* str, void*) -{ - if (!str || !str[0]) - return Error("must specify a valid named summary"); - TypeSummaryImplSP summary_sp; - if (DataVisualization::NamedSummaryFormats::GetSummaryFormat(ConstString(str), summary_sp) == false) - return Error("must specify a valid named summary"); - return Error(); +static Error ValidateNamedSummary(const char *str, void *) { + if (!str || !str[0]) + return Error("must specify a valid named summary"); + TypeSummaryImplSP summary_sp; + if (DataVisualization::NamedSummaryFormats::GetSummaryFormat( + ConstString(str), summary_sp) == false) + return Error("must specify a valid named summary"); + return Error(); } -static Error -ValidateSummaryString (const char* str, void*) -{ - if (!str || !str[0]) - return Error("must specify a non-empty summary string"); - return Error(); +static Error ValidateSummaryString(const char *str, void *) { + if (!str || !str[0]) + return Error("must specify a non-empty summary string"); + return Error(); } -OptionGroupVariable::OptionGroupVariable (bool show_frame_options) : - OptionGroup(), - include_frame_options (show_frame_options), - summary(ValidateNamedSummary), - summary_string(ValidateSummaryString) -{ +OptionGroupVariable::OptionGroupVariable(bool show_frame_options) + : OptionGroup(), include_frame_options(show_frame_options), + summary(ValidateNamedSummary), summary_string(ValidateSummaryString) {} + +OptionGroupVariable::~OptionGroupVariable() {} + +Error OptionGroupVariable::SetOptionValue(uint32_t option_idx, + const char *option_arg, + ExecutionContext *execution_context) { + Error error; + if (!include_frame_options) + option_idx += 3; + const int short_option = g_option_table[option_idx].short_option; + switch (short_option) { + case 'r': + use_regex = true; + break; + case 'a': + show_args = false; + break; + case 'l': + show_locals = false; + break; + case 'g': + show_globals = true; + break; + case 'c': + show_decl = true; + break; + case 's': + show_scope = true; + break; + case 'y': + error = summary.SetCurrentValue(option_arg); + break; + case 'z': + error = summary_string.SetCurrentValue(option_arg); + break; + default: + error.SetErrorStringWithFormat("unrecognized short option '%c'", + short_option); + break; + } + + return error; } -OptionGroupVariable::~OptionGroupVariable () -{ -} - -Error -OptionGroupVariable::SetOptionValue(uint32_t option_idx, - const char *option_arg, - ExecutionContext *execution_context) -{ - Error error; - if (!include_frame_options) - option_idx += 3; - const int short_option = g_option_table[option_idx].short_option; - switch (short_option) - { - case 'r': use_regex = true; break; - case 'a': show_args = false; break; - case 'l': show_locals = false; break; - case 'g': show_globals = true; break; - case 'c': show_decl = true; break; - case 's': - show_scope = true; - break; - case 'y': - error = summary.SetCurrentValue(option_arg); - break; - case 'z': - error = summary_string.SetCurrentValue(option_arg); - break; - default: - error.SetErrorStringWithFormat("unrecognized short option '%c'", short_option); - break; - } - - return error; -} - -void -OptionGroupVariable::OptionParsingStarting(ExecutionContext *execution_context) -{ - show_args = true; // Frame option only - show_locals = true; // Frame option only - show_globals = false; // Frame option only - show_decl = false; - use_regex = false; - show_scope = false; - summary.Clear(); - summary_string.Clear(); +void OptionGroupVariable::OptionParsingStarting( + ExecutionContext *execution_context) { + show_args = true; // Frame option only + show_locals = true; // Frame option only + show_globals = false; // Frame option only + show_decl = false; + use_regex = false; + show_scope = false; + summary.Clear(); + summary_string.Clear(); } #define NUM_FRAME_OPTS 3 -const OptionDefinition* -OptionGroupVariable::GetDefinitions () -{ - // Show the "--no-args", "--no-locals" and "--show-globals" - // options if we are showing frame specific options - if (include_frame_options) - return g_option_table; +const OptionDefinition *OptionGroupVariable::GetDefinitions() { + // Show the "--no-args", "--no-locals" and "--show-globals" + // options if we are showing frame specific options + if (include_frame_options) + return g_option_table; - // Skip the "--no-args", "--no-locals" and "--show-globals" - // options if we are not showing frame specific options (globals only) - return &g_option_table[NUM_FRAME_OPTS]; + // Skip the "--no-args", "--no-locals" and "--show-globals" + // options if we are not showing frame specific options (globals only) + return &g_option_table[NUM_FRAME_OPTS]; } -uint32_t -OptionGroupVariable::GetNumDefinitions () -{ - // Count the "--no-args", "--no-locals" and "--show-globals" - // options if we are showing frame specific options. - if (include_frame_options) - return llvm::array_lengthof(g_option_table); - else - return llvm::array_lengthof(g_option_table) - NUM_FRAME_OPTS; +uint32_t OptionGroupVariable::GetNumDefinitions() { + // Count the "--no-args", "--no-locals" and "--show-globals" + // options if we are showing frame specific options. + if (include_frame_options) + return llvm::array_lengthof(g_option_table); + else + return llvm::array_lengthof(g_option_table) - NUM_FRAME_OPTS; } - - |