24#include <system_error>
28#define DEBUG_TYPE "jitlink"
34 MemoryBufferRef ObjectBuffer, std::shared_ptr<orc::SymbolStringPool> SSP) {
36 dbgs() <<
"Building jitlink graph for new input "
42 return Obj.takeError();
43 assert((**Obj).isXCOFF() &&
"Expects and XCOFF Object");
45 auto Features = (*Obj)->getFeatures();
47 return Features.takeError();
49 dbgs() <<
" Features: ";
50 (*Features).print(
dbgs());
54 std::move(SSP),
Triple(
"powerpc64-ibm-aix"),
65 std::unique_ptr<LinkGraph> G,
75 <<
", address = " <<
B.getAddress()
80 if (
auto Err = ppc64::applyFixup<endianness::big>(
G,
B, E, TOCSymbol))
84 return make_error<StringError>(
"Unsupported relocation type",
92 for (
Symbol *S :
G.defined_symbols()) {
93 if (S->hasName() && *S->getName() ==
StringRef(
"TOC")) {
102 Symbol *TOCSymbol =
nullptr;
106 std::unique_ptr<JITLinkContext> Ctx) {
114 if (
auto Err = Ctx->modifyPassConfig(*
G,
Config))
115 return Ctx->notifyFailed(std::move(Err));
assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")
static GCRegistry::Add< OcamlGC > B("ocaml", "ocaml 3.10-compatible GC")
This file implements the C++20 <bit> header.
Lightweight error class with error context and mandatory checking.
static ErrorSuccess success()
Create a success value.
Tagged union holding either a T or a Error.
StringRef getBufferIdentifier() const
StringRef - Represent a constant reference to a string, i.e.
Triple - Helper class for working with autoconf configuration names.
An Addressable with content and edges.
Represents fixups and constraints in the LinkGraph.
Symbol & getTarget() const
static void link(ArgTs &&... Args)
Link constructs a LinkerImpl instance and calls linkPhase1.
const orc::SymbolStringPtr & getName() const
Returns the name of this symbol (empty if the symbol is anonymous).
XCOFFJITLinker_ppc64(std::unique_ptr< JITLinkContext > Ctx, std::unique_ptr< LinkGraph > G, PassConfiguration PassConfig)
Error applyFixup(LinkGraph &G, Block &B, const Edge &E) const
Expected< std::unique_ptr< LinkGraph > > buildGraph()
static Expected< OwningBinary< ObjectFile > > createObjectFile(StringRef ObjectPath)
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
LLVM_ABI const char * getEdgeKindName(Edge::Kind K)
Returns a string name for the given ppc64 edge.
Expected< std::unique_ptr< LinkGraph > > createLinkGraphFromXCOFFObject_ppc64(MemoryBufferRef ObjectBuffer, std::shared_ptr< orc::SymbolStringPool > SSP)
Create a LinkGraph from an XCOFF/ppc64 relocatable object.
void link_XCOFF_ppc64(std::unique_ptr< LinkGraph > G, std::unique_ptr< JITLinkContext > Ctx)
jit-link the given object buffer, which must be a XCOFF ppc64 object file.
This is an optimization pass for GlobalISel generic memory operations.
LLVM_ABI raw_ostream & dbgs()
dbgs() - This returns a reference to a raw_ostream for debugging messages.
OutputIt move(R &&Range, OutputIt Out)
Provide wrappers to std::move which take ranges instead of having to pass begin/end explicitly.
Implement std::hash so that hash_code can be used in STL containers.
An LinkGraph pass configuration, consisting of a list of pre-prune, post-prune, and post-fixup passes...