Raphael Isemann | 8081428 | 2020-01-24 08:23:27 +0100 | [diff] [blame] | 1 | //===-- JITLoader.cpp -----------------------------------------------------===// |
Andrew MacPherson | 17220c1 | 2014-03-05 10:12:43 +0000 | [diff] [blame] | 2 | // |
Chandler Carruth | 2946cd7 | 2019-01-19 08:50:56 +0000 | [diff] [blame] | 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 |
Andrew MacPherson | 17220c1 | 2014-03-05 10:12:43 +0000 | [diff] [blame] | 6 | // |
| 7 | //===----------------------------------------------------------------------===// |
| 8 | |
Andrew MacPherson | 17220c1 | 2014-03-05 10:12:43 +0000 | [diff] [blame] | 9 | #include "lldb/Target/JITLoader.h" |
Kate Stone | b9c1b51 | 2016-09-06 20:57:50 +0000 | [diff] [blame] | 10 | #include "lldb/Core/PluginManager.h" |
Andrew MacPherson | 17220c1 | 2014-03-05 10:12:43 +0000 | [diff] [blame] | 11 | #include "lldb/Target/JITLoaderList.h" |
| 12 | #include "lldb/Target/Process.h" |
Kate Stone | b9c1b51 | 2016-09-06 20:57:50 +0000 | [diff] [blame] | 13 | #include "lldb/lldb-private.h" |
Andrew MacPherson | 17220c1 | 2014-03-05 10:12:43 +0000 | [diff] [blame] | 14 | |
| 15 | using namespace lldb; |
| 16 | using namespace lldb_private; |
| 17 | |
Kate Stone | b9c1b51 | 2016-09-06 20:57:50 +0000 | [diff] [blame] | 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(std::move(instance_sp)); |
| 27 | } |
Andrew MacPherson | 17220c1 | 2014-03-05 10:12:43 +0000 | [diff] [blame] | 28 | } |
| 29 | |
Kate Stone | b9c1b51 | 2016-09-06 20:57:50 +0000 | [diff] [blame] | 30 | JITLoader::JITLoader(Process *process) : m_process(process) {} |
Andrew MacPherson | 17220c1 | 2014-03-05 10:12:43 +0000 | [diff] [blame] | 31 | |
Eugene Zelenko | 9394d772 | 2016-02-18 00:10:17 +0000 | [diff] [blame] | 32 | JITLoader::~JITLoader() = default; |