Skip to content

Commit da2bc32

Browse files
committed
[llvm] manual fixups to export annotations
1 parent fe5a1cd commit da2bc32

26 files changed

+79
-59
lines changed

llvm/include/llvm/Analysis/AssumptionCache.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ class AssumptionCache {
174174
class AssumptionAnalysis : public AnalysisInfoMixin<AssumptionAnalysis> {
175175
friend AnalysisInfoMixin<AssumptionAnalysis>;
176176

177-
static AnalysisKey Key;
177+
LLVM_ABI static AnalysisKey Key;
178178

179179
public:
180180
using Result = AssumptionCache;

llvm/include/llvm/Analysis/BlockFrequencyInfo.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ class BlockFrequencyAnalysis
120120
: public AnalysisInfoMixin<BlockFrequencyAnalysis> {
121121
friend AnalysisInfoMixin<BlockFrequencyAnalysis>;
122122

123-
static AnalysisKey Key;
123+
LLVM_ABI static AnalysisKey Key;
124124

125125
public:
126126
/// Provide the result type for this analysis pass.

llvm/include/llvm/Analysis/BranchProbabilityInfo.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -428,7 +428,7 @@ class BranchProbabilityAnalysis
428428
: public AnalysisInfoMixin<BranchProbabilityAnalysis> {
429429
friend AnalysisInfoMixin<BranchProbabilityAnalysis>;
430430

431-
static AnalysisKey Key;
431+
LLVM_ABI static AnalysisKey Key;
432432

433433
public:
434434
/// Provide the result type for this analysis pass.

llvm/include/llvm/Analysis/CGSCCPassManager.h

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -109,9 +109,10 @@ class Module;
109109
#define DEBUG_TYPE "cgscc"
110110

111111
/// Extern template declaration for the analysis set for this IR unit.
112-
extern template class AllAnalysesOn<LazyCallGraph::SCC>;
112+
extern template class LLVM_TEMPLATE_ABI AllAnalysesOn<LazyCallGraph::SCC>;
113113

114-
extern template class AnalysisManager<LazyCallGraph::SCC, LazyCallGraph &>;
114+
extern template class LLVM_TEMPLATE_ABI
115+
AnalysisManager<LazyCallGraph::SCC, LazyCallGraph &>;
115116

116117
/// The CGSCC analysis manager.
117118
///
@@ -204,9 +205,10 @@ CGSCCAnalysisManagerModuleProxy::run(Module &M, ModuleAnalysisManager &AM);
204205

205206
// Ensure the \c CGSCCAnalysisManagerModuleProxy is provided as an extern
206207
// template.
207-
extern template class InnerAnalysisManagerProxy<CGSCCAnalysisManager, Module>;
208+
extern template class LLVM_TEMPLATE_ABI
209+
InnerAnalysisManagerProxy<CGSCCAnalysisManager, Module>;
208210

209-
extern template class OuterAnalysisManagerProxy<
211+
extern template class LLVM_TEMPLATE_ABI OuterAnalysisManagerProxy<
210212
ModuleAnalysisManager, LazyCallGraph::SCC, LazyCallGraph &>;
211213

212214
/// A proxy from a \c ModuleAnalysisManager to an \c SCC.
@@ -403,10 +405,11 @@ class FunctionAnalysisManagerCGSCCProxy
403405
private:
404406
friend AnalysisInfoMixin<FunctionAnalysisManagerCGSCCProxy>;
405407

406-
static AnalysisKey Key;
408+
LLVM_ABI static AnalysisKey Key;
407409
};
408410

409-
extern template class OuterAnalysisManagerProxy<CGSCCAnalysisManager, Function>;
411+
extern template class LLVM_TEMPLATE_ABI
412+
OuterAnalysisManagerProxy<CGSCCAnalysisManager, Function>;
410413

411414
/// A proxy from a \c CGSCCAnalysisManager to a \c Function.
412415
using CGSCCAnalysisManagerFunctionProxy =

llvm/include/llvm/Analysis/DomTreeUpdater.h

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,12 @@
2323

2424
namespace llvm {
2525

26+
class DomTreeUpdater;
2627
class PostDominatorTree;
2728

29+
extern template class LLVM_TEMPLATE_ABI
30+
GenericDomTreeUpdater<DomTreeUpdater, DominatorTree, PostDominatorTree>;
31+
2832
class DomTreeUpdater
2933
: public GenericDomTreeUpdater<DomTreeUpdater, DominatorTree,
3034
PostDominatorTree> {
@@ -114,17 +118,14 @@ class DomTreeUpdater
114118
bool forceFlushDeletedBB();
115119
};
116120

117-
extern template class GenericDomTreeUpdater<DomTreeUpdater, DominatorTree,
118-
PostDominatorTree>;
119-
120-
extern template void
121+
extern template LLVM_TEMPLATE_ABI void
121122
GenericDomTreeUpdater<DomTreeUpdater, DominatorTree,
122123
PostDominatorTree>::recalculate(Function &F);
123124

124-
extern template void
125+
extern template LLVM_TEMPLATE_ABI void
125126
GenericDomTreeUpdater<DomTreeUpdater, DominatorTree, PostDominatorTree>::
126127
applyUpdatesImpl</*IsForward=*/true>();
127-
extern template void
128+
extern template LLVM_TEMPLATE_ABI void
128129
GenericDomTreeUpdater<DomTreeUpdater, DominatorTree, PostDominatorTree>::
129130
applyUpdatesImpl</*IsForward=*/false>();
130131
} // namespace llvm

llvm/include/llvm/Analysis/GlobalsModRef.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ class GlobalsAAResult : public AAResultBase {
130130
/// Analysis pass providing a never-invalidated alias analysis result.
131131
class GlobalsAA : public AnalysisInfoMixin<GlobalsAA> {
132132
friend AnalysisInfoMixin<GlobalsAA>;
133-
static AnalysisKey Key;
133+
LLVM_ABI static AnalysisKey Key;
134134

135135
public:
136136
typedef GlobalsAAResult Result;

llvm/include/llvm/Analysis/LastRunTrackingAnalysis.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ class LastRunTrackingInfo {
9292
class LastRunTrackingAnalysis final
9393
: public AnalysisInfoMixin<LastRunTrackingAnalysis> {
9494
friend AnalysisInfoMixin<LastRunTrackingAnalysis>;
95-
static AnalysisKey Key;
95+
LLVM_ABI static AnalysisKey Key;
9696

9797
public:
9898
using Result = LastRunTrackingInfo;

llvm/include/llvm/Analysis/LazyCallGraph.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1263,7 +1263,7 @@ template <> struct GraphTraits<LazyCallGraph *> {
12631263
class LazyCallGraphAnalysis : public AnalysisInfoMixin<LazyCallGraphAnalysis> {
12641264
friend AnalysisInfoMixin<LazyCallGraphAnalysis>;
12651265

1266-
static AnalysisKey Key;
1266+
LLVM_ABI static AnalysisKey Key;
12671267

12681268
public:
12691269
/// Inform generic clients of the result type.

llvm/include/llvm/Analysis/LoopAnalysisManager.h

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -65,9 +65,10 @@ struct LoopStandardAnalysisResults {
6565
};
6666

6767
/// Extern template declaration for the analysis set for this IR unit.
68-
extern template class AllAnalysesOn<Loop>;
68+
extern template class LLVM_TEMPLATE_ABI AllAnalysesOn<Loop>;
6969

70-
extern template class AnalysisManager<Loop, LoopStandardAnalysisResults &>;
70+
extern template class LLVM_TEMPLATE_ABI
71+
AnalysisManager<Loop, LoopStandardAnalysisResults &>;
7172
/// The loop analysis manager.
7273
///
7374
/// See the documentation for the AnalysisManager template for detail
@@ -149,10 +150,11 @@ LoopAnalysisManagerFunctionProxy::run(Function &F, FunctionAnalysisManager &AM);
149150

150151
// Ensure the \c LoopAnalysisManagerFunctionProxy is provided as an extern
151152
// template.
152-
extern template class InnerAnalysisManagerProxy<LoopAnalysisManager, Function>;
153+
extern template class LLVM_TEMPLATE_ABI
154+
InnerAnalysisManagerProxy<LoopAnalysisManager, Function>;
153155

154-
extern template class OuterAnalysisManagerProxy<FunctionAnalysisManager, Loop,
155-
LoopStandardAnalysisResults &>;
156+
extern template class LLVM_TEMPLATE_ABI OuterAnalysisManagerProxy<
157+
FunctionAnalysisManager, Loop, LoopStandardAnalysisResults &>;
156158
/// A proxy from a \c FunctionAnalysisManager to a \c Loop.
157159
typedef OuterAnalysisManagerProxy<FunctionAnalysisManager, Loop,
158160
LoopStandardAnalysisResults &>

llvm/include/llvm/Analysis/LoopInfo.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ class ScalarEvolution;
3333
class raw_ostream;
3434

3535
// Implementation in Support/GenericLoopInfoImpl.h
36-
extern template class LoopBase<BasicBlock, Loop>;
36+
extern template class LLVM_TEMPLATE_ABI LoopBase<BasicBlock, Loop>;
3737

3838
/// Represents a single loop in the control flow graph. Note that not all SCCs
3939
/// in the CFG are necessarily loops.
@@ -403,7 +403,7 @@ class LLVM_ABI Loop : public LoopBase<BasicBlock, Loop> {
403403
};
404404

405405
// Implementation in Support/GenericLoopInfoImpl.h
406-
extern template class LoopInfoBase<BasicBlock, Loop>;
406+
extern template class LLVM_TEMPLATE_ABI LoopInfoBase<BasicBlock, Loop>;
407407

408408
class LoopInfo : public LoopInfoBase<BasicBlock, Loop> {
409409
typedef LoopInfoBase<BasicBlock, Loop> BaseT;
@@ -568,7 +568,7 @@ template <> struct GraphTraits<Loop *> {
568568
/// Analysis pass that exposes the \c LoopInfo for a function.
569569
class LoopAnalysis : public AnalysisInfoMixin<LoopAnalysis> {
570570
friend AnalysisInfoMixin<LoopAnalysis>;
571-
static AnalysisKey Key;
571+
LLVM_ABI static AnalysisKey Key;
572572

573573
public:
574574
typedef LoopInfo Result;

llvm/include/llvm/Analysis/LoopUnrollAnalyzer.h

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
#include "llvm/ADT/DenseMap.h"
2020
#include "llvm/Analysis/ScalarEvolution.h"
2121
#include "llvm/IR/InstVisitor.h"
22+
#include "llvm/Support/Compiler.h"
2223

2324
// This class is used to get an estimate of the optimization effects that we
2425
// could get from complete loop unrolling. It comes from the fact that some
@@ -83,12 +84,12 @@ class UnrolledInstAnalyzer : private InstVisitor<UnrolledInstAnalyzer, bool> {
8384

8485
bool simplifyInstWithSCEV(Instruction *I);
8586

86-
bool visitInstruction(Instruction &I);
87-
bool visitBinaryOperator(BinaryOperator &I);
88-
bool visitLoad(LoadInst &I);
89-
bool visitCastInst(CastInst &I);
90-
bool visitCmpInst(CmpInst &I);
91-
bool visitPHINode(PHINode &PN);
87+
LLVM_ABI bool visitInstruction(Instruction &I);
88+
LLVM_ABI bool visitBinaryOperator(BinaryOperator &I);
89+
LLVM_ABI bool visitLoad(LoadInst &I);
90+
LLVM_ABI bool visitCastInst(CastInst &I);
91+
LLVM_ABI bool visitCmpInst(CmpInst &I);
92+
LLVM_ABI bool visitPHINode(PHINode &PN);
9293
};
9394
}
9495
#endif

llvm/include/llvm/Analysis/MemorySSA.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -936,7 +936,7 @@ class MemorySSAUtil {
936936
class MemorySSAAnalysis : public AnalysisInfoMixin<MemorySSAAnalysis> {
937937
friend AnalysisInfoMixin<MemorySSAAnalysis>;
938938

939-
static AnalysisKey Key;
939+
LLVM_ABI static AnalysisKey Key;
940940

941941
public:
942942
// Wrap MemorySSA result to ensure address stability of internal MemorySSA

llvm/include/llvm/Analysis/MustExecute.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -344,7 +344,7 @@ struct MustBeExecutedIterator {
344344
LLVM_ABI MustBeExecutedIterator(ExplorerTy &Explorer, const Instruction *I);
345345

346346
/// Reset the iterator to its initial state pointing at \p I.
347-
void reset(const Instruction *I);
347+
LLVM_ABI void reset(const Instruction *I);
348348

349349
/// Reset the iterator to point at \p I, keep cached state.
350350
void resetInstruction(const Instruction *I);

llvm/include/llvm/Analysis/Passes.h

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

17+
#include "llvm/Support/Compiler.h"
18+
1719
namespace llvm {
1820
class FunctionPass;
1921
class ImmutablePass;

llvm/include/llvm/Analysis/PhiValues.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ class PhiValues {
115115
/// which will get filled in as it's used.
116116
class PhiValuesAnalysis : public AnalysisInfoMixin<PhiValuesAnalysis> {
117117
friend AnalysisInfoMixin<PhiValuesAnalysis>;
118-
static AnalysisKey Key;
118+
LLVM_ABI static AnalysisKey Key;
119119

120120
public:
121121
using Result = PhiValues;

llvm/include/llvm/Analysis/PostDominators.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ class PostDominatorTreeAnalysis
4949
: public AnalysisInfoMixin<PostDominatorTreeAnalysis> {
5050
friend AnalysisInfoMixin<PostDominatorTreeAnalysis>;
5151

52-
static AnalysisKey Key;
52+
LLVM_ABI static AnalysisKey Key;
5353

5454
public:
5555
/// Provide the result type for this analysis pass.

llvm/include/llvm/Analysis/ScalarEvolution.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2347,7 +2347,7 @@ class ScalarEvolutionAnalysis
23472347
: public AnalysisInfoMixin<ScalarEvolutionAnalysis> {
23482348
friend AnalysisInfoMixin<ScalarEvolutionAnalysis>;
23492349

2350-
static AnalysisKey Key;
2350+
LLVM_ABI static AnalysisKey Key;
23512351

23522352
public:
23532353
using Result = ScalarEvolution;

llvm/include/llvm/Analysis/TargetLibraryInfo.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -636,7 +636,7 @@ class TargetLibraryAnalysis : public AnalysisInfoMixin<TargetLibraryAnalysis> {
636636

637637
private:
638638
friend AnalysisInfoMixin<TargetLibraryAnalysis>;
639-
static AnalysisKey Key;
639+
LLVM_ABI static AnalysisKey Key;
640640

641641
std::optional<TargetLibraryInfoImpl> BaselineInfoImpl;
642642
};

llvm/include/llvm/Analysis/TargetTransformInfo.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1987,7 +1987,7 @@ class TargetIRAnalysis : public AnalysisInfoMixin<TargetIRAnalysis> {
19871987

19881988
private:
19891989
friend AnalysisInfoMixin<TargetIRAnalysis>;
1990-
static AnalysisKey Key;
1990+
LLVM_ABI static AnalysisKey Key;
19911991

19921992
/// The callback used to produce a result.
19931993
///

llvm/include/llvm/Analysis/TensorSpec.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ LLVM_ABI std::optional<TensorSpec>
127127
getTensorSpecFromJSON(LLVMContext &Ctx, const json::Value &Value);
128128

129129
#define TFUTILS_GETDATATYPE_DEF(T, Name) \
130-
template <> TensorType TensorSpec::getDataType<T>();
130+
template <> LLVM_ABI TensorType TensorSpec::getDataType<T>();
131131
SUPPORTED_TENSOR_TYPES(TFUTILS_GETDATATYPE_DEF)
132132

133133
#undef TFUTILS_GETDATATYPE_DEF

llvm/include/llvm/Analysis/Utils/Local.h

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

17+
#include "llvm/Support/Compiler.h"
18+
1719
namespace llvm {
1820

1921
class DataLayout;

llvm/include/llvm/Analysis/Utils/TrainingLogger.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,11 +54,11 @@
5454
#define LLVM_ANALYSIS_UTILS_TRAININGLOGGER_H
5555

5656
#include "llvm/Config/llvm-config.h"
57-
#include "llvm/Support/Compiler.h"
5857

5958
#include "llvm/ADT/StringMap.h"
6059
#include "llvm/Analysis/TensorSpec.h"
6160
#include "llvm/IR/LLVMContext.h"
61+
#include "llvm/Support/Compiler.h"
6262
#include "llvm/Support/JSON.h"
6363

6464
#include <memory>

llvm/lib/Analysis/CGSCCPassManager.cpp

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
#include "llvm/IR/ValueHandle.h"
2525
#include "llvm/Support/Casting.h"
2626
#include "llvm/Support/CommandLine.h"
27+
#include "llvm/Support/Compiler.h"
2728
#include "llvm/Support/Debug.h"
2829
#include "llvm/Support/ErrorHandling.h"
2930
#include "llvm/Support/raw_ostream.h"
@@ -47,14 +48,17 @@ static cl::opt<bool> AbortOnMaxDevirtIterationsReached(
4748
AnalysisKey ShouldNotRunFunctionPassesAnalysis::Key;
4849

4950
// Explicit instantiations for the core proxy templates.
50-
template class AllAnalysesOn<LazyCallGraph::SCC>;
51-
template class AnalysisManager<LazyCallGraph::SCC, LazyCallGraph &>;
51+
template class LLVM_EXPORT_TEMPLATE AllAnalysesOn<LazyCallGraph::SCC>;
52+
template class LLVM_EXPORT_TEMPLATE
53+
AnalysisManager<LazyCallGraph::SCC, LazyCallGraph &>;
5254
template class PassManager<LazyCallGraph::SCC, CGSCCAnalysisManager,
5355
LazyCallGraph &, CGSCCUpdateResult &>;
54-
template class InnerAnalysisManagerProxy<CGSCCAnalysisManager, Module>;
55-
template class OuterAnalysisManagerProxy<ModuleAnalysisManager,
56-
LazyCallGraph::SCC, LazyCallGraph &>;
57-
template class OuterAnalysisManagerProxy<CGSCCAnalysisManager, Function>;
56+
template class LLVM_EXPORT_TEMPLATE
57+
InnerAnalysisManagerProxy<CGSCCAnalysisManager, Module>;
58+
template class LLVM_EXPORT_TEMPLATE OuterAnalysisManagerProxy<
59+
ModuleAnalysisManager, LazyCallGraph::SCC, LazyCallGraph &>;
60+
template class LLVM_EXPORT_TEMPLATE
61+
OuterAnalysisManagerProxy<CGSCCAnalysisManager, Function>;
5862

5963
/// Explicitly specialize the pass manager run method to handle call graph
6064
/// updates.

llvm/lib/Analysis/DomTreeUpdater.cpp

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,22 +16,23 @@
1616
#include "llvm/Analysis/PostDominators.h"
1717
#include "llvm/IR/Constants.h"
1818
#include "llvm/IR/Instructions.h"
19+
#include "llvm/Support/Compiler.h"
1920
#include "llvm/Support/GenericDomTree.h"
2021
#include <functional>
2122

2223
namespace llvm {
2324

24-
template class GenericDomTreeUpdater<DomTreeUpdater, DominatorTree,
25-
PostDominatorTree>;
25+
template class LLVM_EXPORT_TEMPLATE
26+
GenericDomTreeUpdater<DomTreeUpdater, DominatorTree, PostDominatorTree>;
2627

27-
template void
28+
template LLVM_EXPORT_TEMPLATE void
2829
GenericDomTreeUpdater<DomTreeUpdater, DominatorTree,
2930
PostDominatorTree>::recalculate(Function &F);
3031

31-
template void
32+
template LLVM_EXPORT_TEMPLATE void
3233
GenericDomTreeUpdater<DomTreeUpdater, DominatorTree, PostDominatorTree>::
3334
applyUpdatesImpl</*IsForward=*/true>();
34-
template void
35+
template LLVM_EXPORT_TEMPLATE void
3536
GenericDomTreeUpdater<DomTreeUpdater, DominatorTree, PostDominatorTree>::
3637
applyUpdatesImpl</*IsForward=*/false>();
3738

0 commit comments

Comments
 (0)