blob: 2e37fb0ff4e6544c0209080b67849a89101f260c [file] [log] [blame]
Andrew MacPherson17220c12014-03-05 10:12:43 +00001//===-- JITLoader.cpp -------------------------------------------*- C++ -*-===//
2//
3// The LLVM Compiler Infrastructure
4//
5// This file is distributed under the University of Illinois Open Source
6// License. See LICENSE.TXT for details.
7//
8//===----------------------------------------------------------------------===//
9
Eugene Zelenko9394d7722016-02-18 00:10:17 +000010// C Includes
11// C++ Includes
12// Other libraries and framework includes
13// Project includes
Andrew MacPherson17220c12014-03-05 10:12:43 +000014#include "lldb/lldb-private.h"
15#include "lldb/Target/JITLoader.h"
16#include "lldb/Target/JITLoaderList.h"
17#include "lldb/Target/Process.h"
18#include "lldb/Core/PluginManager.h"
19
20using namespace lldb;
21using namespace lldb_private;
22
23void
24JITLoader::LoadPlugins (Process *process, JITLoaderList &list)
25{
Eugene Zelenko9394d7722016-02-18 00:10:17 +000026 JITLoaderCreateInstance create_callback = nullptr;
27 for (uint32_t idx = 0; (create_callback = PluginManager::GetJITLoaderCreateCallbackAtIndex(idx)) != nullptr; ++idx)
Andrew MacPherson17220c12014-03-05 10:12:43 +000028 {
29 JITLoaderSP instance_sp(create_callback(process, false));
30 if (instance_sp)
31 list.Append(std::move(instance_sp));
32 }
33}
34
35JITLoader::JITLoader(Process *process) :
36 m_process (process)
37{
38}
39
Eugene Zelenko9394d7722016-02-18 00:10:17 +000040JITLoader::~JITLoader() = default;