[CommandInterpreter] Remove scripting language argument. (NFC)
authorJonas Devlieghere <jonas@devlieghere.com>
Fri, 26 Apr 2019 20:03:22 +0000 (20:03 +0000)
committerJonas Devlieghere <jonas@devlieghere.com>
Fri, 26 Apr 2019 20:03:22 +0000 (20:03 +0000)
The script language argument was passed from the debugger to the command
interpreter, only to call SetScriptLanguage on the debugger again. It
wasn't even used to initialize the script interpreter, because that
would query the debugger again. This patch removes the needless back and
forth.

llvm-svn: 359346

lldb/include/lldb/Interpreter/CommandInterpreter.h
lldb/source/Core/Debugger.cpp
lldb/source/Interpreter/CommandInterpreter.cpp

index a1805e8..e17fc35 100644 (file)
@@ -188,8 +188,7 @@ public:
     eCommandTypesAllThem = 0xFFFF  // all commands
   };
 
-  CommandInterpreter(Debugger &debugger, lldb::ScriptLanguage script_language,
-                     bool synchronous_execution);
+  CommandInterpreter(Debugger &debugger, bool synchronous_execution);
 
   ~CommandInterpreter() override;
 
@@ -372,8 +371,6 @@ public:
 
   void Clear();
 
-  void SetScriptLanguage(lldb::ScriptLanguage lang);
-
   bool HasCommands() const;
 
   bool HasAliases() const;
index 3ff9232..9c56905 100644 (file)
@@ -765,8 +765,8 @@ Debugger::Debugger(lldb::LogOutputCallback log_callback, void *baton)
       m_terminal_state(), m_target_list(*this), m_platform_list(),
       m_listener_sp(Listener::MakeListener("lldb.Debugger")),
       m_source_manager_up(), m_source_file_cache(),
-      m_command_interpreter_up(llvm::make_unique<CommandInterpreter>(
-          *this, eScriptLanguageDefault, false)),
+      m_command_interpreter_up(
+          llvm::make_unique<CommandInterpreter>(*this, false)),
       m_input_reader_stack(), m_instance_name(), m_loaded_plugins(),
       m_event_handler_thread(), m_io_handler_thread(),
       m_sync_broadcaster(nullptr, "lldb.debugger.sync"),
index 8470715..35596c8 100644 (file)
@@ -122,7 +122,6 @@ ConstString &CommandInterpreter::GetStaticBroadcasterClass() {
 }
 
 CommandInterpreter::CommandInterpreter(Debugger &debugger,
-                                       ScriptLanguage script_language,
                                        bool synchronous_execution)
     : Broadcaster(debugger.GetBroadcasterManager(),
                   CommandInterpreter::GetStaticBroadcasterClass().AsCString()),
@@ -135,7 +134,6 @@ CommandInterpreter::CommandInterpreter(Debugger &debugger,
       m_batch_command_mode(false), m_truncation_warning(eNoTruncation),
       m_command_source_depth(0), m_num_errors(0), m_quit_requested(false),
       m_stopped_for_crash(false) {
-  debugger.SetScriptLanguage(script_language);
   SetEventName(eBroadcastBitThreadShouldExit, "thread-should-exit");
   SetEventName(eBroadcastBitResetPrompt, "reset-prompt");
   SetEventName(eBroadcastBitQuitCommandReceived, "quit");