LLVM 22.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"
28#include "llvm/Support/Error.h"
29
30#include <mutex>
31
32namespace llvm {
33namespace orc {
34namespace rt_bootstrap {
35
36/// Simple page-based allocator.
38public:
40
41 Expected<tpctypes::DylibHandle> open(const std::string &Path, uint64_t Mode);
44
45 Error shutdown() override;
47
48private:
49 using DylibSet = DenseSet<void *>;
50
52 openWrapper(const char *ArgData, size_t ArgSize);
53
55 lookupWrapper(const char *ArgData, size_t ArgSize);
56
57 std::mutex M;
58 DylibSet Dylibs;
59};
60
61} // end namespace rt_bootstrap
62} // end namespace orc
63} // end namespace llvm
64
65#endif // LLVM_EXECUTIONENGINE_ORC_TARGETPROCESS_SIMPLEEXECUTORDYLIBMANAGER_H
#define LLVM_ABI
Definition Compiler.h:213
This file defines the DenseSet and SmallDenseSet classes.
static bool lookup(const GsymReader &GR, DataExtractor &Data, uint64_t &Offset, uint64_t BaseAddr, uint64_t Addr, SourceLocations &SrcLocs, llvm::Error &Err)
A Lookup helper functions.
#define H(x, y, z)
Definition MD5.cpp:57
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")))
Implements a dense probed hash-table based set.
Definition DenseSet.h:269
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
StringMap - This is an unconventional map that is specialized for handling keys that are "strings",...
Definition StringMap.h:133
Expected< tpctypes::DylibHandle > open(const std::string &Path, uint64_t Mode)
void addBootstrapSymbols(StringMap< ExecutorAddr > &M) override
ExecutorAddr DylibHandle
A handle used to represent a loaded dylib in the target process.
std::vector< RemoteSymbolLookupSetElement > RemoteSymbolLookupSet
This is an optimization pass for GlobalISel generic memory operations.