LLVM 24.0.0git
DarwinPlatform.h
Go to the documentation of this file.
1//===--DarwinPlatform.h - Utilities for executing MachO in Orc --*- C++ -*-===//
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// Utilities for executing JIT'd MachO in Orc.
10//
11//===----------------------------------------------------------------------===//
12
13#ifndef LLVM_EXECUTIONENGINE_ORC_DARWINPLATFORM_H
14#define LLVM_EXECUTIONENGINE_ORC_DARWINPLATFORM_H
15
18#include "llvm/Support/Error.h"
19
20namespace llvm::orc {
21
23
24/// Mediates between Darwin and ExecutionSession state.
25class LLVM_ABI DarwinPlatform : public Platform {
26public:
28 Create(ObjectLinkingLayer &ObjLinkingLayer, JITDylib &PlatformJD);
29
30 Error setupJITDylib(JITDylib &JD) override;
31
32 Error teardownJITDylib(JITDylib &JD) override;
34 const MaterializationUnit &MU) override;
36
37private:
38 class LLVM_ABI DarwinPlatformPlugin;
39
40 DarwinPlatform(ObjectLinkingLayer &ObjLinkingLayer, JITDylib &PlatformJD,
41 Error &Err);
42
43 ObjectLinkingLayer &ObjLinkingLayer;
44};
45
46} // namespace llvm::orc
47
48#endif // LLVM_EXECUTIONENGINE_ORC_DARWINPLATFORM_H
#define LLVM_ABI
Definition Compiler.h:211
Lightweight error class with error context and mandatory checking.
Definition Error.h:159
Tagged union holding either a T or a Error.
Definition Error.h:485
Error teardownJITDylib(JITDylib &JD) override
This method will be called outside the session lock each time a JITDylib is removed to allow the Plat...
static Expected< std::unique_ptr< DarwinPlatform > > Create(ObjectLinkingLayer &ObjLinkingLayer, JITDylib &PlatformJD)
Error setupJITDylib(JITDylib &JD) override
This method will be called outside the session lock each time a JITDylib is created (unless it is cre...
Error notifyAdding(ResourceTracker &RT, const MaterializationUnit &MU) override
This method will be called under the ExecutionSession lock each time a MaterializationUnit is added t...
Error notifyRemoving(ResourceTracker &RT) override
This method will be called under the ExecutionSession lock when a ResourceTracker is removed.
Represents a JIT'd dynamic library.
Definition Core.h:668
A MaterializationUnit represents a set of symbol definitions that can be materialized as a group,...
An ObjectLayer implementation built on JITLink.
Platforms set up standard symbols and mediate interactions between dynamic initializers (e....
Definition Core.h:1023
API to remove / transfer ownership of JIT resources.
Definition Core.h:65