Skip to content

Commit aeafdc2

Browse files
committed
[AMDGPU] Use using instead of typedef. NFC.
1 parent 4ecb538 commit aeafdc2

File tree

7 files changed

+12
-12
lines changed

7 files changed

+12
-12
lines changed

llvm/lib/Target/AMDGPU/AMDGPUIGroupLP.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ class InstructionRule {
112112
virtual ~InstructionRule() = default;
113113
};
114114

115-
typedef DenseMap<SUnit *, SmallVector<int, 4>> SUnitsToCandidateSGsMap;
115+
using SUnitsToCandidateSGsMap = DenseMap<SUnit *, SmallVector<int, 4>>;
116116

117117
// Classify instructions into groups to enable fine tuned control over the
118118
// scheduler. These groups may be more specific than current SchedModel
@@ -261,8 +261,8 @@ static void resetEdges(SUnit &SU, ScheduleDAGInstrs *DAG) {
261261
S.getSUnit()->removePred(SP);
262262
}
263263

264-
typedef std::pair<SUnit *, SmallVector<int, 4>> SUToCandSGsPair;
265-
typedef SmallVector<SUToCandSGsPair, 4> SUsToCandSGsVec;
264+
using SUToCandSGsPair = std::pair<SUnit *, SmallVector<int, 4>>;
265+
using SUsToCandSGsVec = SmallVector<SUToCandSGsPair, 4>;
266266

267267
// The PipelineSolver is used to assign SUnits to SchedGroups in a pipeline
268268
// in non-trivial cases. For example, if the requested pipeline is

llvm/lib/Target/AMDGPU/AMDGPULibCalls.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ class AMDGPULibCalls {
5555
AssumptionCache *AC = nullptr;
5656
DominatorTree *DT = nullptr;
5757

58-
typedef llvm::AMDGPULibFunc FuncInfo;
58+
using FuncInfo = llvm::AMDGPULibFunc;
5959

6060
bool UnsafeFPMath = false;
6161

llvm/lib/Target/AMDGPU/GCNHazardRecognizer.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -446,10 +446,10 @@ void GCNHazardRecognizer::RecedeCycle() {
446446
// Helper Functions
447447
//===----------------------------------------------------------------------===//
448448

449-
typedef enum { HazardFound, HazardExpired, NoHazardFound } HazardFnResult;
449+
using HazardFnResult = enum { HazardFound, HazardExpired, NoHazardFound };
450450

451-
typedef function_ref<bool(const MachineInstr &, int WaitStates)> IsExpiredFn;
452-
typedef function_ref<unsigned int(const MachineInstr &)> GetNumWaitStatesFn;
451+
using IsExpiredFn = function_ref<bool(const MachineInstr &, int WaitStates)>;
452+
using GetNumWaitStatesFn = function_ref<unsigned int(const MachineInstr &)>;
453453

454454
// Search for a hazard in a block and its predecessors.
455455
template <typename StateT>

llvm/lib/Target/AMDGPU/GCNILPSched.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ class GCNILPScheduler {
2727
};
2828

2929
SpecificBumpPtrAllocator<Candidate> Alloc;
30-
typedef simple_ilist<Candidate> Queue;
30+
using Queue = simple_ilist<Candidate>;
3131
Queue PendingQueue;
3232
Queue AvailQueue;
3333
unsigned CurQueueId = 0;

llvm/lib/Target/AMDGPU/GCNNSAReassign.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,13 +56,13 @@ class GCNNSAReassign : public MachineFunctionPass {
5656
}
5757

5858
private:
59-
typedef enum {
59+
using NSA_Status = enum {
6060
NOT_NSA, // Not an NSA instruction
6161
FIXED, // NSA which we cannot modify
6262
NON_CONTIGUOUS, // NSA with non-sequential address which we can try
6363
// to optimize.
6464
CONTIGUOUS // NSA with all sequential address registers
65-
} NSA_Status;
65+
};
6666

6767
const GCNSubtarget *ST;
6868

llvm/lib/Target/AMDGPU/GCNRewritePartialRegUses.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ class GCNRewritePartialRegUses : public MachineFunctionPass {
8888
};
8989

9090
/// Map OldSubReg -> { RC, NewSubReg }. Used as in/out container.
91-
typedef SmallDenseMap<unsigned, SubRegInfo> SubRegMap;
91+
using SubRegMap = SmallDenseMap<unsigned, SubRegInfo>;
9292

9393
/// Given register class RC and the set of used subregs as keys in the SubRegs
9494
/// map return new register class and indexes of right-shifted subregs as

llvm/lib/Target/AMDGPU/SIFormMemoryClauses.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ MaxClause("amdgpu-max-memory-clause", cl::Hidden, cl::init(15),
3232
namespace {
3333

3434
class SIFormMemoryClauses : public MachineFunctionPass {
35-
typedef DenseMap<unsigned, std::pair<unsigned, LaneBitmask>> RegUse;
35+
using RegUse = DenseMap<unsigned, std::pair<unsigned, LaneBitmask>>;
3636

3737
public:
3838
static char ID;

0 commit comments

Comments
 (0)