Skip to content

Commit b057e16

Browse files
authored
[IR] Remove unused MINARITY operand trait tpl args, NFC (#107165)
These don't look like they've been used since the original 'use-diet' branch was merged in 2008 ( f6caff6)
1 parent 99f02a8 commit b057e16

File tree

9 files changed

+19
-32
lines changed

9 files changed

+19
-32
lines changed

llvm/include/llvm/Analysis/MemorySSA.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -689,7 +689,7 @@ inline void MemoryUseOrDef::resetOptimized() {
689689
cast<MemoryUse>(this)->resetOptimized();
690690
}
691691

692-
template <> struct OperandTraits<MemoryPhi> : public HungoffOperandTraits<2> {};
692+
template <> struct OperandTraits<MemoryPhi> : public HungoffOperandTraits {};
693693
DEFINE_TRANSPARENT_OPERAND_ACCESSORS(MemoryPhi, MemoryAccess)
694694

695695
/// Encapsulates MemorySSA, including all data associated with memory

llvm/include/llvm/IR/Constants.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1381,7 +1381,7 @@ class ConstantExpr : public Constant {
13811381

13821382
template <>
13831383
struct OperandTraits<ConstantExpr>
1384-
: public VariadicOperandTraits<ConstantExpr, 1> {};
1384+
: public VariadicOperandTraits<ConstantExpr> {};
13851385

13861386
DEFINE_TRANSPARENT_OPERAND_ACCESSORS(ConstantExpr, Constant)
13871387

llvm/include/llvm/IR/Function.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1038,8 +1038,7 @@ class LLVM_EXTERNAL_VISIBILITY Function : public GlobalObject,
10381038
/// Return value: true => null pointer dereference is not undefined.
10391039
bool NullPointerIsDefined(const Function *F, unsigned AS = 0);
10401040

1041-
template <>
1042-
struct OperandTraits<Function> : public HungoffOperandTraits<3> {};
1041+
template <> struct OperandTraits<Function> : public HungoffOperandTraits {};
10431042

10441043
DEFINE_TRANSPARENT_OPERAND_ACCESSORS(Function, Value)
10451044

llvm/include/llvm/IR/InstrTypes.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2407,7 +2407,7 @@ class CallBase : public Instruction {
24072407
};
24082408

24092409
template <>
2410-
struct OperandTraits<CallBase> : public VariadicOperandTraits<CallBase, 1> {};
2410+
struct OperandTraits<CallBase> : public VariadicOperandTraits<CallBase> {};
24112411

24122412
DEFINE_TRANSPARENT_OPERAND_ACCESSORS(CallBase, Value)
24132413

@@ -2474,7 +2474,7 @@ class FuncletPadInst : public Instruction {
24742474

24752475
template <>
24762476
struct OperandTraits<FuncletPadInst>
2477-
: public VariadicOperandTraits<FuncletPadInst, /*MINARITY=*/1> {};
2477+
: public VariadicOperandTraits<FuncletPadInst> {};
24782478

24792479
DEFINE_TRANSPARENT_OPERAND_ACCESSORS(FuncletPadInst, Value)
24802480

llvm/include/llvm/IR/Instructions.h

Lines changed: 10 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1112,9 +1112,8 @@ class GetElementPtrInst : public Instruction {
11121112
};
11131113

11141114
template <>
1115-
struct OperandTraits<GetElementPtrInst> :
1116-
public VariadicOperandTraits<GetElementPtrInst, 1> {
1117-
};
1115+
struct OperandTraits<GetElementPtrInst>
1116+
: public VariadicOperandTraits<GetElementPtrInst> {};
11181117

11191118
GetElementPtrInst::GetElementPtrInst(Type *PointeeType, Value *Ptr,
11201119
ArrayRef<Value *> IdxList, unsigned Values,
@@ -2723,9 +2722,7 @@ class PHINode : public Instruction {
27232722
void growOperands();
27242723
};
27252724

2726-
template <>
2727-
struct OperandTraits<PHINode> : public HungoffOperandTraits<2> {
2728-
};
2725+
template <> struct OperandTraits<PHINode> : public HungoffOperandTraits {};
27292726

27302727
DEFINE_TRANSPARENT_OPERAND_ACCESSORS(PHINode, Value)
27312728

@@ -2825,8 +2822,7 @@ class LandingPadInst : public Instruction {
28252822
};
28262823

28272824
template <>
2828-
struct OperandTraits<LandingPadInst> : public HungoffOperandTraits<1> {
2829-
};
2825+
struct OperandTraits<LandingPadInst> : public HungoffOperandTraits {};
28302826

28312827
DEFINE_TRANSPARENT_OPERAND_ACCESSORS(LandingPadInst, Value)
28322828

@@ -2903,8 +2899,7 @@ class ReturnInst : public Instruction {
29032899
};
29042900

29052901
template <>
2906-
struct OperandTraits<ReturnInst> : public VariadicOperandTraits<ReturnInst> {
2907-
};
2902+
struct OperandTraits<ReturnInst> : public VariadicOperandTraits<ReturnInst> {};
29082903

29092904
DEFINE_TRANSPARENT_OPERAND_ACCESSORS(ReturnInst, Value)
29102905

@@ -3039,8 +3034,7 @@ class BranchInst : public Instruction {
30393034
};
30403035

30413036
template <>
3042-
struct OperandTraits<BranchInst> : public VariadicOperandTraits<BranchInst, 1> {
3043-
};
3037+
struct OperandTraits<BranchInst> : public VariadicOperandTraits<BranchInst> {};
30443038

30453039
DEFINE_TRANSPARENT_OPERAND_ACCESSORS(BranchInst, Value)
30463040

@@ -3428,9 +3422,7 @@ class SwitchInstProfUpdateWrapper {
34283422
static CaseWeightOpt getSuccessorWeight(const SwitchInst &SI, unsigned idx);
34293423
};
34303424

3431-
template <>
3432-
struct OperandTraits<SwitchInst> : public HungoffOperandTraits<2> {
3433-
};
3425+
template <> struct OperandTraits<SwitchInst> : public HungoffOperandTraits {};
34343426

34353427
DEFINE_TRANSPARENT_OPERAND_ACCESSORS(SwitchInst, Value)
34363428

@@ -3554,8 +3546,7 @@ class IndirectBrInst : public Instruction {
35543546
};
35553547

35563548
template <>
3557-
struct OperandTraits<IndirectBrInst> : public HungoffOperandTraits<1> {
3558-
};
3549+
struct OperandTraits<IndirectBrInst> : public HungoffOperandTraits {};
35593550

35603551
DEFINE_TRANSPARENT_OPERAND_ACCESSORS(IndirectBrInst, Value)
35613552

@@ -4105,7 +4096,7 @@ class CatchSwitchInst : public Instruction {
41054096
};
41064097

41074098
template <>
4108-
struct OperandTraits<CatchSwitchInst> : public HungoffOperandTraits<2> {};
4099+
struct OperandTraits<CatchSwitchInst> : public HungoffOperandTraits {};
41094100

41104101
DEFINE_TRANSPARENT_OPERAND_ACCESSORS(CatchSwitchInst, Value)
41114102

@@ -4337,7 +4328,7 @@ class CleanupReturnInst : public Instruction {
43374328

43384329
template <>
43394330
struct OperandTraits<CleanupReturnInst>
4340-
: public VariadicOperandTraits<CleanupReturnInst, /*MINARITY=*/1> {};
4331+
: public VariadicOperandTraits<CleanupReturnInst> {};
43414332

43424333
DEFINE_TRANSPARENT_OPERAND_ACCESSORS(CleanupReturnInst, Value)
43434334

llvm/include/llvm/IR/OperandTraits.h

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,7 @@ struct OptionalOperandTraits : public FixedNumOperandTraits<SubClass, ARITY> {
6464
/// when it is a prefix to the User object, and the number of Use objects is
6565
/// only known at allocation time.
6666

67-
template <typename SubClass, unsigned MINARITY = 0>
68-
struct VariadicOperandTraits {
67+
template <typename SubClass> struct VariadicOperandTraits {
6968
static Use *op_begin(SubClass* U) {
7069
static_assert(
7170
!std::is_polymorphic<SubClass>::value,
@@ -91,7 +90,6 @@ struct VariadicOperandTraits {
9190
/// This is the traits class that is needed when the Use array must be
9291
/// resizable.
9392

94-
template <unsigned MINARITY = 1>
9593
struct HungoffOperandTraits {
9694
static Use *op_begin(User* U) {
9795
return U->getHungOffOperands();

llvm/include/llvm/IR/Operator.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -533,8 +533,8 @@ class GEPOperator
533533
};
534534

535535
template <>
536-
struct OperandTraits<GEPOperator>
537-
: public VariadicOperandTraits<GEPOperator, 1> {};
536+
struct OperandTraits<GEPOperator> : public VariadicOperandTraits<GEPOperator> {
537+
};
538538

539539
DEFINE_TRANSPARENT_OPERAND_ACCESSORS(GEPOperator, Value)
540540

llvm/include/llvm/IR/User.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@ template <class>
4242
struct OperandTraits;
4343

4444
class User : public Value {
45-
template <unsigned>
4645
friend struct HungoffOperandTraits;
4746

4847
LLVM_ATTRIBUTE_ALWAYS_INLINE static void *

llvm/lib/IR/ConstantsContext.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,7 @@ DEFINE_TRANSPARENT_OPERAND_ACCESSORS(ShuffleVectorConstantExpr, Value)
246246

247247
template <>
248248
struct OperandTraits<GetElementPtrConstantExpr>
249-
: public VariadicOperandTraits<GetElementPtrConstantExpr, 1> {};
249+
: public VariadicOperandTraits<GetElementPtrConstantExpr> {};
250250

251251
DEFINE_TRANSPARENT_OPERAND_ACCESSORS(GetElementPtrConstantExpr, Value)
252252

0 commit comments

Comments
 (0)