diff options
author | Greg Clayton <gclayton@apple.com> | 2013-03-23 00:50:58 +0000 |
---|---|---|
committer | Greg Clayton <gclayton@apple.com> | 2013-03-23 00:50:58 +0000 |
commit | b9d8890bd900416f562192608bdc72143801845b (patch) | |
tree | 13835983bffb318a527b65c15a15cec8837bfa23 /lldb/source/Core/Module.cpp | |
parent | 96b68669ebf712fb88aac10a2f12fa7fea0584cf (diff) | |
download | bcm5719-llvm-b9d8890bd900416f562192608bdc72143801845b.tar.gz bcm5719-llvm-b9d8890bd900416f562192608bdc72143801845b.zip |
Only get the script interpreter if we find scripting resources in the symbol file. This helps us avoid initializing python when it isn't needed.
llvm-svn: 177793
Diffstat (limited to 'lldb/source/Core/Module.cpp')
-rw-r--r-- | lldb/source/Core/Module.cpp | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/lldb/source/Core/Module.cpp b/lldb/source/Core/Module.cpp index 2341144132b..822fbd8f1c6 100644 --- a/lldb/source/Core/Module.cpp +++ b/lldb/source/Core/Module.cpp @@ -1196,15 +1196,15 @@ Module::LoadScriptingResourceInTarget (Target *target, Error& error) return false; } - ScriptInterpreter *script_interpreter = debugger.GetCommandInterpreter().GetScriptInterpreter(); - if (script_interpreter) + FileSpecList file_specs = platform_sp->LocateExecutableScriptingResources (target, + *this); + + + const uint32_t num_specs = file_specs.GetSize(); + if (num_specs) { - FileSpecList file_specs = platform_sp->LocateExecutableScriptingResources (target, - *this); - - - const uint32_t num_specs = file_specs.GetSize(); - if (num_specs) + ScriptInterpreter *script_interpreter = debugger.GetCommandInterpreter().GetScriptInterpreter(); + if (script_interpreter) { for (uint32_t i=0; i<num_specs; ++i) { @@ -1222,11 +1222,11 @@ Module::LoadScriptingResourceInTarget (Target *target, Error& error) } } } - } - else - { - error.SetErrorString("invalid ScriptInterpreter"); - return false; + else + { + error.SetErrorString("invalid ScriptInterpreter"); + return false; + } } } return true; |