diff options
author | Zachary Turner <zturner@google.com> | 2016-10-05 21:14:38 +0000 |
---|---|---|
committer | Zachary Turner <zturner@google.com> | 2016-10-05 21:14:38 +0000 |
commit | a449698cdc52af553523e0364e2759949b155843 (patch) | |
tree | 9f11fdb58b0581c76c514a326bc08fa44d68f676 /lldb/source/Commands | |
parent | f997759aef281363c6209b6bb3ddc737188b8931 (diff) | |
download | bcm5719-llvm-a449698cdc52af553523e0364e2759949b155843.tar.gz bcm5719-llvm-a449698cdc52af553523e0364e2759949b155843.zip |
Convert CommandObject constructors to StringRef.
llvm-svn: 283384
Diffstat (limited to 'lldb/source/Commands')
-rw-r--r-- | lldb/source/Commands/CommandObjectArgs.cpp | 1 | ||||
-rw-r--r-- | lldb/source/Commands/CommandObjectCommands.cpp | 17 | ||||
-rw-r--r-- | lldb/source/Commands/CommandObjectExpression.cpp | 2 | ||||
-rw-r--r-- | lldb/source/Commands/CommandObjectHelp.cpp | 2 | ||||
-rw-r--r-- | lldb/source/Commands/CommandObjectMultiword.cpp | 2 | ||||
-rw-r--r-- | lldb/source/Commands/CommandObjectSettings.cpp | 18 | ||||
-rw-r--r-- | lldb/source/Commands/CommandObjectSource.cpp | 4 | ||||
-rw-r--r-- | lldb/source/Commands/CommandObjectSyntax.cpp | 2 | ||||
-rw-r--r-- | lldb/source/Commands/CommandObjectType.cpp | 2 | ||||
-rw-r--r-- | lldb/source/Commands/CommandObjectWatchpoint.cpp | 2 |
10 files changed, 22 insertions, 30 deletions
diff --git a/lldb/source/Commands/CommandObjectArgs.cpp b/lldb/source/Commands/CommandObjectArgs.cpp index caf09974aa5..694913943bf 100644 --- a/lldb/source/Commands/CommandObjectArgs.cpp +++ b/lldb/source/Commands/CommandObjectArgs.cpp @@ -148,7 +148,6 @@ bool CommandObjectArgs::DoExecute(Args &args, CommandReturnObject &result) { value.SetValueType(Value::eValueTypeScalar); CompilerType compiler_type; - llvm::StringRef int_type = arg_type; std::size_t int_pos = arg_type.find("int"); if (int_pos != llvm::StringRef::npos) { Encoding encoding = eEncodingSint; diff --git a/lldb/source/Commands/CommandObjectCommands.cpp b/lldb/source/Commands/CommandObjectCommands.cpp index 0c07fd81035..c24e05d0eec 100644 --- a/lldb/source/Commands/CommandObjectCommands.cpp +++ b/lldb/source/Commands/CommandObjectCommands.cpp @@ -337,7 +337,7 @@ protected: } else { result.AppendErrorWithFormat( "'%s' takes exactly one executable filename argument.\n", - GetCommandName()); + GetCommandName().str().c_str()); result.SetStatus(eReturnStatusFailed); } return result.Succeeded(); @@ -421,8 +421,7 @@ public: CommandObjectCommandsAlias(CommandInterpreter &interpreter) : CommandObjectRaw( interpreter, "command alias", - "Define a custom command in terms of an existing command.", - nullptr), + "Define a custom command in terms of an existing command."), m_option_group(), m_command_options() { m_option_group.Append(&m_command_options); m_option_group.Finalize(); @@ -737,7 +736,7 @@ protected: result.SetStatus(eReturnStatusFailed); } else { CommandObjectSP command_obj_sp( - m_interpreter.GetCommandSPExact(actual_command.c_str(), true)); + m_interpreter.GetCommandSPExact(actual_command, true)); CommandObjectSP subcommand_obj_sp; bool use_subcommand = false; if (command_obj_sp) { @@ -748,7 +747,7 @@ protected: while (cmd_obj->IsMultiwordObject() && !args.empty()) { if (argc >= 3) { - llvm::StringRef sub_command = args.GetArgumentAtIndex(0); + const std::string sub_command = args.GetArgumentAtIndex(0); assert(!sub_command.empty()); subcommand_obj_sp = cmd_obj->GetSubcommandSP(sub_command.data()); if (subcommand_obj_sp) { @@ -761,7 +760,7 @@ protected: result.AppendErrorWithFormat( "'%s' is not a valid sub-command of '%s'. " "Unable to create alias.\n", - sub_command.data(), actual_command.c_str()); + sub_command.c_str(), actual_command.c_str()); result.SetStatus(eReturnStatusFailed); return false; } @@ -934,7 +933,7 @@ protected: if (args.empty()) { result.AppendErrorWithFormat("must call '%s' with one or more valid user " "defined regular expression command names", - GetCommandName()); + GetCommandName().str().c_str()); result.SetStatus(eReturnStatusFailed); } @@ -1288,7 +1287,7 @@ public: CommandObjectPythonFunction(CommandInterpreter &interpreter, std::string name, std::string funct, std::string help, ScriptedCommandSynchronicity synch) - : CommandObjectRaw(interpreter, name.c_str(), nullptr, nullptr), + : CommandObjectRaw(interpreter, name), m_function_name(funct), m_synchro(synch), m_fetched_help_long(false) { if (!help.empty()) SetHelp(help.c_str()); @@ -1362,7 +1361,7 @@ public: std::string name, StructuredData::GenericSP cmd_obj_sp, ScriptedCommandSynchronicity synch) - : CommandObjectRaw(interpreter, name.c_str(), nullptr, nullptr), + : CommandObjectRaw(interpreter, name), m_cmd_obj_sp(cmd_obj_sp), m_synchro(synch), m_fetched_help_short(false), m_fetched_help_long(false) { StreamString stream; diff --git a/lldb/source/Commands/CommandObjectExpression.cpp b/lldb/source/Commands/CommandObjectExpression.cpp index b0f73528de2..80f20a389f3 100644 --- a/lldb/source/Commands/CommandObjectExpression.cpp +++ b/lldb/source/Commands/CommandObjectExpression.cpp @@ -220,7 +220,7 @@ CommandObjectExpression::CommandObjectExpression( interpreter, "expression", "Evaluate an expression on the current " "thread. Displays any returned value " "with LLDB's default formatting.", - nullptr, eCommandProcessMustBePaused | eCommandTryTargetAPILock), + "", eCommandProcessMustBePaused | eCommandTryTargetAPILock), IOHandlerDelegate(IOHandlerDelegate::Completion::Expression), m_option_group(), m_format_options(eFormatDefault), m_repl_option(LLDB_OPT_SET_1, false, "repl", 'r', "Drop into REPL", false, diff --git a/lldb/source/Commands/CommandObjectHelp.cpp b/lldb/source/Commands/CommandObjectHelp.cpp index d03b5cd7d17..1495e93baf9 100644 --- a/lldb/source/Commands/CommandObjectHelp.cpp +++ b/lldb/source/Commands/CommandObjectHelp.cpp @@ -166,7 +166,7 @@ bool CommandObjectHelp::DoExecute(Args &command, CommandReturnObject &result) { m_interpreter.GetCommandPrefix(), sub_command.c_str()); result.GetOutputStream().Printf( "\nThe closest match is '%s'. Help on it follows.\n\n", - sub_cmd_obj->GetCommandName()); + sub_cmd_obj->GetCommandName().str().c_str()); } } diff --git a/lldb/source/Commands/CommandObjectMultiword.cpp b/lldb/source/Commands/CommandObjectMultiword.cpp index 80d64193e64..9194b1d5103 100644 --- a/lldb/source/Commands/CommandObjectMultiword.cpp +++ b/lldb/source/Commands/CommandObjectMultiword.cpp @@ -143,7 +143,7 @@ bool CommandObjectMultiword::Execute(const char *args_string, } } else { result.AppendErrorWithFormat("'%s' does not have any subcommands.\n", - GetCommandName()); + GetCommandName().str().c_str()); result.SetStatus(eReturnStatusFailed); } } diff --git a/lldb/source/Commands/CommandObjectSettings.cpp b/lldb/source/Commands/CommandObjectSettings.cpp index f31e242618f..9c7493a6b55 100644 --- a/lldb/source/Commands/CommandObjectSettings.cpp +++ b/lldb/source/Commands/CommandObjectSettings.cpp @@ -37,8 +37,7 @@ class CommandObjectSettingsSet : public CommandObjectRaw { public: CommandObjectSettingsSet(CommandInterpreter &interpreter) : CommandObjectRaw(interpreter, "settings set", - "Set the value of the specified debugger setting.", - nullptr), + "Set the value of the specified debugger setting."), m_options() { CommandArgumentEntry arg1; CommandArgumentEntry arg2; @@ -409,8 +408,7 @@ public: CommandObjectSettingsRemove(CommandInterpreter &interpreter) : CommandObjectRaw(interpreter, "settings remove", "Remove a value from a setting, specified by array " - "index or dictionary key.", - nullptr) { + "index or dictionary key.") { CommandArgumentEntry arg1; CommandArgumentEntry arg2; CommandArgumentData var_name_arg; @@ -517,8 +515,7 @@ public: CommandObjectSettingsReplace(CommandInterpreter &interpreter) : CommandObjectRaw(interpreter, "settings replace", "Replace the debugger setting value specified by " - "array index or dictionary key.", - nullptr) { + "array index or dictionary key.") { CommandArgumentEntry arg1; CommandArgumentEntry arg2; CommandArgumentEntry arg3; @@ -629,8 +626,7 @@ public: : CommandObjectRaw(interpreter, "settings insert-before", "Insert one or more values into an debugger array " "setting immediately before the specified element " - "index.", - nullptr) { + "index.") { CommandArgumentEntry arg1; CommandArgumentEntry arg2; CommandArgumentEntry arg3; @@ -741,8 +737,7 @@ public: CommandObjectSettingsInsertAfter(CommandInterpreter &interpreter) : CommandObjectRaw(interpreter, "settings insert-after", "Insert one or more values into a debugger array " - "settings after the specified element index.", - nullptr) { + "settings after the specified element index.") { CommandArgumentEntry arg1; CommandArgumentEntry arg2; CommandArgumentEntry arg3; @@ -853,8 +848,7 @@ public: CommandObjectSettingsAppend(CommandInterpreter &interpreter) : CommandObjectRaw(interpreter, "settings append", "Append one or more values to a debugger array, " - "dictionary, or string setting.", - nullptr) { + "dictionary, or string setting.") { CommandArgumentEntry arg1; CommandArgumentEntry arg2; CommandArgumentData var_name_arg; diff --git a/lldb/source/Commands/CommandObjectSource.cpp b/lldb/source/Commands/CommandObjectSource.cpp index 55e724aed73..b0231a7333e 100644 --- a/lldb/source/Commands/CommandObjectSource.cpp +++ b/lldb/source/Commands/CommandObjectSource.cpp @@ -585,7 +585,7 @@ protected: if (argc != 0) { result.AppendErrorWithFormat("'%s' takes no arguments, only flags.\n", - GetCommandName()); + GetCommandName().str().c_str()); result.SetStatus(eReturnStatusFailed); return false; } @@ -990,7 +990,7 @@ protected: if (argc != 0) { result.AppendErrorWithFormat("'%s' takes no arguments, only flags.\n", - GetCommandName()); + GetCommandName().str().c_str()); result.SetStatus(eReturnStatusFailed); return false; } diff --git a/lldb/source/Commands/CommandObjectSyntax.cpp b/lldb/source/Commands/CommandObjectSyntax.cpp index 6594906bfbe..67dee8e7413 100644 --- a/lldb/source/Commands/CommandObjectSyntax.cpp +++ b/lldb/source/Commands/CommandObjectSyntax.cpp @@ -77,7 +77,7 @@ bool CommandObjectSyntax::DoExecute(Args &command, output_strm.Printf("\nSyntax: %s\n", cmd_obj->GetSyntax()); output_strm.Printf( "(Try 'help %s' for more information on command options syntax.)\n", - cmd_obj->GetCommandName()); + cmd_obj->GetCommandName().str().c_str()); result.SetStatus(eReturnStatusSuccessFinishNoResult); } else { output_strm.Printf("\nSyntax: %s\n", cmd_obj->GetSyntax()); diff --git a/lldb/source/Commands/CommandObjectType.cpp b/lldb/source/Commands/CommandObjectType.cpp index c2747fd1bd2..16b894f880f 100644 --- a/lldb/source/Commands/CommandObjectType.cpp +++ b/lldb/source/Commands/CommandObjectType.cpp @@ -3026,7 +3026,7 @@ public: CommandObjectFormatterInfo(CommandInterpreter &interpreter, const char *formatter_name, DiscoveryFunction discovery_func) - : CommandObjectRaw(interpreter, nullptr, nullptr, nullptr, + : CommandObjectRaw(interpreter, "", "", "", eCommandRequiresFrame), m_formatter_name(formatter_name ? formatter_name : ""), m_discovery_function(discovery_func) { diff --git a/lldb/source/Commands/CommandObjectWatchpoint.cpp b/lldb/source/Commands/CommandObjectWatchpoint.cpp index 8e3f8e2ef56..342913fc009 100644 --- a/lldb/source/Commands/CommandObjectWatchpoint.cpp +++ b/lldb/source/Commands/CommandObjectWatchpoint.cpp @@ -990,7 +990,7 @@ public: "If watchpoint setting fails, consider disable/delete existing " "ones " "to free up resources.", - nullptr, + "", eCommandRequiresFrame | eCommandTryTargetAPILock | eCommandProcessMustBeLaunched | eCommandProcessMustBePaused), m_option_group(), m_option_watchpoint() { |