13#ifndef LLVM_EXECUTIONENGINE_ORC_MATERIALIZATIONUNIT_H
14#define LLVM_EXECUTIONENGINE_ORC_MATERIALIZATIONUNIT_H
23class MaterializationResponsibility;
43 : SymbolFlags(
std::
move(InitalSymbolFlags)),
44 InitSymbol(
std::
move(InitSymbol)) {
45 assert((!this->InitSymbol || this->SymbolFlags.count(this->InitSymbol)) &&
46 "If set, InitSymbol should appear in InitialSymbolFlags map");
54 : SymbolFlags(
std::
move(
I.SymbolFlags)),
55 InitSymbol(
std::
move(
I.InitSymbol)) {}
72 materialize(std::unique_ptr<MaterializationResponsibility> R) = 0;
77 SymbolFlags.erase(
Name);
78 if (InitSymbol ==
Name) {
80 dbgs() <<
"In " <<
getName() <<
": discarding init symbol \""
85 discard(JD, std::move(
Name));
93 virtual void anchor();
assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")
static StringRef getName(Value *V)
#define DEBUG_WITH_TYPE(TYPE,...)
DEBUG_WITH_TYPE macro - This macro should be used by passes to emit debug information.
StringRef - Represent a constant reference to a string, i.e.
An ExecutionSession represents a running JIT program.
Represents a JIT'd dynamic library.
A MaterializationUnit represents a set of symbol definitions that can be materialized as a group,...
MaterializationUnit(Interface I)
virtual StringRef getName() const =0
Return the name of this materialization unit.
SymbolStringPtr InitSymbol
SymbolFlagsMap SymbolFlags
const SymbolFlagsMap & getSymbols() const
Return the set of symbols that this source provides.
virtual void materialize(std::unique_ptr< MaterializationResponsibility > R)=0
Implementations of this method should materialize all symbols in the materialzation unit,...
const SymbolStringPtr & getInitializerSymbol() const
Returns the initialization symbol for this MaterializationUnit (if any).
void doDiscard(const JITDylib &JD, const SymbolStringPtr &Name)
Called by JITDylibs to notify MaterializationUnits that the given symbol has been overridden.
virtual ~MaterializationUnit()=default
Pointer to a pooled string representing a symbol name.
LLVM_ABI raw_ostream & dbgs()
dbgs() - This returns a reference to a raw_ostream for debugging messages.
OutputIt move(R &&Range, OutputIt Out)
Provide wrappers to std::move which take ranges instead of having to pass begin/end explicitly.
Implement std::hash so that hash_code can be used in STL containers.
SymbolFlagsMap SymbolFlags
SymbolStringPtr InitSymbol
Interface(SymbolFlagsMap InitalSymbolFlags, SymbolStringPtr InitSymbol)