Skip to content

Commit 3582c92

Browse files
committed
[llvm] annotate interfaces in Transforms library for DLL export
1 parent efc3c1b commit 3582c92

File tree

101 files changed

+1135
-1041
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

101 files changed

+1135
-1041
lines changed

llvm/include/llvm/Transforms/Coroutines/ABI.h

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
#ifndef LLVM_TRANSFORMS_COROUTINES_ABI_H
1616
#define LLVM_TRANSFORMS_COROUTINES_ABI_H
1717

18+
#include "llvm/Support/Compiler.h"
1819
#include "llvm/Analysis/TargetTransformInfo.h"
1920
#include "llvm/Transforms/Coroutines/CoroShape.h"
2021
#include "llvm/Transforms/Coroutines/MaterializationUtils.h"
@@ -37,7 +38,7 @@ namespace coro {
3738
// index of an ABI generator for the custom ABI object in a SmallVector passed
3839
// to CoroSplitPass ctor.
3940

40-
class BaseABI {
41+
class LLVM_ABI BaseABI {
4142
public:
4243
BaseABI(Function &F, coro::Shape &S,
4344
std::function<bool(Instruction &)> IsMaterializable)
@@ -63,7 +64,7 @@ class BaseABI {
6364
std::function<bool(Instruction &I)> IsMaterializable;
6465
};
6566

66-
class SwitchABI : public BaseABI {
67+
class LLVM_ABI SwitchABI : public BaseABI {
6768
public:
6869
SwitchABI(Function &F, coro::Shape &S,
6970
std::function<bool(Instruction &)> IsMaterializable)
@@ -76,7 +77,7 @@ class SwitchABI : public BaseABI {
7677
TargetTransformInfo &TTI) override;
7778
};
7879

79-
class AsyncABI : public BaseABI {
80+
class LLVM_ABI AsyncABI : public BaseABI {
8081
public:
8182
AsyncABI(Function &F, coro::Shape &S,
8283
std::function<bool(Instruction &)> IsMaterializable)
@@ -89,7 +90,7 @@ class AsyncABI : public BaseABI {
8990
TargetTransformInfo &TTI) override;
9091
};
9192

92-
class AnyRetconABI : public BaseABI {
93+
class LLVM_ABI AnyRetconABI : public BaseABI {
9394
public:
9495
AnyRetconABI(Function &F, coro::Shape &S,
9596
std::function<bool(Instruction &)> IsMaterializable)

llvm/include/llvm/Transforms/Coroutines/CoroInstr.h

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
#ifndef LLVM_TRANSFORMS_COROUTINES_COROINSTR_H
2626
#define LLVM_TRANSFORMS_COROUTINES_COROINSTR_H
2727

28+
#include "llvm/Support/Compiler.h"
2829
#include "llvm/IR/GlobalVariable.h"
2930
#include "llvm/IR/IntrinsicInst.h"
3031
#include "llvm/Support/raw_ostream.h"
@@ -237,7 +238,7 @@ class AnyCoroIdRetconInst : public AnyCoroIdInst {
237238
enum { SizeArg, AlignArg, StorageArg, PrototypeArg, AllocArg, DeallocArg };
238239

239240
public:
240-
void checkWellFormed() const;
241+
LLVM_ABI void checkWellFormed() const;
241242

242243
uint64_t getStorageSize() const {
243244
return cast<ConstantInt>(getArgOperand(SizeArg))->getZExtValue();
@@ -306,7 +307,7 @@ class CoroIdAsyncInst : public AnyCoroIdInst {
306307
enum { SizeArg, AlignArg, StorageArg, AsyncFuncPtrArg };
307308

308309
public:
309-
void checkWellFormed() const;
310+
LLVM_ABI void checkWellFormed() const;
310311

311312
/// The initial async function context size. The fields of which are reserved
312313
/// for use by the frontend. The frame will be allocated as a tail of this
@@ -568,7 +569,7 @@ class CoroSuspendAsyncInst : public AnyCoroSuspendInst {
568569
MustTailCallFuncArg
569570
};
570571

571-
void checkWellFormed() const;
572+
LLVM_ABI void checkWellFormed() const;
572573

573574
unsigned getStorageArgumentIndex() const {
574575
auto *Arg = cast<ConstantInt>(getArgOperand(StorageArgNoArg));
@@ -722,7 +723,7 @@ class CoroAsyncEndInst : public AnyCoroEndInst {
722723
enum { FrameArg, UnwindArg, MustTailCallFuncArg };
723724

724725
public:
725-
void checkWellFormed() const;
726+
LLVM_ABI void checkWellFormed() const;
726727

727728
Function *getMustTailCallFunction() const {
728729
if (arg_size() < 3)

llvm/include/llvm/Transforms/Coroutines/CoroShape.h

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
#ifndef LLVM_TRANSFORMS_COROUTINES_COROSHAPE_H
1313
#define LLVM_TRANSFORMS_COROUTINES_COROSHAPE_H
1414

15+
#include "llvm/Support/Compiler.h"
1516
#include "llvm/IR/IRBuilder.h"
1617
#include "llvm/IR/PassManager.h"
1718
#include "llvm/Transforms/Coroutines/CoroInstr.h"
@@ -78,16 +79,16 @@ struct Shape {
7879
}
7980

8081
// Scan the function and collect the above intrinsics for later processing
81-
void analyze(Function &F, SmallVectorImpl<CoroFrameInst *> &CoroFrames,
82+
LLVM_ABI void analyze(Function &F, SmallVectorImpl<CoroFrameInst *> &CoroFrames,
8283
SmallVectorImpl<CoroSaveInst *> &UnusedCoroSaves,
8384
CoroPromiseInst *&CoroPromise);
8485
// If for some reason, we were not able to find coro.begin, bailout.
85-
void invalidateCoroutine(Function &F,
86+
LLVM_ABI void invalidateCoroutine(Function &F,
8687
SmallVectorImpl<CoroFrameInst *> &CoroFrames);
8788
// Perform ABI related initial transformation
88-
void initABI();
89+
LLVM_ABI void initABI();
8990
// Remove orphaned and unnecessary intrinsics
90-
void cleanCoroutine(SmallVectorImpl<CoroFrameInst *> &CoroFrames,
91+
LLVM_ABI void cleanCoroutine(SmallVectorImpl<CoroFrameInst *> &CoroFrames,
9192
SmallVectorImpl<CoroSaveInst *> &UnusedCoroSaves,
9293
CoroPromiseInst *CoroPromise);
9394

@@ -256,12 +257,12 @@ struct Shape {
256257
/// Allocate memory according to the rules of the active lowering.
257258
///
258259
/// \param CG - if non-null, will be updated for the new call
259-
Value *emitAlloc(IRBuilder<> &Builder, Value *Size, CallGraph *CG) const;
260+
LLVM_ABI Value *emitAlloc(IRBuilder<> &Builder, Value *Size, CallGraph *CG) const;
260261

261262
/// Deallocate memory according to the rules of the active lowering.
262263
///
263264
/// \param CG - if non-null, will be updated for the new call
264-
void emitDealloc(IRBuilder<> &Builder, Value *Ptr, CallGraph *CG) const;
265+
LLVM_ABI void emitDealloc(IRBuilder<> &Builder, Value *Ptr, CallGraph *CG) const;
265266

266267
Shape() = default;
267268
explicit Shape(Function &F) {

llvm/include/llvm/Transforms/Coroutines/CoroSplit.h

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
#ifndef LLVM_TRANSFORMS_COROUTINES_COROSPLIT_H
1616
#define LLVM_TRANSFORMS_COROUTINES_COROSPLIT_H
1717

18+
#include "llvm/Support/Compiler.h"
1819
#include "llvm/Analysis/CGSCCPassManager.h"
1920
#include "llvm/Analysis/LazyCallGraph.h"
2021
#include "llvm/IR/PassManager.h"
@@ -31,19 +32,19 @@ struct CoroSplitPass : PassInfoMixin<CoroSplitPass> {
3132
using BaseABITy =
3233
std::function<std::unique_ptr<coro::BaseABI>(Function &, coro::Shape &)>;
3334

34-
CoroSplitPass(bool OptimizeFrame = false);
35+
LLVM_ABI CoroSplitPass(bool OptimizeFrame = false);
3536

36-
CoroSplitPass(SmallVector<BaseABITy> GenCustomABIs,
37+
LLVM_ABI CoroSplitPass(SmallVector<BaseABITy> GenCustomABIs,
3738
bool OptimizeFrame = false);
3839

39-
CoroSplitPass(std::function<bool(Instruction &)> MaterializableCallback,
40+
LLVM_ABI CoroSplitPass(std::function<bool(Instruction &)> MaterializableCallback,
4041
bool OptimizeFrame = false);
4142

42-
CoroSplitPass(std::function<bool(Instruction &)> MaterializableCallback,
43+
LLVM_ABI CoroSplitPass(std::function<bool(Instruction &)> MaterializableCallback,
4344
SmallVector<BaseABITy> GenCustomABIs,
4445
bool OptimizeFrame = false);
4546

46-
PreservedAnalyses run(LazyCallGraph::SCC &C, CGSCCAnalysisManager &AM,
47+
LLVM_ABI PreservedAnalyses run(LazyCallGraph::SCC &C, CGSCCAnalysisManager &AM,
4748
LazyCallGraph &CG, CGSCCUpdateResult &UR);
4849

4950
static bool isRequired() { return true; }

llvm/include/llvm/Transforms/Coroutines/MaterializationUtils.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
//
77
//===----------------------------------------------------------------------===//
88

9+
#include "llvm/Support/Compiler.h"
910
#include "llvm/Transforms/Coroutines/SuspendCrossingInfo.h"
1011

1112
#ifndef LLVM_TRANSFORMS_COROUTINES_MATERIALIZATIONUTILS_H
@@ -16,10 +17,10 @@ namespace llvm {
1617
namespace coro {
1718

1819
// True if I is trivially rematerialzable, e.g. InsertElementInst
19-
bool isTriviallyMaterializable(Instruction &I);
20+
LLVM_ABI bool isTriviallyMaterializable(Instruction &I);
2021

2122
// Performs rematerialization, invoked from buildCoroutineFrame.
22-
void doRematerializations(Function &F, SuspendCrossingInfo &Checker,
23+
LLVM_ABI void doRematerializations(Function &F, SuspendCrossingInfo &Checker,
2324
std::function<bool(Instruction &)> IsMaterializable);
2425

2526
} // namespace coro

llvm/include/llvm/Transforms/Coroutines/SuspendCrossingInfo.h

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
#ifndef LLVM_TRANSFORMS_COROUTINES_SUSPENDCROSSINGINFO_H
1616
#define LLVM_TRANSFORMS_COROUTINES_SUSPENDCROSSINGINFO_H
1717

18+
#include "llvm/Support/Compiler.h"
1819
#include "llvm/ADT/BitVector.h"
1920
#include "llvm/ADT/PostOrderIterator.h"
2021
#include "llvm/ADT/SmallVector.h"
@@ -102,18 +103,18 @@ class SuspendCrossingInfo {
102103
ModuleSlotTracker &MST) const;
103104
#endif
104105

105-
SuspendCrossingInfo(Function &F,
106+
LLVM_ABI SuspendCrossingInfo(Function &F,
106107
const SmallVectorImpl<AnyCoroSuspendInst *> &CoroSuspends,
107108
const SmallVectorImpl<AnyCoroEndInst *> &CoroEnds);
108109

109110
/// Returns true if there is a path from \p From to \p To crossing a suspend
110111
/// point without crossing \p From a 2nd time.
111-
bool hasPathCrossingSuspendPoint(BasicBlock *From, BasicBlock *To) const;
112+
LLVM_ABI bool hasPathCrossingSuspendPoint(BasicBlock *From, BasicBlock *To) const;
112113

113114
/// Returns true if there is a path from \p From to \p To crossing a suspend
114115
/// point without crossing \p From a 2nd time. If \p From is the same as \p To
115116
/// this will also check if there is a looping path crossing a suspend point.
116-
bool hasPathOrLoopCrossingSuspendPoint(BasicBlock *From,
117+
LLVM_ABI bool hasPathOrLoopCrossingSuspendPoint(BasicBlock *From,
117118
BasicBlock *To) const;
118119

119120
bool isDefinitionAcrossSuspend(BasicBlock *DefBB, User *U) const {

llvm/include/llvm/Transforms/HipStdPar/HipStdPar.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
#ifndef LLVM_TRANSFORMS_HIPSTDPAR_HIPSTDPAR_H
1919
#define LLVM_TRANSFORMS_HIPSTDPAR_HIPSTDPAR_H
2020

21+
#include "llvm/Support/Compiler.h"
2122
#include "llvm/IR/PassManager.h"
2223

2324
namespace llvm {
@@ -27,15 +28,15 @@ class Module;
2728
class HipStdParAcceleratorCodeSelectionPass
2829
: public PassInfoMixin<HipStdParAcceleratorCodeSelectionPass> {
2930
public:
30-
PreservedAnalyses run(Module &M, ModuleAnalysisManager &MAM);
31+
LLVM_ABI PreservedAnalyses run(Module &M, ModuleAnalysisManager &MAM);
3132

3233
static bool isRequired() { return true; }
3334
};
3435

3536
class HipStdParAllocationInterpositionPass
3637
: public PassInfoMixin<HipStdParAllocationInterpositionPass> {
3738
public:
38-
PreservedAnalyses run(Module &M, ModuleAnalysisManager &MAM);
39+
LLVM_ABI PreservedAnalyses run(Module &M, ModuleAnalysisManager &MAM);
3940

4041
static bool isRequired() { return true; }
4142
};

llvm/include/llvm/Transforms/IPO.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,29 +24,29 @@ class raw_ostream;
2424
/// createDeadArgEliminationPass - This pass removes arguments from functions
2525
/// which are not used by the body of the function.
2626
///
27-
ModulePass *createDeadArgEliminationPass();
27+
LLVM_ABI ModulePass *createDeadArgEliminationPass();
2828

2929
/// DeadArgHacking pass - Same as DAE, but delete arguments of external
3030
/// functions as well. This is definitely not safe, and should only be used by
3131
/// bugpoint.
32-
ModulePass *createDeadArgHackingPass();
32+
LLVM_ABI ModulePass *createDeadArgHackingPass();
3333

3434
//===----------------------------------------------------------------------===//
3535
//
3636
/// createLoopExtractorPass - This pass extracts all natural loops from the
3737
/// program into a function if it can.
3838
///
39-
Pass *createLoopExtractorPass();
39+
LLVM_ABI Pass *createLoopExtractorPass();
4040

4141
/// createSingleLoopExtractorPass - This pass extracts one natural loop from the
4242
/// program into a function if it can. This is used by bugpoint.
4343
///
44-
Pass *createSingleLoopExtractorPass();
44+
LLVM_ABI Pass *createSingleLoopExtractorPass();
4545

4646
//===----------------------------------------------------------------------===//
4747
/// createBarrierNoopPass - This pass is purely a module pass barrier in a pass
4848
/// manager.
49-
ModulePass *createBarrierNoopPass();
49+
LLVM_ABI ModulePass *createBarrierNoopPass();
5050

5151
/// What to do with the summary when running passes that operate on it.
5252
enum class PassSummaryAction {

llvm/include/llvm/Transforms/IPO/AlwaysInliner.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
#ifndef LLVM_TRANSFORMS_IPO_ALWAYSINLINER_H
1515
#define LLVM_TRANSFORMS_IPO_ALWAYSINLINER_H
1616

17+
#include "llvm/Support/Compiler.h"
1718
#include "llvm/IR/PassManager.h"
1819

1920
namespace llvm {
@@ -36,13 +37,13 @@ class AlwaysInlinerPass : public PassInfoMixin<AlwaysInlinerPass> {
3637
AlwaysInlinerPass(bool InsertLifetime = true)
3738
: InsertLifetime(InsertLifetime) {}
3839

39-
PreservedAnalyses run(Module &M, ModuleAnalysisManager &);
40+
LLVM_ABI PreservedAnalyses run(Module &M, ModuleAnalysisManager &);
4041
static bool isRequired() { return true; }
4142
};
4243

4344
/// Create a legacy pass manager instance of a pass to inline and remove
4445
/// functions marked as "always_inline".
45-
Pass *createAlwaysInlinerLegacyPass(bool InsertLifetime = true);
46+
LLVM_ABI Pass *createAlwaysInlinerLegacyPass(bool InsertLifetime = true);
4647

4748
}
4849

0 commit comments

Comments
 (0)