LLVM: lib/ExecutionEngine/JITLink/XCOFF_ppc64.cpp Source File (original) (raw)
1
2
3
4
5
6
7
8
9
10
11
12
13
24#include <system_error>
25
26using namespace llvm;
27
28#define DEBUG_TYPE "jitlink"
29
30namespace llvm {
32
34 MemoryBufferRef ObjectBuffer, std::shared_ptrorc::SymbolStringPool SSP) {
36 dbgs() << "Building jitlink graph for new input "
38 });
39
41 if (!Obj)
42 return Obj.takeError();
43 assert((**Obj).isXCOFF() && "Expects and XCOFF Object");
44
45 auto Features = (*Obj)->getFeatures();
46 if (!Features)
47 return Features.takeError();
49 dbgs() << " Features: ";
50 (*Features).print(dbgs());
51 });
52
54 std::move(SSP), Triple("powerpc64-ibm-aix"),
57}
58
61 friend JITLinkerBase;
62
63public:
65 std::unique_ptr G,
68
69
71 }
72
74 LLVM_DEBUG(dbgs() << " Applying fixup for " << G.getName()
75 << ", address = " << B.getAddress()
76 << ", target = " << E.getTarget().getName() << ", kind = "
78 switch (E.getKind()) {
81 return Err;
82 break;
83 default:
85 std::error_code());
86 }
88 }
89
90private:
92 for (Symbol *S : G.defined_symbols()) {
93 if (S->hasName() && *S->getName() == StringRef("TOC")) {
94 TOCSymbol = S;
95 return;
96 }
97 }
99 }
100
101private:
102 Symbol *TOCSymbol = nullptr;
103};
104
106 std::unique_ptr Ctx) {
107
108
109
111
112
113
114 if (auto Err = Ctx->modifyPassConfig(*G, Config))
115 return Ctx->notifyFailed(std::move(Err));
116
118}
119
120}
121}
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 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.
static void link(ArgTs &&... Args)
XCOFFJITLinker_ppc64(std::unique_ptr< JITLinkContext > Ctx, std::unique_ptr< LinkGraph > G, PassConfiguration PassConfig)
Definition XCOFF_ppc64.cpp:64
Error applyFixup(LinkGraph &G, Block &B, const Edge &E) const
Definition XCOFF_ppc64.cpp:73
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.
Error applyFixup(LinkGraph &G, Block &B, const Edge &E, const Symbol *TOCSymbol)
Apply fixup expression for edge to block content.
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.
Definition XCOFF_ppc64.cpp:33
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.
Definition XCOFF_ppc64.cpp:105
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.
Error make_error(ArgTs &&... Args)
Make a Error instance representing failure using the given error info type.
OutputIt move(R &&Range, OutputIt Out)
Provide wrappers to std::move which take ranges instead of having to pass begin/end explicitly.
decltype(auto) cast(const From &Val)
cast - Return the argument parameter cast to the specified type.
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...