| 1 | //===-- JITLoader.cpp -----------------------------------------------------===// |
|---|---|
| 2 | // |
| 3 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. |
| 4 | // See https://llvm.org/LICENSE.txt for license information. |
| 5 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception |
| 6 | // |
| 7 | //===----------------------------------------------------------------------===// |
| 8 | |
| 9 | #include "lldb/Target/JITLoader.h" |
| 10 | #include "lldb/Core/PluginManager.h" |
| 11 | #include "lldb/Target/JITLoaderList.h" |
| 12 | #include "lldb/Target/Process.h" |
| 13 | #include "lldb/lldb-private.h" |
| 14 | |
| 15 | using namespace lldb; |
| 16 | using namespace lldb_private; |
| 17 | |
| 18 | void JITLoader::LoadPlugins(Process *process, JITLoaderList &list) { |
| 19 | JITLoaderCreateInstance create_callback = nullptr; |
| 20 | for (uint32_t idx = 0; |
| 21 | (create_callback = |
| 22 | PluginManager::GetJITLoaderCreateCallbackAtIndex(idx)) != nullptr; |
| 23 | ++idx) { |
| 24 | JITLoaderSP instance_sp(create_callback(process, false)); |
| 25 | if (instance_sp) |
| 26 | list.Append(jit_loader_sp: std::move(instance_sp)); |
| 27 | } |
| 28 | } |
| 29 | |
| 30 | JITLoader::JITLoader(Process *process) : m_process(process) {} |
| 31 | |
| 32 | JITLoader::~JITLoader() = default; |
| 33 |
