Skip to content

Commit c55fff9

Browse files
committed
[llvm] manual fix-ups to IDS codemod of CGData and CodeGen libraries
1 parent c8fc8aa commit c55fff9

14 files changed

+45
-32
lines changed

llvm/include/llvm/CodeGen/GCMetadata.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@
4141
#include "llvm/IR/GCStrategy.h"
4242
#include "llvm/IR/PassManager.h"
4343
#include "llvm/Pass.h"
44+
#include "llvm/Support/Compiler.h"
4445
#include <algorithm>
4546
#include <cstddef>
4647
#include <cstdint>
@@ -200,7 +201,7 @@ class GCStrategyMap {
200201
class CollectorMetadataAnalysis
201202
: public AnalysisInfoMixin<CollectorMetadataAnalysis> {
202203
friend struct AnalysisInfoMixin<CollectorMetadataAnalysis>;
203-
static AnalysisKey Key;
204+
LLVM_ABI static AnalysisKey Key;
204205

205206
public:
206207
using Result = GCStrategyMap;
@@ -212,7 +213,7 @@ class CollectorMetadataAnalysis
212213
/// This pass depends on `CollectorMetadataAnalysis`.
213214
class GCFunctionAnalysis : public AnalysisInfoMixin<GCFunctionAnalysis> {
214215
friend struct AnalysisInfoMixin<GCFunctionAnalysis>;
215-
static AnalysisKey Key;
216+
LLVM_ABI static AnalysisKey Key;
216217

217218
public:
218219
using Result = GCFunctionInfo;

llvm/include/llvm/CodeGen/MachineDomTreeUpdater.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,18 +23,18 @@ namespace llvm {
2323
class MachinePostDominatorTree;
2424
class MachineDomTreeUpdater;
2525

26-
extern template class GenericDomTreeUpdater<
26+
extern template class LLVM_TEMPLATE_ABI GenericDomTreeUpdater<
2727
MachineDomTreeUpdater, MachineDominatorTree, MachinePostDominatorTree>;
2828

29-
extern template void
29+
extern template LLVM_TEMPLATE_ABI void
3030
GenericDomTreeUpdater<MachineDomTreeUpdater, MachineDominatorTree,
3131
MachinePostDominatorTree>::recalculate(MachineFunction
3232
&MF);
3333

34-
extern template void GenericDomTreeUpdater<
34+
extern template LLVM_TEMPLATE_ABI void GenericDomTreeUpdater<
3535
MachineDomTreeUpdater, MachineDominatorTree,
3636
MachinePostDominatorTree>::applyUpdatesImpl</*IsForward=*/true>();
37-
extern template void GenericDomTreeUpdater<
37+
extern template LLVM_TEMPLATE_ABI void GenericDomTreeUpdater<
3838
MachineDomTreeUpdater, MachineDominatorTree,
3939
MachinePostDominatorTree>::applyUpdatesImpl</*IsForward=*/false>();
4040

llvm/include/llvm/CodeGen/MachineDominators.h

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@ class MachineFunction;
3333
class Module;
3434
class raw_ostream;
3535

36-
extern template class DomTreeNodeBase<MachineBasicBlock>;
37-
extern template class DominatorTreeBase<MachineBasicBlock, false>; // DomTree
36+
extern template class LLVM_TEMPLATE_ABI DomTreeNodeBase<MachineBasicBlock>;
37+
extern template class LLVM_TEMPLATE_ABI DominatorTreeBase<MachineBasicBlock, false>; // DomTree
3838

3939
using MachineDomTreeNode = DomTreeNodeBase<MachineBasicBlock>;
4040

@@ -43,23 +43,23 @@ using MBBDomTree = DomTreeBase<MachineBasicBlock>;
4343
using MBBUpdates = ArrayRef<llvm::cfg::Update<MachineBasicBlock *>>;
4444
using MBBDomTreeGraphDiff = GraphDiff<MachineBasicBlock *, false>;
4545

46-
extern template void Calculate<MBBDomTree>(MBBDomTree &DT);
47-
extern template void CalculateWithUpdates<MBBDomTree>(MBBDomTree &DT,
46+
extern template LLVM_TEMPLATE_ABI void Calculate<MBBDomTree>(MBBDomTree &DT);
47+
extern template LLVM_TEMPLATE_ABI void CalculateWithUpdates<MBBDomTree>(MBBDomTree &DT,
4848
MBBUpdates U);
4949

50-
extern template void InsertEdge<MBBDomTree>(MBBDomTree &DT,
50+
extern template LLVM_TEMPLATE_ABI void InsertEdge<MBBDomTree>(MBBDomTree &DT,
5151
MachineBasicBlock *From,
5252
MachineBasicBlock *To);
5353

54-
extern template void DeleteEdge<MBBDomTree>(MBBDomTree &DT,
54+
extern template LLVM_TEMPLATE_ABI void DeleteEdge<MBBDomTree>(MBBDomTree &DT,
5555
MachineBasicBlock *From,
5656
MachineBasicBlock *To);
5757

58-
extern template void ApplyUpdates<MBBDomTree>(MBBDomTree &DT,
58+
extern template LLVM_TEMPLATE_ABI void ApplyUpdates<MBBDomTree>(MBBDomTree &DT,
5959
MBBDomTreeGraphDiff &,
6060
MBBDomTreeGraphDiff *);
6161

62-
extern template bool Verify<MBBDomTree>(const MBBDomTree &DT,
62+
extern template LLVM_TEMPLATE_ABI bool Verify<MBBDomTree>(const MBBDomTree &DT,
6363
MBBDomTree::VerificationLevel VL);
6464
} // namespace DomTreeBuilder
6565

llvm/include/llvm/CodeGen/MachineFunctionAnalysis.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ class MachineFunctionAnalysis
2727
: public AnalysisInfoMixin<MachineFunctionAnalysis> {
2828
friend AnalysisInfoMixin<MachineFunctionAnalysis>;
2929

30-
static AnalysisKey Key;
30+
LLVM_ABI static AnalysisKey Key;
3131

3232
const TargetMachine *TM;
3333

llvm/include/llvm/CodeGen/MachineFunctionAnalysisManager.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,13 @@
1414
#define LLVM_CODEGEN_MACHINEFUNCTIONANALYSISMANAGER
1515

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

1819
namespace llvm {
1920

2021
class MachineFunction;
2122

22-
extern template class AnalysisManager<MachineFunction>;
23+
extern template class LLVM_TEMPLATE_ABI AnalysisManager<MachineFunction>;
2324
using MachineFunctionAnalysisManager = AnalysisManager<MachineFunction>;
2425

2526
} // namespace llvm

llvm/include/llvm/CodeGen/MachineLoopInfo.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ class MachineLoop : public LoopBase<MachineBasicBlock, MachineLoop> {
101101
};
102102

103103
// Implementation in LoopInfoImpl.h
104-
extern template class LoopInfoBase<MachineBasicBlock, MachineLoop>;
104+
extern template class LLVM_TEMPLATE_ABI LoopInfoBase<MachineBasicBlock, MachineLoop>;
105105

106106
class MachineLoopInfo : public LoopInfoBase<MachineBasicBlock, MachineLoop> {
107107
friend class LoopBase<MachineBasicBlock, MachineLoop>;

llvm/include/llvm/CodeGen/MachineModuleInfo.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ class LLVM_ABI MachineModuleInfoWrapperPass : public ImmutablePass {
193193
/// infrastructure must own the MachineModuleInfo.
194194
class MachineModuleAnalysis : public AnalysisInfoMixin<MachineModuleAnalysis> {
195195
friend AnalysisInfoMixin<MachineModuleAnalysis>;
196-
static AnalysisKey Key;
196+
LLVM_ABI static AnalysisKey Key;
197197

198198
MachineModuleInfo &MMI;
199199

llvm/include/llvm/CodeGen/MachineOperand.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -759,7 +759,7 @@ class MachineOperand {
759759
/// isIdenticalTo uses for comparison. It is thus suited for use in hash
760760
/// tables which use that function for equality comparisons only. This must
761761
/// stay exactly in sync with isIdenticalTo above.
762-
friend hash_code hash_value(const MachineOperand &MO);
762+
LLVM_ABI_FRIEND friend hash_code hash_value(const MachineOperand &MO);
763763

764764
/// ChangeToImmediate - Replace this operand with a new immediate operand of
765765
/// the specified value. If an operand is known to be an immediate already,

llvm/include/llvm/CodeGen/MachinePassManager.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ LLVM_ABI bool MachineFunctionAnalysisManagerFunctionProxy::Result::invalidate(
120120
extern template class InnerAnalysisManagerProxy<MachineFunctionAnalysisManager,
121121
Function>;
122122

123-
extern template class OuterAnalysisManagerProxy<ModuleAnalysisManager,
123+
extern template class LLVM_TEMPLATE_ABI OuterAnalysisManagerProxy<ModuleAnalysisManager,
124124
MachineFunction>;
125125
/// Provide the \c ModuleAnalysisManager to \c Function proxy.
126126
using ModuleAnalysisManagerMachineFunctionProxy =

llvm/include/llvm/CodeGen/MachinePostDominators.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,23 +19,23 @@
1919

2020
namespace llvm {
2121

22-
extern template class DominatorTreeBase<MachineBasicBlock, true>; // PostDomTree
22+
extern template class LLVM_TEMPLATE_ABI DominatorTreeBase<MachineBasicBlock, true>; // PostDomTree
2323

2424
namespace DomTreeBuilder {
2525
using MBBPostDomTree = PostDomTreeBase<MachineBasicBlock>;
2626
using MBBPostDomTreeGraphDiff = GraphDiff<MachineBasicBlock *, true>;
2727

28-
extern template void Calculate<MBBPostDomTree>(MBBPostDomTree &DT);
29-
extern template void InsertEdge<MBBPostDomTree>(MBBPostDomTree &DT,
28+
extern template LLVM_TEMPLATE_ABI void Calculate<MBBPostDomTree>(MBBPostDomTree &DT);
29+
extern template LLVM_TEMPLATE_ABI void InsertEdge<MBBPostDomTree>(MBBPostDomTree &DT,
3030
MachineBasicBlock *From,
3131
MachineBasicBlock *To);
32-
extern template void DeleteEdge<MBBPostDomTree>(MBBPostDomTree &DT,
32+
extern template LLVM_TEMPLATE_ABI void DeleteEdge<MBBPostDomTree>(MBBPostDomTree &DT,
3333
MachineBasicBlock *From,
3434
MachineBasicBlock *To);
35-
extern template void ApplyUpdates<MBBPostDomTree>(MBBPostDomTree &DT,
35+
extern template LLVM_TEMPLATE_ABI void ApplyUpdates<MBBPostDomTree>(MBBPostDomTree &DT,
3636
MBBPostDomTreeGraphDiff &,
3737
MBBPostDomTreeGraphDiff *);
38-
extern template bool
38+
extern template LLVM_TEMPLATE_ABI bool
3939
Verify<MBBPostDomTree>(const MBBPostDomTree &DT,
4040
MBBPostDomTree::VerificationLevel VL);
4141
} // namespace DomTreeBuilder

llvm/include/llvm/CodeGen/PBQPRAConstraint.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,11 @@ class LLVM_ABI PBQPRAConstraint {
5050
/// added, to the PBQP graph.
5151
class LLVM_ABI PBQPRAConstraintList : public PBQPRAConstraint {
5252
public:
53+
// Explicitly non-copyable.
54+
PBQPRAConstraintList() = default;
55+
PBQPRAConstraintList& operator=(const PBQPRAConstraintList &) = delete;
56+
PBQPRAConstraintList(const PBQPRAConstraintList&) = delete;
57+
5358
void apply(PBQPRAGraph &G) override {
5459
for (auto &C : Constraints)
5560
C->apply(G);
@@ -61,6 +66,7 @@ class LLVM_ABI PBQPRAConstraintList : public PBQPRAConstraint {
6166
}
6267

6368
private:
69+
6470
std::vector<std::unique_ptr<PBQPRAConstraint>> Constraints;
6571

6672
void anchor() override;

llvm/include/llvm/CodeGen/PseudoSourceValue.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313
#ifndef LLVM_CODEGEN_PSEUDOSOURCEVALUE_H
1414
#define LLVM_CODEGEN_PSEUDOSOURCEVALUE_H
1515

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

1820
class GlobalValue;
@@ -44,7 +46,7 @@ class LLVM_ABI PseudoSourceValue {
4446
private:
4547
unsigned Kind;
4648
unsigned AddressSpace;
47-
friend raw_ostream &llvm::operator<<(raw_ostream &OS,
49+
LLVM_ABI_FRIEND friend raw_ostream &llvm::operator<<(raw_ostream &OS,
4850
const PseudoSourceValue* PSV);
4951

5052
friend class MachineMemOperand; // For printCustom().

llvm/include/llvm/CodeGen/ScheduleDAGMutation.h

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

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

1921
class ScheduleDAGInstrs;

llvm/unittests/CodeGen/RegAllocScoreTest.cpp

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,17 +24,18 @@
2424
#include "llvm/MC/MCAsmInfo.h"
2525
#include "llvm/MC/MCSymbol.h"
2626
#include "llvm/MC/TargetRegistry.h"
27+
#include "llvm/Support/Compiler.h"
2728
#include "llvm/Support/TargetSelect.h"
2829
#include "llvm/Target/TargetOptions.h"
2930
#include "llvm/TargetParser/Triple.h"
3031
#include "gtest/gtest.h"
3132

3233
using namespace llvm;
33-
extern cl::opt<double> CopyWeight;
34-
extern cl::opt<double> LoadWeight;
35-
extern cl::opt<double> StoreWeight;
36-
extern cl::opt<double> CheapRematWeight;
37-
extern cl::opt<double> ExpensiveRematWeight;
34+
LLVM_ABI extern cl::opt<double> CopyWeight;
35+
LLVM_ABI extern cl::opt<double> LoadWeight;
36+
LLVM_ABI extern cl::opt<double> StoreWeight;
37+
LLVM_ABI extern cl::opt<double> CheapRematWeight;
38+
LLVM_ABI extern cl::opt<double> ExpensiveRematWeight;
3839

3940
namespace {
4041
// Include helper functions to ease the manipulation of MachineFunctions.

0 commit comments

Comments
 (0)