forked from OSchip/llvm-project
[lldb/Scripting] Simplify code by removing the #if.
The "none" script interpreter does not depend on Python so it doesn't make sense to have it withing the if-block. The only goal seems to be to have a slightly different error for when there's no script interpreter, but as per the comment this doesn't make sense for more than one scripting language. I think the existing error is perfectly clear, so I just removed this altogether.
This commit is contained in:
parent
07b8f8e5f5
commit
56ab485a31
|
@ -32,7 +32,6 @@ CommandObjectScript::~CommandObjectScript() {}
|
|||
|
||||
bool CommandObjectScript::DoExecute(llvm::StringRef command,
|
||||
CommandReturnObject &result) {
|
||||
#if LLDB_ENABLE_PYTHON
|
||||
if (m_interpreter.GetDebugger().GetScriptLanguage() ==
|
||||
lldb::eScriptLanguageNone) {
|
||||
result.AppendError(
|
||||
|
@ -49,9 +48,9 @@ bool CommandObjectScript::DoExecute(llvm::StringRef command,
|
|||
return false;
|
||||
}
|
||||
|
||||
DataVisualization::ForceUpdate(); // script might change Python code we use
|
||||
// for formatting.. make sure we keep up to
|
||||
// date with it
|
||||
// Script might change Python code we use for formatting. Make sure we keep
|
||||
// up to date with it.
|
||||
DataVisualization::ForceUpdate();
|
||||
|
||||
if (command.empty()) {
|
||||
script_interpreter->ExecuteInterpreterLoop();
|
||||
|
@ -66,11 +65,4 @@ bool CommandObjectScript::DoExecute(llvm::StringRef command,
|
|||
result.SetStatus(eReturnStatusFailed);
|
||||
|
||||
return result.Succeeded();
|
||||
#else
|
||||
// if we ever support languages other than Python this simple #ifdef won't
|
||||
// work
|
||||
result.AppendError("your copy of LLDB does not support scripting.");
|
||||
result.SetStatus(eReturnStatusFailed);
|
||||
return false;
|
||||
#endif
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue