summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJonas Devlieghere <jonas@devlieghere.com>2019-12-18 16:42:07 -0800
committerJonas Devlieghere <jonas@devlieghere.com>2019-12-18 16:46:38 -0800
commit56ab485a311d065f9417e0cff903e1f33495f4cc (patch)
tree466fcbdc23d995aef79a476203870b966a6821ac
parent07b8f8e5f5cad9c4d92c39a4bea50e21e9f0e9f1 (diff)
downloadbcm5719-llvm-56ab485a311d065f9417e0cff903e1f33495f4cc.tar.gz
bcm5719-llvm-56ab485a311d065f9417e0cff903e1f33495f4cc.zip
[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.
-rw-r--r--lldb/source/Interpreter/CommandObjectScript.cpp14
1 files changed, 3 insertions, 11 deletions
diff --git a/lldb/source/Interpreter/CommandObjectScript.cpp b/lldb/source/Interpreter/CommandObjectScript.cpp
index fe365a5496f..d61d0cac976 100644
--- a/lldb/source/Interpreter/CommandObjectScript.cpp
+++ b/lldb/source/Interpreter/CommandObjectScript.cpp
@@ -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
}
OpenPOWER on IntegriCloud