27
27
#include " llvm/Support/Allocator.h"
28
28
#include " llvm/Support/BinaryStreamReader.h"
29
29
#include " llvm/Support/BinaryStreamWriter.h"
30
+ #include " llvm/Support/Compiler.h"
30
31
#include " llvm/Support/Endian.h"
31
32
#include " llvm/Support/Error.h"
32
33
#include " llvm/Support/FormatVariadic.h"
@@ -49,7 +50,7 @@ class Section;
49
50
50
51
// / Base class for errors originating in JIT linker, e.g. missing relocation
51
52
// / support.
52
- class JITLinkError : public ErrorInfo <JITLinkError> {
53
+ class LLVM_ABI JITLinkError : public ErrorInfo<JITLinkError> {
53
54
public:
54
55
static char ID;
55
56
@@ -105,7 +106,7 @@ class Edge {
105
106
106
107
// / Returns the string name of the given generic edge kind, or "unknown"
107
108
// / otherwise. Useful for debugging.
108
- const char *getGenericEdgeKindName (Edge::Kind K);
109
+ LLVM_ABI const char *getGenericEdgeKindName (Edge::Kind K);
109
110
110
111
// / Base class for Addressable entities (externals, absolutes, blocks).
111
112
class Addressable {
@@ -389,7 +390,7 @@ inline orc::ExecutorAddr alignToBlock(orc::ExecutorAddr Addr, const Block &B) {
389
390
// Returns true if the given blocks contains exactly one valid c-string.
390
391
// Zero-fill blocks of size 1 count as valid empty strings. Content blocks
391
392
// must end with a zero, and contain no zeros before the end.
392
- bool isCStringBlock (Block &B);
393
+ LLVM_ABI bool isCStringBlock (Block &B);
393
394
394
395
// / Describes symbol linkage. This can be used to resolve definition clashes.
395
396
enum class Linkage : uint8_t {
@@ -401,7 +402,7 @@ enum class Linkage : uint8_t {
401
402
using TargetFlagsType = uint8_t ;
402
403
403
404
// / For errors and debugging output.
404
- const char *getLinkageName (Linkage L);
405
+ LLVM_ABI const char *getLinkageName (Linkage L);
405
406
406
407
// / Defines the scope in which this symbol should be visible:
407
408
// / Default -- Visible in the public interface of the linkage unit.
@@ -412,9 +413,9 @@ const char *getLinkageName(Linkage L);
412
413
enum class Scope : uint8_t { Default, Hidden, SideEffectsOnly, Local };
413
414
414
415
// / For debugging output.
415
- const char *getScopeName (Scope S);
416
+ LLVM_ABI const char *getScopeName (Scope S);
416
417
417
- raw_ostream &operator <<(raw_ostream &OS, const Block &B);
418
+ LLVM_ABI raw_ostream &operator <<(raw_ostream &OS, const Block &B);
418
419
419
420
// / Symbol representation.
420
421
// /
@@ -708,10 +709,10 @@ class Symbol {
708
709
size_t Size = 0 ;
709
710
};
710
711
711
- raw_ostream &operator <<(raw_ostream &OS, const Symbol &A);
712
+ LLVM_ABI raw_ostream &operator <<(raw_ostream &OS, const Symbol &A);
712
713
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);
715
716
716
717
// / Represents an object file section.
717
718
class Section {
@@ -731,7 +732,7 @@ class Section {
731
732
using block_iterator = BlockSet::iterator;
732
733
using const_block_iterator = BlockSet::const_iterator;
733
734
734
- ~Section ();
735
+ LLVM_ABI ~Section ();
735
736
736
737
// Sections are not movable or copyable.
737
738
Section (const Section &) = delete ;
@@ -1039,7 +1040,7 @@ class LinkGraph {
1039
1040
LinkGraph &operator =(const LinkGraph &) = delete ;
1040
1041
LinkGraph (LinkGraph &&) = delete;
1041
1042
LinkGraph &operator =(LinkGraph &&) = delete ;
1042
- ~LinkGraph ();
1043
+ LLVM_ABI ~LinkGraph ();
1043
1044
1044
1045
// / Returns the name of this graph (usually the name of the original
1045
1046
// / underlying MemoryBuffer).
@@ -1658,11 +1659,11 @@ class LinkGraph {
1658
1659
orc::shared::AllocActions &allocActions () { return AAs; }
1659
1660
1660
1661
// / Dump the graph.
1661
- void dump (raw_ostream &OS);
1662
+ LLVM_ABI void dump (raw_ostream &OS);
1662
1663
1663
1664
private:
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);
1666
1667
1667
1668
// Put the BumpPtrAllocator first so that we don't free any of the underlying
1668
1669
// memory until the Symbol/Addressable destructors have been run.
@@ -1894,15 +1895,15 @@ struct PassConfiguration {
1894
1895
// / the two types once we have an OrcSupport library.
1895
1896
enum class SymbolLookupFlags { RequiredSymbol, WeaklyReferencedSymbol };
1896
1897
1897
- raw_ostream &operator <<(raw_ostream &OS, const SymbolLookupFlags &LF);
1898
+ LLVM_ABI raw_ostream &operator <<(raw_ostream &OS, const SymbolLookupFlags &LF);
1898
1899
1899
1900
// / A map of symbol names to resolved addresses.
1900
1901
using AsyncLookupResult =
1901
1902
DenseMap<orc::SymbolStringPtr, orc::ExecutorSymbolDef>;
1902
1903
1903
1904
// / A function object to call with a resolved symbol map (See AsyncLookupResult)
1904
1905
// / or an error if resolution failed.
1905
- class JITLinkAsyncLookupContinuation {
1906
+ class LLVM_ABI JITLinkAsyncLookupContinuation {
1906
1907
public:
1907
1908
virtual ~JITLinkAsyncLookupContinuation () = default ;
1908
1909
virtual void run (Expected<AsyncLookupResult> LR) = 0;
@@ -1929,7 +1930,7 @@ createLookupContinuation(Continuation Cont) {
1929
1930
}
1930
1931
1931
1932
// / Holds context for a single jitLink invocation.
1932
- class JITLinkContext {
1933
+ class LLVM_ABI JITLinkContext {
1933
1934
public:
1934
1935
using LookupMap = DenseMap<orc::SymbolStringPtr, SymbolLookupFlags>;
1935
1936
@@ -1995,14 +1996,14 @@ class JITLinkContext {
1995
1996
1996
1997
// / Marks all symbols in a graph live. This can be used as a default,
1997
1998
// / conservative mark-live implementation.
1998
- Error markAllSymbolsLive (LinkGraph &G);
1999
+ LLVM_ABI Error markAllSymbolsLive (LinkGraph &G);
1999
2000
2000
2001
// / 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);
2003
2004
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);
2006
2007
2007
2008
// / Creates a new pointer block in the given section and returns an
2008
2009
// / Anonymous symbol pointing to it.
@@ -2016,7 +2017,7 @@ using AnonymousPointerCreator =
2016
2017
Symbol *InitialTarget, uint64_t InitialAddend)>;
2017
2018
2018
2019
// / Get target-specific AnonymousPointerCreator
2019
- AnonymousPointerCreator getAnonymousPointerCreator (const Triple &TT);
2020
+ LLVM_ABI AnonymousPointerCreator getAnonymousPointerCreator (const Triple &TT);
2020
2021
2021
2022
// / Create a jump stub that jumps via the pointer at the given symbol and
2022
2023
// / an anonymous symbol pointing to it. Return the anonymous symbol.
@@ -2026,7 +2027,7 @@ using PointerJumpStubCreator = unique_function<Symbol &(
2026
2027
LinkGraph &G, Section &StubSection, Symbol &PointerSymbol)>;
2027
2028
2028
2029
// / Get target-specific PointerJumpStubCreator
2029
- PointerJumpStubCreator getPointerJumpStubCreator (const Triple &TT);
2030
+ LLVM_ABI PointerJumpStubCreator getPointerJumpStubCreator (const Triple &TT);
2030
2031
2031
2032
// / Base case for edge-visitors where the visitor-list is empty.
2032
2033
inline void visitEdge (LinkGraph &G, Block *B, Edge &E) {}
@@ -2063,17 +2064,18 @@ void visitExistingEdges(LinkGraph &G, VisitorTs &&...Vs) {
2063
2064
// / Note: The graph does not take ownership of the underlying buffer, nor copy
2064
2065
// / its contents. The caller is responsible for ensuring that the object buffer
2065
2066
// / outlives the graph.
2066
- Expected<std::unique_ptr<LinkGraph>>
2067
+ LLVM_ABI Expected<std::unique_ptr<LinkGraph>>
2067
2068
createLinkGraphFromObject (MemoryBufferRef ObjectBuffer,
2068
2069
std::shared_ptr<orc::SymbolStringPool> SSP);
2069
2070
2070
2071
// / Create a \c LinkGraph defining the given absolute symbols.
2071
- std::unique_ptr<LinkGraph>
2072
+ LLVM_ABI std::unique_ptr<LinkGraph>
2072
2073
absoluteSymbolsLinkGraph (Triple TT, std::shared_ptr<orc::SymbolStringPool> SSP,
2073
2074
orc::SymbolMap Symbols);
2074
2075
2075
2076
// / 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);
2077
2079
2078
2080
} // end namespace jitlink
2079
2081
} // end namespace llvm
0 commit comments