[lldb][NFC] Remove unused return value from HandleOptionArgumentCompletion

llvm-svn: 369635
This commit is contained in:
Raphael Isemann
2019-08-22 09:14:42 +00:00
parent 26f4262398
commit 494370c101
4 changed files with 12 additions and 24 deletions

View File

@@ -187,14 +187,7 @@ public:
///
/// \param[in] interpreter
/// The command interpreter doing the completion.
///
/// FIXME: This is the wrong return value, since we also need to
/// make a distinction between total number of matches, and the window the
/// user wants returned.
///
/// \return
/// \btrue if we were in an option, \bfalse otherwise.
virtual bool
virtual void
HandleOptionArgumentCompletion(lldb_private::CompletionRequest &request,
OptionElementVector &opt_element_vector,
int opt_element_index,

View File

@@ -1432,7 +1432,7 @@ public:
return llvm::makeArrayRef(g_platform_process_attach_options);
}
bool HandleOptionArgumentCompletion(
void HandleOptionArgumentCompletion(
CompletionRequest &request, OptionElementVector &opt_element_vector,
int opt_element_index, CommandInterpreter &interpreter) override {
int opt_arg_pos = opt_element_vector[opt_element_index].opt_arg_pos;
@@ -1442,7 +1442,7 @@ public:
// Are we in the name?
if (GetDefinitions()[opt_defs_index].short_option != 'n')
return false;
return;
// Look to see if there is a -P argument provided, and if so use that
// plugin, otherwise use the default plugin.
@@ -1452,7 +1452,7 @@ public:
PlatformSP platform_sp(interpreter.GetPlatform(true));
if (!platform_sp)
return false;
return;
ProcessInstanceInfoList process_infos;
ProcessInstanceInfoMatch match_info;
@@ -1464,14 +1464,14 @@ public:
platform_sp->FindProcesses(match_info, process_infos);
const uint32_t num_matches = process_infos.GetSize();
if (num_matches == 0)
return false;
return;
for (uint32_t i = 0; i < num_matches; ++i) {
request.AddCompletion(
llvm::StringRef(process_infos.GetProcessNameAtIndex(i),
process_infos.GetProcessNameLengthAtIndex(i)));
}
return false;
return;
}
// Options table: Required for subclasses of Options.

View File

@@ -320,7 +320,7 @@ public:
return llvm::makeArrayRef(g_process_attach_options);
}
bool HandleOptionArgumentCompletion(
void HandleOptionArgumentCompletion(
CompletionRequest &request, OptionElementVector &opt_element_vector,
int opt_element_index, CommandInterpreter &interpreter) override {
int opt_arg_pos = opt_element_vector[opt_element_index].opt_arg_pos;
@@ -330,7 +330,7 @@ public:
// Are we in the name?
if (GetDefinitions()[opt_defs_index].short_option != 'n')
return false;
return;
// Look to see if there is a -P argument provided, and if so use that
// plugin, otherwise use the default plugin.
@@ -340,7 +340,7 @@ public:
PlatformSP platform_sp(interpreter.GetPlatform(true));
if (!platform_sp)
return false;
return;
ProcessInstanceInfoList process_infos;
ProcessInstanceInfoMatch match_info;
if (partial_name) {
@@ -351,14 +351,12 @@ public:
platform_sp->FindProcesses(match_info, process_infos);
const size_t num_matches = process_infos.GetSize();
if (num_matches == 0)
return false;
return;
for (size_t i = 0; i < num_matches; ++i) {
request.AddCompletion(
llvm::StringRef(process_infos.GetProcessNameAtIndex(i),
process_infos.GetProcessNameLengthAtIndex(i)));
}
return false;
}
// Instance variables to hold the values for command options.

View File

@@ -751,7 +751,7 @@ bool Options::HandleOptionCompletion(CompletionRequest &request,
return false;
}
bool Options::HandleOptionArgumentCompletion(
void Options::HandleOptionArgumentCompletion(
CompletionRequest &request, OptionElementVector &opt_element_vector,
int opt_element_index, CommandInterpreter &interpreter) {
auto opt_defs = GetDefinitions();
@@ -764,7 +764,6 @@ bool Options::HandleOptionArgumentCompletion(
const auto &enum_values = opt_defs[opt_defs_index].enum_values;
if (!enum_values.empty()) {
bool return_value = false;
std::string match_string(
request.GetParsedLine().GetArgumentAtIndex(opt_arg_pos),
request.GetParsedLine().GetArgumentAtIndex(opt_arg_pos) +
@@ -774,10 +773,8 @@ bool Options::HandleOptionArgumentCompletion(
if (strstr(enum_value.string_value, match_string.c_str()) ==
enum_value.string_value) {
request.AddCompletion(enum_value.string_value);
return_value = true;
}
}
return return_value;
}
// If this is a source file or symbol type completion, and there is a -shlib
@@ -833,7 +830,7 @@ bool Options::HandleOptionArgumentCompletion(
}
}
return CommandCompletions::InvokeCommonCompletionCallbacks(
CommandCompletions::InvokeCommonCompletionCallbacks(
interpreter, completion_mask, request, filter_up.get());
}