[ir] Cleanup deleted methods
Because of the CastableBase, the copy and move constructors and assignment operators can't be used. They don't need to be explicitly deleted. Bug: tint:1718 Change-Id: Iafa000a00f779e1cac0aca8125330906ebd63446 Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/133660 Auto-Submit: Dan Sinclair <dsinclair@chromium.org> Kokoro: Kokoro <noreply+kokoro@google.com> Reviewed-by: Ben Clayton <bclayton@google.com> Commit-Queue: Ben Clayton <bclayton@google.com>
This commit is contained in:
parent
29da93754e
commit
0f203b1282
|
@ -52,13 +52,8 @@ class Binary : public utils::Castable<Binary, Instruction> {
|
||||||
/// @param lhs the lhs of the instruction
|
/// @param lhs the lhs of the instruction
|
||||||
/// @param rhs the rhs of the instruction
|
/// @param rhs the rhs of the instruction
|
||||||
Binary(enum Kind kind, const type::Type* type, Value* lhs, Value* rhs);
|
Binary(enum Kind kind, const type::Type* type, Value* lhs, Value* rhs);
|
||||||
Binary(const Binary& inst) = delete;
|
|
||||||
Binary(Binary&& inst) = delete;
|
|
||||||
~Binary() override;
|
~Binary() override;
|
||||||
|
|
||||||
Binary& operator=(const Binary& inst) = delete;
|
|
||||||
Binary& operator=(Binary&& inst) = delete;
|
|
||||||
|
|
||||||
/// @returns the kind of the binary instruction
|
/// @returns the kind of the binary instruction
|
||||||
enum Kind Kind() const { return kind_; }
|
enum Kind Kind() const { return kind_; }
|
||||||
|
|
||||||
|
|
|
@ -27,12 +27,7 @@ class Bitcast : public utils::Castable<Bitcast, Call> {
|
||||||
/// @param type the result type
|
/// @param type the result type
|
||||||
/// @param val the value being bitcast
|
/// @param val the value being bitcast
|
||||||
Bitcast(const type::Type* type, Value* val);
|
Bitcast(const type::Type* type, Value* val);
|
||||||
Bitcast(const Bitcast& inst) = delete;
|
|
||||||
Bitcast(Bitcast&& inst) = delete;
|
|
||||||
~Bitcast() override;
|
~Bitcast() override;
|
||||||
|
|
||||||
Bitcast& operator=(const Bitcast& inst) = delete;
|
|
||||||
Bitcast& operator=(Bitcast&& inst) = delete;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace tint::ir
|
} // namespace tint::ir
|
||||||
|
|
|
@ -32,13 +32,8 @@ class Block : public utils::Castable<Block, FlowNode> {
|
||||||
public:
|
public:
|
||||||
/// Constructor
|
/// Constructor
|
||||||
Block();
|
Block();
|
||||||
Block(const Block&) = delete;
|
|
||||||
Block(Block&&) = delete;
|
|
||||||
~Block() override;
|
~Block() override;
|
||||||
|
|
||||||
Block& operator=(const Block&) = delete;
|
|
||||||
Block& operator=(Block&&) = delete;
|
|
||||||
|
|
||||||
/// Sets the blocks branch target to the given node.
|
/// Sets the blocks branch target to the given node.
|
||||||
/// @param to the node to branch too
|
/// @param to the node to branch too
|
||||||
/// @param args the branch arguments
|
/// @param args the branch arguments
|
||||||
|
|
|
@ -26,13 +26,8 @@ class BlockParam : public utils::Castable<BlockParam, Value> {
|
||||||
/// Constructor
|
/// Constructor
|
||||||
/// @param type the type of the var
|
/// @param type the type of the var
|
||||||
explicit BlockParam(const type::Type* type);
|
explicit BlockParam(const type::Type* type);
|
||||||
BlockParam(const BlockParam& inst) = delete;
|
|
||||||
BlockParam(BlockParam&& inst) = delete;
|
|
||||||
~BlockParam() override;
|
~BlockParam() override;
|
||||||
|
|
||||||
BlockParam& operator=(const BlockParam& inst) = delete;
|
|
||||||
BlockParam& operator=(BlockParam&& inst) = delete;
|
|
||||||
|
|
||||||
/// @returns the type of the var
|
/// @returns the type of the var
|
||||||
const type::Type* Type() const override { return type_; }
|
const type::Type* Type() const override { return type_; }
|
||||||
|
|
||||||
|
|
|
@ -29,13 +29,8 @@ class Builtin : public utils::Castable<Builtin, Call> {
|
||||||
/// @param func the builtin function
|
/// @param func the builtin function
|
||||||
/// @param args the conversion arguments
|
/// @param args the conversion arguments
|
||||||
Builtin(const type::Type* res_type, builtin::Function func, utils::VectorRef<Value*> args);
|
Builtin(const type::Type* res_type, builtin::Function func, utils::VectorRef<Value*> args);
|
||||||
Builtin(const Builtin& inst) = delete;
|
|
||||||
Builtin(Builtin&& inst) = delete;
|
|
||||||
~Builtin() override;
|
~Builtin() override;
|
||||||
|
|
||||||
Builtin& operator=(const Builtin& inst) = delete;
|
|
||||||
Builtin& operator=(Builtin&& inst) = delete;
|
|
||||||
|
|
||||||
/// @returns the builtin function
|
/// @returns the builtin function
|
||||||
builtin::Function Func() const { return func_; }
|
builtin::Function Func() const { return func_; }
|
||||||
|
|
||||||
|
|
|
@ -23,13 +23,8 @@ namespace tint::ir {
|
||||||
/// A Call instruction in the IR.
|
/// A Call instruction in the IR.
|
||||||
class Call : public utils::Castable<Call, Instruction> {
|
class Call : public utils::Castable<Call, Instruction> {
|
||||||
public:
|
public:
|
||||||
Call(const Call& inst) = delete;
|
|
||||||
Call(Call&& inst) = delete;
|
|
||||||
~Call() override;
|
~Call() override;
|
||||||
|
|
||||||
Call& operator=(const Call& inst) = delete;
|
|
||||||
Call& operator=(Call&& inst) = delete;
|
|
||||||
|
|
||||||
/// @returns the type of the value
|
/// @returns the type of the value
|
||||||
const type::Type* Type() const override { return result_type_; }
|
const type::Type* Type() const override { return result_type_; }
|
||||||
|
|
||||||
|
|
|
@ -26,13 +26,8 @@ class Constant : public utils::Castable<Constant, Value> {
|
||||||
/// Constructor
|
/// Constructor
|
||||||
/// @param val the value stored in the constant
|
/// @param val the value stored in the constant
|
||||||
explicit Constant(const constant::Value* val);
|
explicit Constant(const constant::Value* val);
|
||||||
Constant(const Constant&) = delete;
|
|
||||||
Constant(Constant&&) = delete;
|
|
||||||
~Constant() override;
|
~Constant() override;
|
||||||
|
|
||||||
Constant& operator=(const Constant&) = delete;
|
|
||||||
Constant& operator=(Constant&&) = delete;
|
|
||||||
|
|
||||||
/// @returns the constants value
|
/// @returns the constants value
|
||||||
const constant::Value* Value() const { return value_; }
|
const constant::Value* Value() const { return value_; }
|
||||||
|
|
||||||
|
|
|
@ -27,12 +27,7 @@ class Construct : public utils::Castable<Construct, Call> {
|
||||||
/// @param type the result type
|
/// @param type the result type
|
||||||
/// @param args the constructor arguments
|
/// @param args the constructor arguments
|
||||||
Construct(const type::Type* type, utils::VectorRef<Value*> args);
|
Construct(const type::Type* type, utils::VectorRef<Value*> args);
|
||||||
Construct(const Construct& inst) = delete;
|
|
||||||
Construct(Construct&& inst) = delete;
|
|
||||||
~Construct() override;
|
~Construct() override;
|
||||||
|
|
||||||
Construct& operator=(const Construct& inst) = delete;
|
|
||||||
Construct& operator=(Construct&& inst) = delete;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace tint::ir
|
} // namespace tint::ir
|
||||||
|
|
|
@ -31,13 +31,8 @@ class Convert : public utils::Castable<Convert, Call> {
|
||||||
Convert(const type::Type* result_type,
|
Convert(const type::Type* result_type,
|
||||||
const type::Type* from_type,
|
const type::Type* from_type,
|
||||||
utils::VectorRef<Value*> args);
|
utils::VectorRef<Value*> args);
|
||||||
Convert(const Convert& inst) = delete;
|
|
||||||
Convert(Convert&& inst) = delete;
|
|
||||||
~Convert() override;
|
~Convert() override;
|
||||||
|
|
||||||
Convert& operator=(const Convert& inst) = delete;
|
|
||||||
Convert& operator=(Convert&& inst) = delete;
|
|
||||||
|
|
||||||
/// @returns the from type
|
/// @returns the from type
|
||||||
const type::Type* FromType() const { return from_type_; }
|
const type::Type* FromType() const { return from_type_; }
|
||||||
/// @returns the to type
|
/// @returns the to type
|
||||||
|
|
|
@ -26,12 +26,7 @@ class Discard : public utils::Castable<Discard, Call> {
|
||||||
public:
|
public:
|
||||||
/// Constructor
|
/// Constructor
|
||||||
Discard();
|
Discard();
|
||||||
Discard(const Discard& inst) = delete;
|
|
||||||
Discard(Discard&& inst) = delete;
|
|
||||||
~Discard() override;
|
~Discard() override;
|
||||||
|
|
||||||
Discard& operator=(const Discard& inst) = delete;
|
|
||||||
Discard& operator=(Discard&& inst) = delete;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace tint::ir
|
} // namespace tint::ir
|
||||||
|
|
|
@ -72,13 +72,8 @@ class Function : public utils::Castable<Function, FlowNode> {
|
||||||
type::Type* rt,
|
type::Type* rt,
|
||||||
PipelineStage stage = PipelineStage::kUndefined,
|
PipelineStage stage = PipelineStage::kUndefined,
|
||||||
std::optional<std::array<uint32_t, 3>> wg_size = {});
|
std::optional<std::array<uint32_t, 3>> wg_size = {});
|
||||||
Function(Function&&) = delete;
|
|
||||||
Function(const Function&) = delete;
|
|
||||||
~Function() override;
|
~Function() override;
|
||||||
|
|
||||||
Function& operator=(Function&&) = delete;
|
|
||||||
Function& operator=(const Function&) = delete;
|
|
||||||
|
|
||||||
/// @returns the function name
|
/// @returns the function name
|
||||||
Symbol Name() const { return name_; }
|
Symbol Name() const { return name_; }
|
||||||
|
|
||||||
|
|
|
@ -26,13 +26,8 @@ class FunctionParam : public utils::Castable<FunctionParam, Value> {
|
||||||
/// Constructor
|
/// Constructor
|
||||||
/// @param type the type of the var
|
/// @param type the type of the var
|
||||||
explicit FunctionParam(const type::Type* type);
|
explicit FunctionParam(const type::Type* type);
|
||||||
FunctionParam(const FunctionParam& inst) = delete;
|
|
||||||
FunctionParam(FunctionParam&& inst) = delete;
|
|
||||||
~FunctionParam() override;
|
~FunctionParam() override;
|
||||||
|
|
||||||
FunctionParam& operator=(const FunctionParam& inst) = delete;
|
|
||||||
FunctionParam& operator=(FunctionParam&& inst) = delete;
|
|
||||||
|
|
||||||
/// @returns the type of the var
|
/// @returns the type of the var
|
||||||
const type::Type* Type() const override { return type_; }
|
const type::Type* Type() const override { return type_; }
|
||||||
|
|
||||||
|
|
|
@ -32,13 +32,8 @@ class If : public utils::Castable<If, FlowNode> {
|
||||||
/// Constructor
|
/// Constructor
|
||||||
/// @param cond the if condition
|
/// @param cond the if condition
|
||||||
explicit If(Value* cond);
|
explicit If(Value* cond);
|
||||||
If(const If&) = delete;
|
|
||||||
If(If&&) = delete;
|
|
||||||
~If() override;
|
~If() override;
|
||||||
|
|
||||||
If& operator=(const If&) = delete;
|
|
||||||
If& operator=(If&&) = delete;
|
|
||||||
|
|
||||||
/// @returns the if condition
|
/// @returns the if condition
|
||||||
const Value* Condition() const { return condition_; }
|
const Value* Condition() const { return condition_; }
|
||||||
|
|
||||||
|
|
|
@ -23,14 +23,9 @@ namespace tint::ir {
|
||||||
/// An instruction in the IR.
|
/// An instruction in the IR.
|
||||||
class Instruction : public utils::Castable<Instruction, Value> {
|
class Instruction : public utils::Castable<Instruction, Value> {
|
||||||
public:
|
public:
|
||||||
Instruction(const Instruction& inst) = delete;
|
|
||||||
Instruction(Instruction&& inst) = delete;
|
|
||||||
/// Destructor
|
/// Destructor
|
||||||
~Instruction() override;
|
~Instruction() override;
|
||||||
|
|
||||||
Instruction& operator=(const Instruction& inst) = delete;
|
|
||||||
Instruction& operator=(Instruction&& inst) = delete;
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
/// Constructor
|
/// Constructor
|
||||||
Instruction();
|
Instruction();
|
||||||
|
|
|
@ -27,13 +27,8 @@ class Load : public utils::Castable<Load, Instruction> {
|
||||||
/// @param type the result type
|
/// @param type the result type
|
||||||
/// @param from the value being loaded from
|
/// @param from the value being loaded from
|
||||||
Load(const type::Type* type, Value* from);
|
Load(const type::Type* type, Value* from);
|
||||||
Load(const Load& inst) = delete;
|
|
||||||
Load(Load&& inst) = delete;
|
|
||||||
~Load() override;
|
~Load() override;
|
||||||
|
|
||||||
Load& operator=(const Load& inst) = delete;
|
|
||||||
Load& operator=(Load&& inst) = delete;
|
|
||||||
|
|
||||||
/// @returns the type of the value
|
/// @returns the type of the value
|
||||||
const type::Type* Type() const override { return result_type_; }
|
const type::Type* Type() const override { return result_type_; }
|
||||||
|
|
||||||
|
|
|
@ -26,13 +26,8 @@ class Loop : public utils::Castable<Loop, FlowNode> {
|
||||||
public:
|
public:
|
||||||
/// Constructor
|
/// Constructor
|
||||||
Loop();
|
Loop();
|
||||||
Loop(const Loop&) = delete;
|
|
||||||
Loop(Loop&&) = delete;
|
|
||||||
~Loop() override;
|
~Loop() override;
|
||||||
|
|
||||||
Loop& operator=(const Loop&) = delete;
|
|
||||||
Loop& operator=(Loop&&) = delete;
|
|
||||||
|
|
||||||
/// @returns the switch start branch
|
/// @returns the switch start branch
|
||||||
const Branch& Start() const { return start_; }
|
const Branch& Start() const { return start_; }
|
||||||
/// @returns the switch start branch
|
/// @returns the switch start branch
|
||||||
|
|
|
@ -25,12 +25,7 @@ class RootTerminator : public utils::Castable<RootTerminator, FlowNode> {
|
||||||
public:
|
public:
|
||||||
/// Constructor
|
/// Constructor
|
||||||
RootTerminator();
|
RootTerminator();
|
||||||
RootTerminator(const RootTerminator&) = delete;
|
|
||||||
RootTerminator(RootTerminator&&) = delete;
|
|
||||||
~RootTerminator() override;
|
~RootTerminator() override;
|
||||||
|
|
||||||
RootTerminator& operator=(const RootTerminator&) = delete;
|
|
||||||
RootTerminator& operator=(RootTerminator&&) = delete;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace tint::ir
|
} // namespace tint::ir
|
||||||
|
|
|
@ -27,13 +27,8 @@ class Store : public utils::Castable<Store, Instruction> {
|
||||||
/// @param to the value to store too
|
/// @param to the value to store too
|
||||||
/// @param from the value being stored from
|
/// @param from the value being stored from
|
||||||
Store(Value* to, Value* from);
|
Store(Value* to, Value* from);
|
||||||
Store(const Store& inst) = delete;
|
|
||||||
Store(Store&& inst) = delete;
|
|
||||||
~Store() override;
|
~Store() override;
|
||||||
|
|
||||||
Store& operator=(const Store& inst) = delete;
|
|
||||||
Store& operator=(Store&& inst) = delete;
|
|
||||||
|
|
||||||
/// @returns the value being stored too
|
/// @returns the value being stored too
|
||||||
Value* To() const { return to_; }
|
Value* To() const { return to_; }
|
||||||
|
|
||||||
|
|
|
@ -51,13 +51,8 @@ class Switch : public utils::Castable<Switch, FlowNode> {
|
||||||
/// Constructor
|
/// Constructor
|
||||||
/// @param cond the condition
|
/// @param cond the condition
|
||||||
explicit Switch(Value* cond);
|
explicit Switch(Value* cond);
|
||||||
Switch(const Switch&) = delete;
|
|
||||||
Switch(Switch&&) = delete;
|
|
||||||
~Switch() override;
|
~Switch() override;
|
||||||
|
|
||||||
Switch& operator=(const Switch&) = delete;
|
|
||||||
Switch& operator=(Switch&&) = delete;
|
|
||||||
|
|
||||||
/// @returns the switch merge branch
|
/// @returns the switch merge branch
|
||||||
const Branch& Merge() const { return merge_; }
|
const Branch& Merge() const { return merge_; }
|
||||||
/// @returns the switch merge branch
|
/// @returns the switch merge branch
|
||||||
|
|
|
@ -34,13 +34,8 @@ class Unary : public utils::Castable<Unary, Instruction> {
|
||||||
/// @param result_type the result type
|
/// @param result_type the result type
|
||||||
/// @param val the input value for the instruction
|
/// @param val the input value for the instruction
|
||||||
Unary(enum Kind kind, const type::Type* result_type, Value* val);
|
Unary(enum Kind kind, const type::Type* result_type, Value* val);
|
||||||
Unary(const Unary& inst) = delete;
|
|
||||||
Unary(Unary&& inst) = delete;
|
|
||||||
~Unary() override;
|
~Unary() override;
|
||||||
|
|
||||||
Unary& operator=(const Unary& inst) = delete;
|
|
||||||
Unary& operator=(Unary&& inst) = delete;
|
|
||||||
|
|
||||||
/// @returns the type of the value
|
/// @returns the type of the value
|
||||||
const type::Type* Type() const override { return result_type_; }
|
const type::Type* Type() const override { return result_type_; }
|
||||||
|
|
||||||
|
|
|
@ -29,13 +29,8 @@ class UserCall : public utils::Castable<UserCall, Call> {
|
||||||
/// @param name the function name
|
/// @param name the function name
|
||||||
/// @param args the function arguments
|
/// @param args the function arguments
|
||||||
UserCall(const type::Type* type, Symbol name, utils::VectorRef<Value*> args);
|
UserCall(const type::Type* type, Symbol name, utils::VectorRef<Value*> args);
|
||||||
UserCall(const UserCall& inst) = delete;
|
|
||||||
UserCall(UserCall&& inst) = delete;
|
|
||||||
~UserCall() override;
|
~UserCall() override;
|
||||||
|
|
||||||
UserCall& operator=(const UserCall& inst) = delete;
|
|
||||||
UserCall& operator=(UserCall&& inst) = delete;
|
|
||||||
|
|
||||||
/// @returns the called function name
|
/// @returns the called function name
|
||||||
Symbol Name() const { return name_; }
|
Symbol Name() const { return name_; }
|
||||||
|
|
||||||
|
|
|
@ -32,12 +32,6 @@ class Value : public utils::Castable<Value> {
|
||||||
/// Destructor
|
/// Destructor
|
||||||
~Value() override;
|
~Value() override;
|
||||||
|
|
||||||
Value(const Value&) = delete;
|
|
||||||
Value(Value&&) = delete;
|
|
||||||
|
|
||||||
Value& operator=(const Value&) = delete;
|
|
||||||
Value& operator=(Value&&) = delete;
|
|
||||||
|
|
||||||
/// Adds an instruction which uses this value.
|
/// Adds an instruction which uses this value.
|
||||||
/// @param inst the instruction
|
/// @param inst the instruction
|
||||||
void AddUsage(const Instruction* inst) { uses_.Add(inst); }
|
void AddUsage(const Instruction* inst) { uses_.Add(inst); }
|
||||||
|
|
|
@ -28,13 +28,8 @@ class Var : public utils::Castable<Var, Instruction> {
|
||||||
/// Constructor
|
/// Constructor
|
||||||
/// @param type the type of the var
|
/// @param type the type of the var
|
||||||
explicit Var(const type::Type* type);
|
explicit Var(const type::Type* type);
|
||||||
Var(const Var& inst) = delete;
|
|
||||||
Var(Var&& inst) = delete;
|
|
||||||
~Var() override;
|
~Var() override;
|
||||||
|
|
||||||
Var& operator=(const Var& inst) = delete;
|
|
||||||
Var& operator=(Var&& inst) = delete;
|
|
||||||
|
|
||||||
/// @returns the type of the var
|
/// @returns the type of the var
|
||||||
const type::Type* Type() const override { return type_; }
|
const type::Type* Type() const override { return type_; }
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue