24#define DEBUG_TYPE "jitlink"
33 return make_error<JITLinkError>(
"Truncated MachO buffer \"" +
39 dbgs() <<
"jitLink_MachO: magic = " <<
format(
"0x%08" PRIx32, Magic)
45 return make_error<JITLinkError>(
"MachO 32-bit platforms not supported");
49 return make_error<JITLinkError>(
"Truncated MachO buffer \"" +
57 CPUType = llvm::byteswap<uint32_t>(CPUType);
60 dbgs() <<
"jitLink_MachO: cputype = " <<
format(
"0x%08" PRIx32, CPUType)
70 return make_error<JITLinkError>(
"MachO-64 CPU type not valid");
72 return make_error<JITLinkError>(
"Unrecognized MachO magic value");
76 std::unique_ptr<JITLinkContext> Ctx) {
78 switch (
G->getTargetTriple().getArch()) {
84 Ctx->notifyFailed(make_error<JITLinkError>(
"MachO-64 CPU type not valid"));
Tagged union holding either a T or a Error.
StringRef getBufferIdentifier() const
StringRef getBuffer() const
StringRef - Represent a constant reference to a string, i.e.
void link_MachO_arm64(std::unique_ptr< LinkGraph > G, std::unique_ptr< JITLinkContext > Ctx)
jit-link the given object buffer, which must be a MachO arm64 object file.
Expected< std::unique_ptr< LinkGraph > > createLinkGraphFromMachOObject_x86_64(MemoryBufferRef ObjectBuffer)
Create a LinkGraph from a MachO/x86-64 relocatable object.
void link_MachO_x86_64(std::unique_ptr< LinkGraph > G, std::unique_ptr< JITLinkContext > Ctx)
jit-link the given LinkGraph.
Expected< std::unique_ptr< LinkGraph > > createLinkGraphFromMachOObject_arm64(MemoryBufferRef ObjectBuffer)
Create a LinkGraph from a MachO/arm64 relocatable object.
void link_MachO(std::unique_ptr< LinkGraph > G, std::unique_ptr< JITLinkContext > Ctx)
jit-link the given ObjBuffer, which must be a MachO object file.
Expected< std::unique_ptr< LinkGraph > > createLinkGraphFromMachOObject(MemoryBufferRef ObjectBuffer)
Create a LinkGraph from a MachO relocatable object.
This is an optimization pass for GlobalISel generic memory operations.
raw_ostream & dbgs()
dbgs() - This returns a reference to a raw_ostream for debugging messages.
format_object< Ts... > format(const char *Fmt, const Ts &... Vals)
These are helper functions used to produce formatted output.