Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[TableGen] Remove unused functionality from OpInit class. NFC #121680

Merged
merged 1 commit into from
Jan 6, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
56 changes: 1 addition & 55 deletions llvm/include/llvm/TableGen/Record.h
Original file line number Diff line number Diff line change
Expand Up @@ -834,13 +834,7 @@ class OpInit : public TypedInit {
I->getKind() <= IK_LastOpInit;
}

// Clone - Clone this operator, replacing arguments with the new list
virtual const OpInit *clone(ArrayRef<const Init *> Operands) const = 0;

virtual unsigned getNumOperands() const = 0;
virtual const Init *getOperand(unsigned i) const = 0;

const Init *getBit(unsigned Bit) const override;
const Init *getBit(unsigned Bit) const final;
};

/// !op (X) - Transform an init.
Expand Down Expand Up @@ -881,20 +875,6 @@ class UnOpInit final : public OpInit, public FoldingSetNode {

void Profile(FoldingSetNodeID &ID) const;

// Clone - Clone this operator, replacing arguments with the new list
const OpInit *clone(ArrayRef<const Init *> Operands) const override {
assert(Operands.size() == 1 &&
"Wrong number of operands for unary operation");
return UnOpInit::get(getOpcode(), *Operands.begin(), getType());
}

unsigned getNumOperands() const override { return 1; }

const Init *getOperand(unsigned i) const override {
assert(i == 0 && "Invalid operand id for unary operator");
return getOperand();
}

UnaryOp getOpcode() const { return (UnaryOp)Opc; }
const Init *getOperand() const { return LHS; }

Expand Down Expand Up @@ -962,22 +942,6 @@ class BinOpInit final : public OpInit, public FoldingSetNode {

void Profile(FoldingSetNodeID &ID) const;

// Clone - Clone this operator, replacing arguments with the new list
const OpInit *clone(ArrayRef<const Init *> Operands) const override {
assert(Operands.size() == 2 &&
"Wrong number of operands for binary operation");
return BinOpInit::get(getOpcode(), Operands[0], Operands[1], getType());
}

unsigned getNumOperands() const override { return 2; }
const Init *getOperand(unsigned i) const override {
switch (i) {
default: llvm_unreachable("Invalid operand id for binary operator");
case 0: return getLHS();
case 1: return getRHS();
}
}

BinaryOp getOpcode() const { return (BinaryOp)Opc; }
const Init *getLHS() const { return LHS; }
const Init *getRHS() const { return RHS; }
Expand Down Expand Up @@ -1030,24 +994,6 @@ class TernOpInit final : public OpInit, public FoldingSetNode {

void Profile(FoldingSetNodeID &ID) const;

// Clone - Clone this operator, replacing arguments with the new list
const OpInit *clone(ArrayRef<const Init *> Operands) const override {
assert(Operands.size() == 3 &&
"Wrong number of operands for ternary operation");
return TernOpInit::get(getOpcode(), Operands[0], Operands[1], Operands[2],
getType());
}

unsigned getNumOperands() const override { return 3; }
const Init *getOperand(unsigned i) const override {
switch (i) {
default: llvm_unreachable("Invalid operand id for ternary operator");
case 0: return getLHS();
case 1: return getMHS();
case 2: return getRHS();
}
}

TernaryOp getOpcode() const { return (TernaryOp)Opc; }
const Init *getLHS() const { return LHS; }
const Init *getMHS() const { return MHS; }
Expand Down
Loading