Go to the documentation of this file.
17 #define DEBUG_TYPE "orc"
24 assert(!
I.InitSymbol &&
"I already has an init symbol");
28 std::string InitSymString;
30 <<
"$." << ObjFileName <<
".__inits." << Counter++;
31 I.InitSymbol = ES.
intern(InitSymString);
32 }
while (
I.SymbolFlags.count(
I.InitSymbol));
42 for (
auto &Sym : Obj.
symbols()) {
57 if (
auto SymType = Sym.getType()) {
61 return SymType.takeError();
63 auto Name = Sym.getName();
65 return Name.takeError();
69 return SymFlags.takeError();
72 if (
Name->startswith(
"l"))
75 I.SymbolFlags[InternedName] =
std::move(*SymFlags);
100 for (
auto &Sym : Obj.
symbols()) {
115 if (
auto SymType = Sym.getType()) {
119 return SymType.takeError();
121 auto Name = Sym.getName();
123 return Name.takeError();
127 return SymFlags.takeError();
133 I.SymbolFlags[InternedName] =
std::move(*SymFlags);
138 if (
auto SecName = Sec.getName()) {
154 for (
auto &Sym : Obj.
symbols()) {
169 if (
auto SymType = Sym.getType()) {
173 return SymType.takeError();
175 auto Name = Sym.getName();
177 return Name.takeError();
181 return SymFlags.takeError();
183 I.SymbolFlags[InternedName] =
std::move(*SymFlags);
194 return Obj.takeError();
196 if (
auto *MachOObj = dyn_cast<object::MachOObjectFile>(Obj->get()))
198 else if (
auto *ELFObj = dyn_cast<object::ELFObjectFileBase>(Obj->get()))
This is an optimization pass for GlobalISel generic memory operations.
A raw_ostream that writes to an std::string.
Expected< MaterializationUnit::Interface > getGenericObjectFileSymbolInfo(ExecutionSession &ES, const object::ObjectFile &Obj)
Pointer to a pooled string representing a symbol name.
Tagged union holding either a T or a Error.
Flags for symbols in the JIT.
symbol_iterator_range symbols() const
@ MaterializationSideEffectsOnly
SymbolStringPtr intern(StringRef SymName)
Add a symbol name to the SymbolStringPool and return a pointer to it.
unsigned getSectionType(SectionRef Sec) const
@ S_MOD_INIT_FUNC_POINTERS
S_MOD_INIT_FUNC_POINTERS - Section with only function pointers for initialization.
compiles ldr LCPI1_0 ldr ldr mov lsr tst moveq r1 ldr LCPI1_1 and r0 bx lr It would be better to do something like to fold the shift into the conditional move
static Expected< MaterializationUnit::Interface > getELFObjectFileSymbolInfo(ExecutionSession &ES, const object::ELFObjectFileBase &Obj)
static Expected< OwningBinary< ObjectFile > > createObjectFile(StringRef ObjectPath)
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
elf_symbol_iterator_range symbols() const
StringRef - Represent a constant reference to a string, i.e.
This class is the base class for all object file types.
void cantFail(Error Err, const char *Msg=nullptr)
Report a fatal error if Err is a failure value.
An ExecutionSession represents a running JIT program.
static Expected< MaterializationUnit::Interface > getMachOObjectFileSymbolInfo(ExecutionSession &ES, const object::MachOObjectFile &Obj)
void addInitSymbol(MaterializationUnit::Interface &I, ExecutionSession &ES, StringRef ObjFileName)
Adds an initializer symbol to the given MU interface.
Error takeError()
Take ownership of the stored error.
StringRef getFileName() const
StringRef getSectionFinalSegmentName(DataRefImpl Sec) const
Expected< MaterializationUnit::Interface > getObjectFileInterface(ExecutionSession &ES, MemoryBufferRef ObjBuffer)
Returns a MaterializationUnit::Interface for the object file contained in the given buffer,...
static Expected< JITSymbolFlags > fromObjectSymbol(const object::SymbolRef &Symbol)
Construct a JITSymbolFlags value based on the flags of the given libobject symbol.
section_iterator_range sections() const
Expected< StringRef > getSectionName(DataRefImpl Sec) const override