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()) {
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())
99 "Discarding non-weak definition");
100 G->makeExternal(*
Sym);
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
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.
const orc::SymbolStringPtr & getName() const
Returns the name of this symbol (empty if the symbol is anonymous).
Scope getScope() const
Get the visibility for this Symbol.
Linkage getLinkage() const
Get the linkage for this Symbol.
bool hasName() const
Returns true if this symbol has a name.
SymbolStringPtr intern(StringRef SymName)
Add a symbol name to the SymbolStringPool and return a pointer to it.
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.
bool isMachOInitializerSection(StringRef SegName, StringRef SecName)
bool isELFInitializerSection(StringRef SecName)
This is an optimization pass for GlobalISel generic memory operations.
SymbolFlagsMap SymbolFlags
SymbolStringPtr InitSymbol