2727#include " llvm/Support/Allocator.h"
2828#include " llvm/Support/BinaryStreamReader.h"
2929#include " llvm/Support/BinaryStreamWriter.h"
30+ #include " llvm/Support/Compiler.h"
3031#include " llvm/Support/Endian.h"
3132#include " llvm/Support/Error.h"
3233#include " llvm/Support/FormatVariadic.h"
@@ -49,7 +50,7 @@ class Section;
4950
5051// / Base class for errors originating in JIT linker, e.g. missing relocation
5152// / support.
52- class JITLinkError : public ErrorInfo <JITLinkError> {
53+ class LLVM_ABI JITLinkError : public ErrorInfo<JITLinkError> {
5354public:
5455 static char ID;
5556
@@ -105,7 +106,7 @@ class Edge {
105106
106107// / Returns the string name of the given generic edge kind, or "unknown"
107108// / otherwise. Useful for debugging.
108- const char *getGenericEdgeKindName (Edge::Kind K);
109+ LLVM_ABI const char *getGenericEdgeKindName (Edge::Kind K);
109110
110111// / Base class for Addressable entities (externals, absolutes, blocks).
111112class Addressable {
@@ -389,7 +390,7 @@ inline orc::ExecutorAddr alignToBlock(orc::ExecutorAddr Addr, const Block &B) {
389390// Returns true if the given blocks contains exactly one valid c-string.
390391// Zero-fill blocks of size 1 count as valid empty strings. Content blocks
391392// must end with a zero, and contain no zeros before the end.
392- bool isCStringBlock (Block &B);
393+ LLVM_ABI bool isCStringBlock (Block &B);
393394
394395// / Describes symbol linkage. This can be used to resolve definition clashes.
395396enum class Linkage : uint8_t {
@@ -401,7 +402,7 @@ enum class Linkage : uint8_t {
401402using TargetFlagsType = uint8_t ;
402403
403404// / For errors and debugging output.
404- const char *getLinkageName (Linkage L);
405+ LLVM_ABI const char *getLinkageName (Linkage L);
405406
406407// / Defines the scope in which this symbol should be visible:
407408// / Default -- Visible in the public interface of the linkage unit.
@@ -412,9 +413,9 @@ const char *getLinkageName(Linkage L);
412413enum class Scope : uint8_t { Default, Hidden, SideEffectsOnly, Local };
413414
414415// / For debugging output.
415- const char *getScopeName (Scope S);
416+ LLVM_ABI const char *getScopeName (Scope S);
416417
417- raw_ostream &operator <<(raw_ostream &OS, const Block &B);
418+ LLVM_ABI raw_ostream &operator <<(raw_ostream &OS, const Block &B);
418419
419420// / Symbol representation.
420421// /
@@ -708,10 +709,10 @@ class Symbol {
708709 size_t Size = 0 ;
709710};
710711
711- raw_ostream &operator <<(raw_ostream &OS, const Symbol &A);
712+ LLVM_ABI raw_ostream &operator <<(raw_ostream &OS, const Symbol &A);
712713
713- void printEdge (raw_ostream &OS, const Block &B, const Edge &E,
714- StringRef EdgeKindName);
714+ LLVM_ABI void printEdge (raw_ostream &OS, const Block &B, const Edge &E,
715+ StringRef EdgeKindName);
715716
716717// / Represents an object file section.
717718class Section {
@@ -731,7 +732,7 @@ class Section {
731732 using block_iterator = BlockSet::iterator;
732733 using const_block_iterator = BlockSet::const_iterator;
733734
734- ~Section ();
735+ LLVM_ABI ~Section ();
735736
736737 // Sections are not movable or copyable.
737738 Section (const Section &) = delete ;
@@ -1039,7 +1040,7 @@ class LinkGraph {
10391040 LinkGraph &operator =(const LinkGraph &) = delete ;
10401041 LinkGraph (LinkGraph &&) = delete;
10411042 LinkGraph &operator =(LinkGraph &&) = delete ;
1042- ~LinkGraph ();
1043+ LLVM_ABI ~LinkGraph ();
10431044
10441045 // / Returns the name of this graph (usually the name of the original
10451046 // / underlying MemoryBuffer).
@@ -1658,11 +1659,11 @@ class LinkGraph {
16581659 orc::shared::AllocActions &allocActions () { return AAs; }
16591660
16601661 // / Dump the graph.
1661- void dump (raw_ostream &OS);
1662+ LLVM_ABI void dump (raw_ostream &OS);
16621663
16631664private:
1664- std::vector<Block *> splitBlockImpl (std::vector<Block *> Blocks,
1665- SplitBlockCache *Cache);
1665+ LLVM_ABI std::vector<Block *> splitBlockImpl (std::vector<Block *> Blocks,
1666+ SplitBlockCache *Cache);
16661667
16671668 // Put the BumpPtrAllocator first so that we don't free any of the underlying
16681669 // memory until the Symbol/Addressable destructors have been run.
@@ -1894,15 +1895,15 @@ struct PassConfiguration {
18941895// / the two types once we have an OrcSupport library.
18951896enum class SymbolLookupFlags { RequiredSymbol, WeaklyReferencedSymbol };
18961897
1897- raw_ostream &operator <<(raw_ostream &OS, const SymbolLookupFlags &LF);
1898+ LLVM_ABI raw_ostream &operator <<(raw_ostream &OS, const SymbolLookupFlags &LF);
18981899
18991900// / A map of symbol names to resolved addresses.
19001901using AsyncLookupResult =
19011902 DenseMap<orc::SymbolStringPtr, orc::ExecutorSymbolDef>;
19021903
19031904// / A function object to call with a resolved symbol map (See AsyncLookupResult)
19041905// / or an error if resolution failed.
1905- class JITLinkAsyncLookupContinuation {
1906+ class LLVM_ABI JITLinkAsyncLookupContinuation {
19061907public:
19071908 virtual ~JITLinkAsyncLookupContinuation () = default ;
19081909 virtual void run (Expected<AsyncLookupResult> LR) = 0;
@@ -1929,7 +1930,7 @@ createLookupContinuation(Continuation Cont) {
19291930}
19301931
19311932// / Holds context for a single jitLink invocation.
1932- class JITLinkContext {
1933+ class LLVM_ABI JITLinkContext {
19331934public:
19341935 using LookupMap = DenseMap<orc::SymbolStringPtr, SymbolLookupFlags>;
19351936
@@ -1995,14 +1996,14 @@ class JITLinkContext {
19951996
19961997// / Marks all symbols in a graph live. This can be used as a default,
19971998// / conservative mark-live implementation.
1998- Error markAllSymbolsLive (LinkGraph &G);
1999+ LLVM_ABI Error markAllSymbolsLive (LinkGraph &G);
19992000
20002001// / Create an out of range error for the given edge in the given block.
2001- Error makeTargetOutOfRangeError (const LinkGraph &G, const Block &B,
2002- const Edge &E);
2002+ LLVM_ABI Error makeTargetOutOfRangeError (const LinkGraph &G, const Block &B,
2003+ const Edge &E);
20032004
2004- Error makeAlignmentError (llvm::orc::ExecutorAddr Loc, uint64_t Value, int N ,
2005- const Edge &E);
2005+ LLVM_ABI Error makeAlignmentError (llvm::orc::ExecutorAddr Loc, uint64_t Value,
2006+ int N, const Edge &E);
20062007
20072008// / Creates a new pointer block in the given section and returns an
20082009// / Anonymous symbol pointing to it.
@@ -2016,7 +2017,7 @@ using AnonymousPointerCreator =
20162017 Symbol *InitialTarget, uint64_t InitialAddend)>;
20172018
20182019// / Get target-specific AnonymousPointerCreator
2019- AnonymousPointerCreator getAnonymousPointerCreator (const Triple &TT);
2020+ LLVM_ABI AnonymousPointerCreator getAnonymousPointerCreator (const Triple &TT);
20202021
20212022// / Create a jump stub that jumps via the pointer at the given symbol and
20222023// / an anonymous symbol pointing to it. Return the anonymous symbol.
@@ -2026,7 +2027,7 @@ using PointerJumpStubCreator = unique_function<Symbol &(
20262027 LinkGraph &G, Section &StubSection, Symbol &PointerSymbol)>;
20272028
20282029// / Get target-specific PointerJumpStubCreator
2029- PointerJumpStubCreator getPointerJumpStubCreator (const Triple &TT);
2030+ LLVM_ABI PointerJumpStubCreator getPointerJumpStubCreator (const Triple &TT);
20302031
20312032// / Base case for edge-visitors where the visitor-list is empty.
20322033inline void visitEdge (LinkGraph &G, Block *B, Edge &E) {}
@@ -2063,17 +2064,18 @@ void visitExistingEdges(LinkGraph &G, VisitorTs &&...Vs) {
20632064// / Note: The graph does not take ownership of the underlying buffer, nor copy
20642065// / its contents. The caller is responsible for ensuring that the object buffer
20652066// / outlives the graph.
2066- Expected<std::unique_ptr<LinkGraph>>
2067+ LLVM_ABI Expected<std::unique_ptr<LinkGraph>>
20672068createLinkGraphFromObject (MemoryBufferRef ObjectBuffer,
20682069 std::shared_ptr<orc::SymbolStringPool> SSP);
20692070
20702071// / Create a \c LinkGraph defining the given absolute symbols.
2071- std::unique_ptr<LinkGraph>
2072+ LLVM_ABI std::unique_ptr<LinkGraph>
20722073absoluteSymbolsLinkGraph (Triple TT, std::shared_ptr<orc::SymbolStringPool> SSP,
20732074 orc::SymbolMap Symbols);
20742075
20752076// / Link the given graph.
2076- void link (std::unique_ptr<LinkGraph> G, std::unique_ptr<JITLinkContext> Ctx);
2077+ LLVM_ABI void link (std::unique_ptr<LinkGraph> G,
2078+ std::unique_ptr<JITLinkContext> Ctx);
20772079
20782080} // end namespace jitlink
20792081} // end namespace llvm
0 commit comments