LLVM 24.0.0git
DarwinPlatform.cpp
Go to the documentation of this file.
1//===------ DarwinPlatform.cpp - Utilities for executing MachO in Orc -----===//
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
10
11#define DEBUG_TYPE "darwin_platform"
12
13namespace llvm::orc {
14
16public:
18
22
23 // FIXME: We should be tentatively tracking scraped sections and discarding
24 // if the MR fails.
28
32
34 ResourceKey SrcKey) override {}
35};
36
39 JITDylib &PlatformJD) {
40 Error Err = Error::success();
41 std::unique_ptr<DarwinPlatform> P(
42 new DarwinPlatform(ObjLinkingLayer, PlatformJD, Err));
43 if (Err)
44 return std::move(Err);
45 return std::move(P);
46}
47
48DarwinPlatform::DarwinPlatform(ObjectLinkingLayer &ObjLinkingLayer,
49 JITDylib &PlatformJD, Error &Err)
50 : ObjLinkingLayer(ObjLinkingLayer) {
52 LLVM_DEBUG({ dbgs() << "Created DarwinPlatform\n"; });
53}
54
56
60
65
69
70} // namespace llvm::orc
#define _
#define G(x, y, z)
Definition MD5.cpp:55
#define P(N)
#define LLVM_DEBUG(...)
Definition Debug.h:119
Helper for Errors used as out-parameters.
Definition Error.h:1160
Lightweight error class with error context and mandatory checking.
Definition Error.h:159
static ErrorSuccess success()
Create a success value.
Definition Error.h:336
Tagged union holding either a T or a Error.
Definition Error.h:485
void notifyTransferringResources(JITDylib &JD, ResourceKey DstKey, ResourceKey SrcKey) override
void modifyPassConfig(MaterializationResponsibility &MR, jitlink::LinkGraph &G, jitlink::PassConfiguration &Config) override
DarwinPlatformPlugin(DarwinPlatform &DP)
Error notifyRemovingResources(JITDylib &JD, ResourceKey K) override
Error notifyFailed(MaterializationResponsibility &MR) override
Mediates between Darwin and ExecutionSession state.
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
Plugin instances can be added to the ObjectLinkingLayer to receive callbacks when code is loaded or e...
Tracks responsibility for materialization, and mediates interactions between MaterializationUnits and...
Definition Core.h:343
A MaterializationUnit represents a set of symbol definitions that can be materialized as a group,...
An ObjectLayer implementation built on JITLink.
API to remove / transfer ownership of JIT resources.
Definition Core.h:65
uintptr_t ResourceKey
Definition Core.h:62
LLVM_ABI raw_ostream & dbgs()
dbgs() - This returns a reference to a raw_ostream for debugging messages.
Definition Debug.cpp:209