Skip to content

Commit

Permalink
Make Options::SetOptionValue take a StringRef.
Browse files Browse the repository at this point in the history
llvm-svn: 286723
  • Loading branch information
Zachary Turner committed Nov 12, 2016
1 parent c351fb1 commit fe11483
Show file tree
Hide file tree
Showing 31 changed files with 323 additions and 437 deletions.
6 changes: 2 additions & 4 deletions lldb/include/lldb/Interpreter/Options.h
Original file line number Diff line number Diff line change
Expand Up @@ -192,8 +192,7 @@ class Options {
/// @see Args::ParseOptions (Options&)
/// @see man getopt_long_only
//------------------------------------------------------------------
// TODO: Make this function take a StringRef.
virtual Error SetOptionValue(uint32_t option_idx, const char *option_arg,
virtual Error SetOptionValue(uint32_t option_idx, llvm::StringRef option_arg,
ExecutionContext *execution_context) = 0;

//------------------------------------------------------------------
Expand Down Expand Up @@ -344,7 +343,6 @@ class OptionGroup {
virtual Error SetOptionValue(uint32_t option_idx,
llvm::StringRef option_value,
ExecutionContext *execution_context) = 0;
Error SetOptionValue(uint32_t, const char *, ExecutionContext *) = delete;

virtual void OptionParsingStarting(ExecutionContext *execution_context) = 0;

Expand Down Expand Up @@ -403,7 +401,7 @@ class OptionGroupOptions : public Options {

bool DidFinalize() { return m_did_finalize; }

Error SetOptionValue(uint32_t option_idx, const char *option_arg,
Error SetOptionValue(uint32_t option_idx, llvm::StringRef option_arg,
ExecutionContext *execution_context) override;

void OptionParsingStarting(ExecutionContext *execution_context) override;
Expand Down
9 changes: 2 additions & 7 deletions lldb/include/lldb/Target/Process.h
Original file line number Diff line number Diff line change
Expand Up @@ -214,12 +214,7 @@ class ProcessAttachInfo : public ProcessInstanceInfo {
return (m_plugin_name.empty() ? nullptr : m_plugin_name.c_str());
}

void SetProcessPluginName(const char *plugin) {
if (plugin && plugin[0])
m_plugin_name.assign(plugin);
else
m_plugin_name.clear();
}
void SetProcessPluginName(llvm::StringRef plugin) { m_plugin_name = plugin; }

void Clear() {
ProcessInstanceInfo::Clear();
Expand Down Expand Up @@ -285,7 +280,7 @@ class ProcessLaunchCommandOptions : public Options {

~ProcessLaunchCommandOptions() override = default;

Error SetOptionValue(uint32_t option_idx, const char *option_arg,
Error SetOptionValue(uint32_t option_idx, llvm::StringRef option_arg,
ExecutionContext *execution_context) override;

void OptionParsingStarting(ExecutionContext *execution_context) override {
Expand Down
2 changes: 1 addition & 1 deletion lldb/include/lldb/Target/ProcessLaunchInfo.h
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ class ProcessLaunchInfo : public ProcessInfo {

const char *GetProcessPluginName() const;

void SetProcessPluginName(const char *plugin);
void SetProcessPluginName(llvm::StringRef plugin);

const FileSpec &GetShell() const;

Expand Down
2 changes: 1 addition & 1 deletion lldb/source/Commands/CommandObjectArgs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ CommandObjectArgs::CommandOptions::CommandOptions(
CommandObjectArgs::CommandOptions::~CommandOptions() = default;

Error CommandObjectArgs::CommandOptions::SetOptionValue(
uint32_t option_idx, const char *option_arg,
uint32_t option_idx, llvm::StringRef option_arg,
ExecutionContext *execution_context) {
Error error;

Expand Down
2 changes: 1 addition & 1 deletion lldb/source/Commands/CommandObjectArgs.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class CommandObjectArgs : public CommandObjectParsed {

~CommandOptions() override;

Error SetOptionValue(uint32_t option_idx, const char *option_arg,
Error SetOptionValue(uint32_t option_idx, llvm::StringRef option_arg,
ExecutionContext *execution_context) override;

void OptionParsingStarting(ExecutionContext *execution_context) override;
Expand Down

0 comments on commit fe11483

Please sign in to comment.