LLVM 23.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"
29#include "llvm/Support/Error.h"
30
31#include <mutex>
32
33namespace llvm {
34namespace orc {
35namespace rt_bootstrap {
36
37/// Simple page-based allocator.
39public:
41
42 Expected<tpctypes::DylibHandle> open(const std::string &Path, uint64_t Mode);
43
46
47 Error shutdown() override;
49
50private:
51 using DylibSet = DenseSet<void *>;
52
54 openWrapper(const char *ArgData, size_t ArgSize);
55
57 resolveWrapper(const char *ArgData, size_t ArgSize);
58
59 std::mutex M;
60 DylibSet Dylibs;
61 std::vector<std::unique_ptr<ExecutorResolver>> Resolvers;
62};
63
64} // end namespace rt_bootstrap
65} // end namespace orc
66} // end namespace llvm
67
68#endif // LLVM_EXECUTIONENGINE_ORC_TARGETPROCESS_SIMPLEEXECUTORDYLIBMANAGER_H
#define LLVM_ABI
Definition Compiler.h:213
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:289
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:2202
StringMap - This is an unconventional map that is specialized for handling keys that are "strings",...
Definition StringMap.h:133
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.