Author: Pavel Labath Date: 2021-11-30T14:15:49+01:00 New Revision: a6e673643c44f94557fa09022a3c6edf76167871
URL: https://github.com/llvm/llvm-project/commit/a6e673643c44f94557fa09022a3c6edf76167871 DIFF: https://github.com/llvm/llvm-project/commit/a6e673643c44f94557fa09022a3c6edf76167871.diff LOG: [lldb] Inline Platform::LoadCachedExecutable into its (single) caller Added: Modified: lldb/include/lldb/Target/Platform.h lldb/source/Target/Platform.cpp Removed: ################################################################################ diff --git a/lldb/include/lldb/Target/Platform.h b/lldb/include/lldb/Target/Platform.h index e645e3ca95bee..26127359a3224 100644 --- a/lldb/include/lldb/Target/Platform.h +++ b/lldb/include/lldb/Target/Platform.h @@ -953,10 +953,6 @@ class Platform : public PluginInterface { bool GetCachedSharedModule(const ModuleSpec &module_spec, lldb::ModuleSP &module_sp, bool *did_create_ptr); - Status LoadCachedExecutable(const ModuleSpec &module_spec, - lldb::ModuleSP &module_sp, - const FileSpecList *module_search_paths_ptr); - FileSpec GetModuleCacheRoot(); }; diff --git a/lldb/source/Target/Platform.cpp b/lldb/source/Target/Platform.cpp index d75e11b0ab450..af5ca0225169f 100644 --- a/lldb/source/Target/Platform.cpp +++ b/lldb/source/Target/Platform.cpp @@ -1547,28 +1547,20 @@ Status Platform::GetCachedExecutable(ModuleSpec &module_spec, lldb::ModuleSP &module_sp, const FileSpecList *module_search_paths_ptr) { - const auto platform_spec = module_spec.GetFileSpec(); - const auto error = - LoadCachedExecutable(module_spec, module_sp, module_search_paths_ptr); - if (error.Success()) { - module_spec.GetFileSpec() = module_sp->GetFileSpec(); - module_spec.GetPlatformFileSpec() = platform_spec; - } - - return error; -} - -Status -Platform::LoadCachedExecutable(const ModuleSpec &module_spec, - lldb::ModuleSP &module_sp, - const FileSpecList *module_search_paths_ptr) { - return GetRemoteSharedModule( + FileSpec platform_spec = module_spec.GetFileSpec(); + Status error = GetRemoteSharedModule( module_spec, nullptr, module_sp, [&](const ModuleSpec &spec) { return ResolveRemoteExecutable(spec, module_sp, module_search_paths_ptr); }, nullptr); + if (error.Success()) { + module_spec.GetFileSpec() = module_sp->GetFileSpec(); + module_spec.GetPlatformFileSpec() = platform_spec; + } + + return error; } Status Platform::GetRemoteSharedModule(const ModuleSpec &module_spec, _______________________________________________ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits