From 7a120c8b3df60a5da382f8f7baeaccdfa928bd5b Mon Sep 17 00:00:00 2001 From: Zachary Turner Date: Sun, 13 Nov 2016 03:05:58 +0000 Subject: [PATCH] Change IOHandlerConfirm to use StringRefs. llvm-svn: 286743 --- lldb/include/lldb/Core/IOHandler.h | 2 +- lldb/include/lldb/Interpreter/CommandInterpreter.h | 3 +-- lldb/source/Core/IOHandler.cpp | 2 +- lldb/source/Interpreter/CommandInterpreter.cpp | 2 +- 4 files changed, 4 insertions(+), 5 deletions(-) diff --git a/lldb/include/lldb/Core/IOHandler.h b/lldb/include/lldb/Core/IOHandler.h index 1ee815071c2a..2e6ff31ee687 100644 --- a/lldb/include/lldb/Core/IOHandler.h +++ b/lldb/include/lldb/Core/IOHandler.h @@ -458,7 +458,7 @@ protected: // to see how. class IOHandlerConfirm : public IOHandlerDelegate, public IOHandlerEditline { public: - IOHandlerConfirm(Debugger &debugger, const char *prompt, + IOHandlerConfirm(Debugger &debugger, llvm::StringRef prompt, bool default_response); ~IOHandlerConfirm() override; diff --git a/lldb/include/lldb/Interpreter/CommandInterpreter.h b/lldb/include/lldb/Interpreter/CommandInterpreter.h index 3bb62f9a8020..cad6fbb136c9 100644 --- a/lldb/include/lldb/Interpreter/CommandInterpreter.h +++ b/lldb/include/lldb/Interpreter/CommandInterpreter.h @@ -367,9 +367,8 @@ public: const char *ProcessEmbeddedScriptCommands(const char *arg); void UpdatePrompt(llvm::StringRef prompt); - void UpdatePrompt(const char *) = delete; - bool Confirm(const char *message, bool default_answer); + bool Confirm(llvm::StringRef message, bool default_answer); void LoadCommandDictionary(); diff --git a/lldb/source/Core/IOHandler.cpp b/lldb/source/Core/IOHandler.cpp index 39fdd13e32a8..315d20ed24bf 100644 --- a/lldb/source/Core/IOHandler.cpp +++ b/lldb/source/Core/IOHandler.cpp @@ -127,7 +127,7 @@ void IOHandlerStack::PrintAsync(Stream *stream, const char *s, size_t len) { } } -IOHandlerConfirm::IOHandlerConfirm(Debugger &debugger, const char *prompt, +IOHandlerConfirm::IOHandlerConfirm(Debugger &debugger, llvm::StringRef prompt, bool default_response) : IOHandlerEditline( debugger, IOHandler::Type::Confirm, diff --git a/lldb/source/Interpreter/CommandInterpreter.cpp b/lldb/source/Interpreter/CommandInterpreter.cpp index 89ef7fe77600..2243316232bb 100644 --- a/lldb/source/Interpreter/CommandInterpreter.cpp +++ b/lldb/source/Interpreter/CommandInterpreter.cpp @@ -1896,7 +1896,7 @@ void CommandInterpreter::UpdatePrompt(llvm::StringRef new_prompt) { m_command_io_handler_sp->SetPrompt(new_prompt); } -bool CommandInterpreter::Confirm(const char *message, bool default_answer) { +bool CommandInterpreter::Confirm(llvm::StringRef message, bool default_answer) { // Check AutoConfirm first: if (m_debugger.GetAutoConfirm()) return default_answer; -- 2.34.1