15#define DEBUG_TYPE "orc"
24 bool IsMachO =
G.getTargetTriple().isOSBinFormatMachO();
25 bool IsElf =
G.getTargetTriple().isOSBinFormatELF();
26 if (!IsMachO && !IsElf)
29 for (
auto &Sec :
G.sections()) {
49 auto AddSymbol = [&](
Symbol *Sym) {
53 assert(Sym->hasName() &&
"Anonymous non-local symbol?");
58 for (
auto *Sym :
G.defined_symbols())
60 for (
auto *Sym :
G.absolute_symbols())
63 if (hasInitializerSection(
G)) {
64 std::string InitSymString;
67 <<
"$." <<
G.getName() <<
".__inits" << Counter++;
94void LinkGraphMaterializationUnit::discard(
const JITDylib &JD,
96 for (
auto *Sym :
G->defined_symbols())
97 if (Sym->getName() == Name) {
99 "Discarding non-weak definition");
100 G->makeExternal(*Sym);
assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")
Flags for symbols in the JIT.
@ MaterializationSideEffectsOnly
StringRef - Represent a constant reference to a string, i.e.
bool isCallable() const
Returns true is this symbol is callable.
Scope getScope() const
Get the visibility for this Symbol.
Linkage getLinkage() const
Get the linkage for this Symbol.
Represents a JIT'd dynamic library.
MaterializationUnit::Interface getInterface(jitlink::LinkGraph &G)
Get the interface for the given LinkGraph.
static JITSymbolFlags getJITSymbolFlagsForSymbol(jitlink::Symbol &Sym)
Get the JITSymbolFlags for the given symbol.
virtual ~LinkGraphLayer()
StringRef getName() const override
Return the name of this materialization unit.
Pointer to a pooled string representing a symbol name.
A raw_ostream that writes to an std::string.
LLVM_ABI bool isMachOInitializerSection(StringRef SegName, StringRef SecName)
LLVM_ABI bool isELFInitializerSection(StringRef SecName)
This is an optimization pass for GlobalISel generic memory operations.
SymbolFlagsMap SymbolFlags
SymbolStringPtr InitSymbol