@@ -834,13 +834,7 @@ class OpInit : public TypedInit {
834
834
I->getKind () <= IK_LastOpInit;
835
835
}
836
836
837
- // Clone - Clone this operator, replacing arguments with the new list
838
- virtual const OpInit *clone (ArrayRef<const Init *> Operands) const = 0;
839
-
840
- virtual unsigned getNumOperands () const = 0;
841
- virtual const Init *getOperand (unsigned i) const = 0;
842
-
843
- const Init *getBit (unsigned Bit) const override ;
837
+ const Init *getBit (unsigned Bit) const final ;
844
838
};
845
839
846
840
// / !op (X) - Transform an init.
@@ -881,20 +875,6 @@ class UnOpInit final : public OpInit, public FoldingSetNode {
881
875
882
876
void Profile (FoldingSetNodeID &ID) const ;
883
877
884
- // Clone - Clone this operator, replacing arguments with the new list
885
- const OpInit *clone (ArrayRef<const Init *> Operands) const override {
886
- assert (Operands.size () == 1 &&
887
- " Wrong number of operands for unary operation" );
888
- return UnOpInit::get (getOpcode (), *Operands.begin (), getType ());
889
- }
890
-
891
- unsigned getNumOperands () const override { return 1 ; }
892
-
893
- const Init *getOperand (unsigned i) const override {
894
- assert (i == 0 && " Invalid operand id for unary operator" );
895
- return getOperand ();
896
- }
897
-
898
878
UnaryOp getOpcode () const { return (UnaryOp)Opc; }
899
879
const Init *getOperand () const { return LHS; }
900
880
@@ -962,22 +942,6 @@ class BinOpInit final : public OpInit, public FoldingSetNode {
962
942
963
943
void Profile (FoldingSetNodeID &ID) const ;
964
944
965
- // Clone - Clone this operator, replacing arguments with the new list
966
- const OpInit *clone (ArrayRef<const Init *> Operands) const override {
967
- assert (Operands.size () == 2 &&
968
- " Wrong number of operands for binary operation" );
969
- return BinOpInit::get (getOpcode (), Operands[0 ], Operands[1 ], getType ());
970
- }
971
-
972
- unsigned getNumOperands () const override { return 2 ; }
973
- const Init *getOperand (unsigned i) const override {
974
- switch (i) {
975
- default : llvm_unreachable (" Invalid operand id for binary operator" );
976
- case 0 : return getLHS ();
977
- case 1 : return getRHS ();
978
- }
979
- }
980
-
981
945
BinaryOp getOpcode () const { return (BinaryOp)Opc; }
982
946
const Init *getLHS () const { return LHS; }
983
947
const Init *getRHS () const { return RHS; }
@@ -1030,24 +994,6 @@ class TernOpInit final : public OpInit, public FoldingSetNode {
1030
994
1031
995
void Profile (FoldingSetNodeID &ID) const ;
1032
996
1033
- // Clone - Clone this operator, replacing arguments with the new list
1034
- const OpInit *clone (ArrayRef<const Init *> Operands) const override {
1035
- assert (Operands.size () == 3 &&
1036
- " Wrong number of operands for ternary operation" );
1037
- return TernOpInit::get (getOpcode (), Operands[0 ], Operands[1 ], Operands[2 ],
1038
- getType ());
1039
- }
1040
-
1041
- unsigned getNumOperands () const override { return 3 ; }
1042
- const Init *getOperand (unsigned i) const override {
1043
- switch (i) {
1044
- default : llvm_unreachable (" Invalid operand id for ternary operator" );
1045
- case 0 : return getLHS ();
1046
- case 1 : return getMHS ();
1047
- case 2 : return getRHS ();
1048
- }
1049
- }
1050
-
1051
997
TernaryOp getOpcode () const { return (TernaryOp)Opc; }
1052
998
const Init *getLHS () const { return LHS; }
1053
999
const Init *getMHS () const { return MHS; }
0 commit comments