Skip to content

Commit d72edfc

Browse files
committed
[llvm] manual fix-ups to IDS codemod of Transforms library
1 parent 3582c92 commit d72edfc

File tree

18 files changed

+45
-17
lines changed

18 files changed

+45
-17
lines changed

llvm/include/llvm/Transforms/IPO/Attributor.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6477,8 +6477,6 @@ struct AADenormalFPMath
64776477
LLVM_ABI static const char ID;
64786478
};
64796479

6480-
raw_ostream &operator<<(raw_ostream &, const AAPointerInfo::Access &);
6481-
64826480
/// Run options, used by the pass manager.
64836481
enum AttributorRunOption {
64846482
NONE = 0,

llvm/include/llvm/Transforms/Instrumentation/PGOInstrumentation.h

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
#include "llvm/ADT/IntrusiveRefCntPtr.h"
2121
#include "llvm/IR/PassManager.h"
2222
#include "llvm/Support/CommandLine.h"
23+
#include "llvm/Support/VirtualFileSystem.h"
2324
#include <cstdint>
2425
#include <string>
2526

@@ -31,10 +32,6 @@ class Function;
3132
class Instruction;
3233
class Module;
3334

34-
namespace vfs {
35-
class FileSystem;
36-
} // namespace vfs
37-
3835
/// The instrumentation (profile-instr-gen) pass for IR based PGO.
3936
// We use this pass to create COMDAT profile variables for context
4037
// sensitive PGO (CSPGO). The reason to have a pass for this is CSPGO

llvm/include/llvm/Transforms/Utils.h

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

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

1921
class ModulePass;

llvm/include/llvm/Transforms/Utils/CodeMoverUtils.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@
1717
#ifndef LLVM_TRANSFORMS_UTILS_CODEMOVERUTILS_H
1818
#define LLVM_TRANSFORMS_UTILS_CODEMOVERUTILS_H
1919

20+
#include "llvm/Support/Compiler.h"
21+
2022
namespace llvm {
2123

2224
class BasicBlock;

llvm/include/llvm/Transforms/Utils/IntegerDivision.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@
1616
#ifndef LLVM_TRANSFORMS_UTILS_INTEGERDIVISION_H
1717
#define LLVM_TRANSFORMS_UTILS_INTEGERDIVISION_H
1818

19+
#include "llvm/Support/Compiler.h"
20+
1921
namespace llvm {
2022
class BinaryOperator;
2123
}

llvm/include/llvm/Transforms/Utils/LoopRotationUtils.h

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

16+
#include "llvm/Support/Compiler.h"
17+
1618
namespace llvm {
1719

1820
class AssumptionCache;

llvm/include/llvm/Transforms/Utils/LoopUtils.h

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -508,7 +508,7 @@ LLVM_ABI void setProfileInfoAfterUnrolling(Loop *OrigLoop, Loop *UnrolledLoop,
508508
/// structure, so we append to it in *reverse* postorder.
509509
/// For trees, a preorder traversal is a viable reverse postorder, so we
510510
/// actually append using a preorder walk algorithm.
511-
template <typename RangeT>
511+
template <typename RangeT> LLVM_TEMPLATE_ABI
512512
void appendLoopsToWorklist(RangeT &&, SmallPriorityWorklist<Loop *, 4> &);
513513
/// Utility that implements appending of loops onto a worklist given a range.
514514
/// It has the same behavior as appendLoopsToWorklist, but assumes the range of
@@ -517,6 +517,13 @@ template <typename RangeT>
517517
void appendReversedLoopsToWorklist(RangeT &&,
518518
SmallPriorityWorklist<Loop *, 4> &);
519519

520+
extern template LLVM_TEMPLATE_ABI void llvm::appendLoopsToWorklist<ArrayRef<Loop *> &>(
521+
ArrayRef<Loop *> &Loops, SmallPriorityWorklist<Loop *, 4> &Worklist);
522+
523+
extern template LLVM_TEMPLATE_ABI void
524+
llvm::appendLoopsToWorklist<Loop &>(Loop &L,
525+
SmallPriorityWorklist<Loop *, 4> &Worklist);
526+
520527
/// Utility that implements appending of loops onto a worklist given LoopInfo.
521528
/// Calls the templated utility taking a Range of loops, handing it the Loops
522529
/// in LoopInfo, iterated in reverse. This is because the loops are stored in

llvm/include/llvm/Transforms/Vectorize/SandboxVectorizer/DependencyGraph.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,9 @@ class DGNode;
4646
class MemDGNode;
4747
class DependencyGraph;
4848

49+
// Defined in Transforms/Vectorize/SandboxVectorizer/Interval.cpp
50+
extern template class LLVM_TEMPLATE_ABI Interval<MemDGNode>;
51+
4952
/// Iterate over both def-use and mem dependencies.
5053
class PredIterator {
5154
User::op_iterator OpIt;
@@ -461,7 +464,6 @@ class DependencyGraph {
461464
LLVM_DUMP_METHOD void dump() const;
462465
#endif // NDEBUG
463466
};
464-
465467
} // namespace llvm::sandboxir
466468

467469
#endif // LLVM_TRANSFORMS_VECTORIZE_SANDBOXVECTORIZER_DEPENDENCYGRAPH_H

llvm/include/llvm/Transforms/Vectorize/SandboxVectorizer/Interval.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222

2323
#include "llvm/ADT/ArrayRef.h"
2424
#include "llvm/SandboxIR/Instruction.h"
25+
#include "llvm/Support/Compiler.h"
2526
#include "llvm/Support/raw_ostream.h"
2627
#include <iterator>
2728
#include <type_traits>
@@ -235,6 +236,9 @@ template <typename T> class Interval {
235236
#endif
236237
};
237238

239+
// Defined in Transforms/Vectorize/SandboxVectorizer/Interval.cpp
240+
extern template class LLVM_TEMPLATE_ABI Interval<Instruction>;
241+
238242
} // namespace llvm::sandboxir
239243

240244
#endif // LLVM_TRANSFORMS_VECTORIZE_SANDBOXVECTORIZER_INSTRINTERVAL_H

llvm/include/llvm/Transforms/Vectorize/SandboxVectorizer/SeedCollector.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -289,6 +289,10 @@ class SeedContainer {
289289
#endif // NDEBUG
290290
};
291291

292+
// Explicit instantiations
293+
extern template LLVM_TEMPLATE_ABI void SeedContainer::insert<LoadInst>(LoadInst *);
294+
extern template LLVM_TEMPLATE_ABI void SeedContainer::insert<StoreInst>(StoreInst *);
295+
292296
class SeedCollector {
293297
SeedContainer StoreSeeds;
294298
SeedContainer LoadSeeds;

llvm/lib/Transforms/Coroutines/CoroFrame.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
#include "llvm/IR/InstIterator.h"
2727
#include "llvm/IR/IntrinsicInst.h"
2828
#include "llvm/IR/Module.h"
29+
#include "llvm/Support/Compiler.h"
2930
#include "llvm/Support/Debug.h"
3031
#include "llvm/Support/OptimizedStructLayout.h"
3132
#include "llvm/Transforms/Coroutines/ABI.h"

llvm/lib/Transforms/Instrumentation/InstrProfiling.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@
4747
#include "llvm/ProfileData/InstrProfCorrelator.h"
4848
#include "llvm/Support/Casting.h"
4949
#include "llvm/Support/CommandLine.h"
50+
#include "llvm/Support/Compiler.h"
5051
#include "llvm/Support/Error.h"
5152
#include "llvm/Support/ErrorHandling.h"
5253
#include "llvm/TargetParser/Triple.h"
@@ -76,7 +77,7 @@ cl::opt<bool> DebugInfoCorrelate(
7677
"-profile-correlate=debug-info)"),
7778
cl::init(false));
7879

79-
cl::opt<InstrProfCorrelator::ProfCorrelatorKind> ProfileCorrelate(
80+
LLVM_ABI cl::opt<InstrProfCorrelator::ProfCorrelatorKind> ProfileCorrelate(
8081
"profile-correlate",
8182
cl::desc("Use debug info or binary file to correlate profiles."),
8283
cl::init(InstrProfCorrelator::NONE),

llvm/lib/Transforms/Instrumentation/PGOInstrumentation.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,7 @@
100100
#include "llvm/Support/CRC.h"
101101
#include "llvm/Support/Casting.h"
102102
#include "llvm/Support/CommandLine.h"
103+
#include "llvm/Support/Compiler.h"
103104
#include "llvm/Support/DOTGraphTraits.h"
104105
#include "llvm/Support/Debug.h"
105106
#include "llvm/Support/Error.h"
@@ -359,7 +360,7 @@ extern cl::opt<std::string> ViewBlockFreqFuncName;
359360
// ProfileData/InstrProf.cpp: -enable-vtable-value-profiling=
360361
extern cl::opt<bool> EnableVTableValueProfiling;
361362
extern cl::opt<bool> EnableVTableProfileUse;
362-
extern cl::opt<InstrProfCorrelator::ProfCorrelatorKind> ProfileCorrelate;
363+
LLVM_ABI extern cl::opt<InstrProfCorrelator::ProfCorrelatorKind> ProfileCorrelate;
363364
} // namespace llvm
364365

365366
namespace {

llvm/lib/Transforms/Utils/AssumeBundleBuilder.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,14 @@
2020
#include "llvm/IR/Module.h"
2121
#include "llvm/IR/Operator.h"
2222
#include "llvm/Support/CommandLine.h"
23+
#include "llvm/Support/Compiler.h"
2324
#include "llvm/Support/DebugCounter.h"
2425
#include "llvm/Transforms/Utils/Local.h"
2526

2627
using namespace llvm;
2728

2829
namespace llvm {
29-
cl::opt<bool> ShouldPreserveAllAttributes(
30+
LLVM_ABI cl::opt<bool> ShouldPreserveAllAttributes(
3031
"assume-preserve-all", cl::init(false), cl::Hidden,
3132
cl::desc("enable preservation of all attributes. even those that are "
3233
"unlikely to be useful"));

llvm/lib/Transforms/Utils/Local.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@
7171
#include "llvm/IR/ValueHandle.h"
7272
#include "llvm/Support/Casting.h"
7373
#include "llvm/Support/CommandLine.h"
74+
#include "llvm/Support/Compiler.h"
7475
#include "llvm/Support/Debug.h"
7576
#include "llvm/Support/ErrorHandling.h"
7677
#include "llvm/Support/KnownBits.h"

llvm/lib/Transforms/Utils/LoopUtils.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@
4141
#include "llvm/IR/ValueHandle.h"
4242
#include "llvm/InitializePasses.h"
4343
#include "llvm/Pass.h"
44+
#include "llvm/Support/Compiler.h"
4445
#include "llvm/Support/Debug.h"
4546
#include "llvm/Transforms/Utils/BasicBlockUtils.h"
4647
#include "llvm/Transforms/Utils/Local.h"
@@ -1820,10 +1821,10 @@ void llvm::appendLoopsToWorklist(RangeT &&Loops,
18201821
appendReversedLoopsToWorklist(reverse(Loops), Worklist);
18211822
}
18221823

1823-
template void llvm::appendLoopsToWorklist<ArrayRef<Loop *> &>(
1824+
template LLVM_EXPORT_TEMPLATE void llvm::appendLoopsToWorklist<ArrayRef<Loop *> &>(
18241825
ArrayRef<Loop *> &Loops, SmallPriorityWorklist<Loop *, 4> &Worklist);
18251826

1826-
template void
1827+
template LLVM_EXPORT_TEMPLATE void
18271828
llvm::appendLoopsToWorklist<Loop &>(Loop &L,
18281829
SmallPriorityWorklist<Loop *, 4> &Worklist);
18291830

llvm/lib/Transforms/Vectorize/SandboxVectorizer/Interval.cpp

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

99
#include "llvm/Transforms/Vectorize/SandboxVectorizer/Interval.h"
1010
#include "llvm/SandboxIR/Instruction.h"
11+
#include "llvm/Support/Compiler.h"
1112
#include "llvm/Support/Debug.h"
1213
#include "llvm/Transforms/Vectorize/SandboxVectorizer/DependencyGraph.h"
1314

@@ -42,7 +43,7 @@ template <typename T> void Interval<T>::print(raw_ostream &OS) const {
4243
template <typename T> void Interval<T>::dump() const { print(dbgs()); }
4344
#endif
4445

45-
template class Interval<Instruction>;
46-
template class Interval<MemDGNode>;
46+
template class LLVM_EXPORT_TEMPLATE Interval<Instruction>;
47+
template class LLVM_EXPORT_TEMPLATE Interval<MemDGNode>;
4748

4849
} // namespace llvm::sandboxir

llvm/lib/Transforms/Vectorize/SandboxVectorizer/SeedCollector.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
#include "llvm/IR/Type.h"
1313
#include "llvm/SandboxIR/Instruction.h"
1414
#include "llvm/SandboxIR/Utils.h"
15+
#include "llvm/Support/Compiler.h"
1516
#include "llvm/Support/Debug.h"
1617

1718
using namespace llvm;
@@ -119,8 +120,8 @@ template <typename LoadOrStoreT> void SeedContainer::insert(LoadOrStoreT *LSI) {
119120
}
120121

121122
// Explicit instantiations
122-
template void SeedContainer::insert<LoadInst>(LoadInst *);
123-
template void SeedContainer::insert<StoreInst>(StoreInst *);
123+
template LLVM_EXPORT_TEMPLATE void SeedContainer::insert<LoadInst>(LoadInst *);
124+
template LLVM_EXPORT_TEMPLATE void SeedContainer::insert<StoreInst>(StoreInst *);
124125

125126
#ifndef NDEBUG
126127
void SeedContainer::print(raw_ostream &OS) const {

0 commit comments

Comments
 (0)