blob: 8ff349e063b6241e19a93bc4540f48499fe6fffe [file] [log] [blame]
Raphael Isemann80814282020-01-24 08:23:27 +01001//===-- JITLoader.cpp -----------------------------------------------------===//
Andrew MacPherson17220c12014-03-05 10:12:43 +00002//
Chandler Carruth2946cd72019-01-19 08:50:56 +00003// 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 MacPherson17220c12014-03-05 10:12:43 +00006//
7//===----------------------------------------------------------------------===//
8
Andrew MacPherson17220c12014-03-05 10:12:43 +00009#include "lldb/Target/JITLoader.h"
Kate Stoneb9c1b512016-09-06 20:57:50 +000010#include "lldb/Core/PluginManager.h"
Andrew MacPherson17220c12014-03-05 10:12:43 +000011#include "lldb/Target/JITLoaderList.h"
12#include "lldb/Target/Process.h"
Kate Stoneb9c1b512016-09-06 20:57:50 +000013#include "lldb/lldb-private.h"
Andrew MacPherson17220c12014-03-05 10:12:43 +000014
15using namespace lldb;
16using namespace lldb_private;
17
Kate Stoneb9c1b512016-09-06 20:57:50 +000018void 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 MacPherson17220c12014-03-05 10:12:43 +000028}
29
Kate Stoneb9c1b512016-09-06 20:57:50 +000030JITLoader::JITLoader(Process *process) : m_process(process) {}
Andrew MacPherson17220c12014-03-05 10:12:43 +000031
Eugene Zelenko9394d7722016-02-18 00:10:17 +000032JITLoader::~JITLoader() = default;