Thanks to visit codestin.com
Credit goes to llvm.org

LLVM 22.0.0git
AbsoluteSymbols.cpp
Go to the documentation of this file.
1//===---------- AbsoluteSymbols.cpp - Absolute symbols utilities ----------===//
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
11
12#define DEBUG_TYPE "orc"
13
14namespace llvm::orc {
15
19
21 return "<Absolute Symbols>";
22}
23
24void AbsoluteSymbolsMaterializationUnit::materialize(
25 std::unique_ptr<MaterializationResponsibility> R) {
26 // Even though these are just absolute symbols we need to check for failure
27 // to resolve/emit: the tracker for these symbols may have been removed while
28 // the materialization was in flight (e.g. due to a failure in some action
29 // triggered by the queries attached to the resolution/emission of these
30 // symbols).
31 if (auto Err = R->notifyResolved(Symbols)) {
32 R->getExecutionSession().reportError(std::move(Err));
33 R->failMaterialization();
34 return;
35 }
36 if (auto Err = R->notifyEmitted({})) {
37 R->getExecutionSession().reportError(std::move(Err));
38 R->failMaterialization();
39 return;
40 }
41}
42
43void AbsoluteSymbolsMaterializationUnit::discard(const JITDylib &JD,
44 const SymbolStringPtr &Name) {
45 assert(Symbols.count(Name) && "Symbol is not part of this MU");
46 Symbols.erase(Name);
47}
48
50AbsoluteSymbolsMaterializationUnit::extractFlags(const SymbolMap &Symbols) {
52 for (const auto &[Name, Def] : Symbols)
53 Flags[Name] = Def.getFlags();
54 return MaterializationUnit::Interface(std::move(Flags), nullptr);
55}
56
57} // namespace llvm::orc
assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")
StringRef - Represent a constant reference to a string, i.e.
Definition StringRef.h:55
StringRef getName() const override
Return the name of this materialization unit.
Represents a JIT'd dynamic library.
Definition Core.h:902
Pointer to a pooled string representing a symbol name.
DenseMap< SymbolStringPtr, ExecutorSymbolDef > SymbolMap
A map from symbol names (as SymbolStringPtrs) to JITSymbols (address/flags pairs).
DenseMap< SymbolStringPtr, JITSymbolFlags > SymbolFlagsMap
A map from symbol names (as SymbolStringPtrs) to JITSymbolFlags.
NodeAddr< DefNode * > Def
Definition RDFGraph.h:384
OutputIt move(R &&Range, OutputIt Out)
Provide wrappers to std::move which take ranges instead of having to pass begin/end explicitly.
Definition STLExtras.h:1847
Implement std::hash so that hash_code can be used in STL containers.
Definition BitVector.h:851