LLVM 24.0.0git
SimpleExecutorDylibManager.h
Go to the documentation of this file.
1//===--------------- SimpleExecutorDylibManager.h ---------------*- 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// A simple dynamic library management class. Allows dynamic libraries to be
10// loaded and searched.
11//
12// FIXME: The functionality in this file should be moved to the ORC runtime.
13//
14//===----------------------------------------------------------------------===//
15
16#ifndef LLVM_EXECUTIONENGINE_ORC_TARGETPROCESS_SIMPLEEXECUTORDYLIBMANAGER_H
17#define LLVM_EXECUTIONENGINE_ORC_TARGETPROCESS_SIMPLEEXECUTORDYLIBMANAGER_H
18
19#include "llvm/ADT/DenseSet.h"
30#include "llvm/Support/Error.h"
31
32#include <mutex>
33
34namespace llvm {
35namespace orc {
36namespace rt_bootstrap {
37
38/// Simple page-based allocator.
40public:
42
43 Expected<tpctypes::DylibHandle> open(const std::string &Path, uint64_t Mode);
44
47
48 Error shutdown() override;
50
51private:
52 using DylibSet = DenseSet<void *>;
53
55 openWrapper(const char *ArgData, size_t ArgSize);
56
58 resolveWrapper(const char *ArgData, size_t ArgSize);
59
60 std::mutex M;
61 DylibSet Dylibs;
62 std::vector<std::unique_ptr<ExecutorResolver>> Resolvers;
63};
64
65} // end namespace rt_bootstrap
66} // end namespace orc
67} // end namespace llvm
68
69#endif // LLVM_EXECUTIONENGINE_ORC_TARGETPROCESS_SIMPLEEXECUTORDYLIBMANAGER_H
unsigned uint64_t
#define LLVM_ABI
Definition Compiler.h:215
This file defines the DenseSet and SmallDenseSet classes.
static cl::opt< RegAllocEvictionAdvisorAnalysisLegacy::AdvisorMode > Mode("regalloc-enable-advisor", cl::Hidden, cl::init(RegAllocEvictionAdvisorAnalysisLegacy::AdvisorMode::Default), cl::desc("Enable regalloc advisor mode"), cl::values(clEnumValN(RegAllocEvictionAdvisorAnalysisLegacy::AdvisorMode::Default, "default", "Default"), clEnumValN(RegAllocEvictionAdvisorAnalysisLegacy::AdvisorMode::Release, "release", "precompiled"), clEnumValN(RegAllocEvictionAdvisorAnalysisLegacy::AdvisorMode::Development, "development", "for training")))
static int Lookup(ArrayRef< TableEntry > Table, unsigned Opcode)
Implements a dense probed hash-table based set.
Definition DenseSet.h:281
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
Interface for looking up the initializer for a variable name, used by Init::resolveReferences.
Definition Record.h:2269
StringMap - This is an unconventional map that is specialized for handling keys that are "strings",...
Definition StringMap.h:129
Represents an address in the executor process.
Expected< std::vector< std::optional< ExecutorAddr > > > ResolveResult
Expected< tpctypes::DylibHandle > open(const std::string &Path, uint64_t Mode)
void addBootstrapSymbols(StringMap< ExecutorAddr > &M) override
ExecutorResolver::ResolveResult resolve(ExecutorAddr Resolver, RemoteSymbolLookupSet Lookup)
std::vector< RemoteSymbolLookupSetElement > RemoteSymbolLookupSet
This is an optimization pass for GlobalISel generic memory operations.