Go to the documentation of this file.
27 #define DEBUG_TYPE "jitlink"
38 return File->getHeader().e_machine;
40 return File.takeError();
44 return File->getHeader().e_machine;
46 return File.takeError();
58 return make_error<JITLinkError>(
"Truncated ELF buffer");
61 return make_error<JITLinkError>(
"ELF magic not valid");
64 if (!TargetMachineArch)
67 switch (*TargetMachineArch) {
75 return make_error<JITLinkError>(
76 "Unsupported target machine architecture in ELF object " +
82 std::unique_ptr<JITLinkContext> Ctx) {
83 switch (
G->getTargetTriple().getArch()) {
95 Ctx->notifyFailed(make_error<JITLinkError>(
96 "Unsupported target machine architecture in ELF link graph " +
void link_ELF_x86_64(std::unique_ptr< LinkGraph > G, std::unique_ptr< JITLinkContext > Ctx)
jit-link the given object buffer, which must be a ELF x86-64 object file.
This is an optimization pass for GlobalISel generic memory operations.
Merge contiguous icmps into a memcmp
void link_ELF(std::unique_ptr< LinkGraph > G, std::unique_ptr< JITLinkContext > Ctx)
Link the given graph.
Tagged union holding either a T or a Error.
Expected< std::unique_ptr< LinkGraph > > createLinkGraphFromELFObject_x86_64(MemoryBufferRef ObjectBuffer)
Create a LinkGraph from an ELF/x86-64 relocatable object.
Expected< std::unique_ptr< LinkGraph > > createLinkGraphFromELFObject_aarch64(MemoryBufferRef ObjectBuffer)
Create a LinkGraph from an ELF/aarch64 relocatable object.
Expected< std::unique_ptr< LinkGraph > > createLinkGraphFromELFObject_riscv(MemoryBufferRef ObjectBuffer)
Create a LinkGraph from an ELF/riscv relocatable object.
Expected< std::unique_ptr< LinkGraph > > createLinkGraphFromELFObject(MemoryBufferRef ObjectBuffer)
Create a LinkGraph from an ELF relocatable object.
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
StringRef getBuffer() const
StringRef - Represent a constant reference to a string, i.e.
constexpr LLVM_NODISCARD size_t size() const
size - Get the string size.
void link_ELF_aarch64(std::unique_ptr< LinkGraph > G, std::unique_ptr< JITLinkContext > Ctx)
jit-link the given object buffer, which must be a ELF aarch64 relocatable object file.
static Expected< ELFFile > create(StringRef Object)
static const char ElfMagic[]
Error takeError()
Take ownership of the stored error.
StringRef getBufferIdentifier() const
void link_ELF_riscv(std::unique_ptr< LinkGraph > G, std::unique_ptr< JITLinkContext > Ctx)
jit-link the given object buffer, which must be a ELF riscv object file.
const LLVM_NODISCARD char * data() const
data - Get a pointer to the start of the string (which may not be null terminated).
Expected< uint16_t > readTargetMachineArch(StringRef Buffer)