[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>
diff --git a/src/tint/ir/binary.h b/src/tint/ir/binary.h
index 7ea6c08..3de078a 100644
--- a/src/tint/ir/binary.h
+++ b/src/tint/ir/binary.h
@@ -52,13 +52,8 @@
/// @param lhs the lhs of the instruction
/// @param rhs the rhs of the instruction
Binary(enum Kind kind, const type::Type* type, Value* lhs, Value* rhs);
- Binary(const Binary& inst) = delete;
- Binary(Binary&& inst) = delete;
~Binary() override;
- Binary& operator=(const Binary& inst) = delete;
- Binary& operator=(Binary&& inst) = delete;
-
/// @returns the kind of the binary instruction
enum Kind Kind() const { return kind_; }
diff --git a/src/tint/ir/bitcast.h b/src/tint/ir/bitcast.h
index 0ad1acb..ddf74b9 100644
--- a/src/tint/ir/bitcast.h
+++ b/src/tint/ir/bitcast.h
@@ -27,12 +27,7 @@
/// @param type the result type
/// @param val the value being bitcast
Bitcast(const type::Type* type, Value* val);
- Bitcast(const Bitcast& inst) = delete;
- Bitcast(Bitcast&& inst) = delete;
~Bitcast() override;
-
- Bitcast& operator=(const Bitcast& inst) = delete;
- Bitcast& operator=(Bitcast&& inst) = delete;
};
} // namespace tint::ir
diff --git a/src/tint/ir/block.h b/src/tint/ir/block.h
index 2b01fd0..ce85162 100644
--- a/src/tint/ir/block.h
+++ b/src/tint/ir/block.h
@@ -32,13 +32,8 @@
public:
/// Constructor
Block();
- Block(const Block&) = delete;
- Block(Block&&) = delete;
~Block() override;
- Block& operator=(const Block&) = delete;
- Block& operator=(Block&&) = delete;
-
/// Sets the blocks branch target to the given node.
/// @param to the node to branch too
/// @param args the branch arguments
diff --git a/src/tint/ir/block_param.h b/src/tint/ir/block_param.h
index 036ddbf..386ea4d 100644
--- a/src/tint/ir/block_param.h
+++ b/src/tint/ir/block_param.h
@@ -26,13 +26,8 @@
/// Constructor
/// @param type the type of the var
explicit BlockParam(const type::Type* type);
- BlockParam(const BlockParam& inst) = delete;
- BlockParam(BlockParam&& inst) = delete;
~BlockParam() override;
- BlockParam& operator=(const BlockParam& inst) = delete;
- BlockParam& operator=(BlockParam&& inst) = delete;
-
/// @returns the type of the var
const type::Type* Type() const override { return type_; }
diff --git a/src/tint/ir/builtin.h b/src/tint/ir/builtin.h
index de0e435..ee096bb 100644
--- a/src/tint/ir/builtin.h
+++ b/src/tint/ir/builtin.h
@@ -29,13 +29,8 @@
/// @param func the builtin function
/// @param args the conversion arguments
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& operator=(const Builtin& inst) = delete;
- Builtin& operator=(Builtin&& inst) = delete;
-
/// @returns the builtin function
builtin::Function Func() const { return func_; }
diff --git a/src/tint/ir/call.h b/src/tint/ir/call.h
index f4e12f9..c933331 100644
--- a/src/tint/ir/call.h
+++ b/src/tint/ir/call.h
@@ -23,13 +23,8 @@
/// A Call instruction in the IR.
class Call : public utils::Castable<Call, Instruction> {
public:
- Call(const Call& inst) = delete;
- Call(Call&& inst) = delete;
~Call() override;
- Call& operator=(const Call& inst) = delete;
- Call& operator=(Call&& inst) = delete;
-
/// @returns the type of the value
const type::Type* Type() const override { return result_type_; }
diff --git a/src/tint/ir/constant.h b/src/tint/ir/constant.h
index dcf3e5b..2df7250 100644
--- a/src/tint/ir/constant.h
+++ b/src/tint/ir/constant.h
@@ -26,13 +26,8 @@
/// Constructor
/// @param val the value stored in the constant
explicit Constant(const constant::Value* val);
- Constant(const Constant&) = delete;
- Constant(Constant&&) = delete;
~Constant() override;
- Constant& operator=(const Constant&) = delete;
- Constant& operator=(Constant&&) = delete;
-
/// @returns the constants value
const constant::Value* Value() const { return value_; }
diff --git a/src/tint/ir/construct.h b/src/tint/ir/construct.h
index b3ed6b6..f4da78d 100644
--- a/src/tint/ir/construct.h
+++ b/src/tint/ir/construct.h
@@ -27,12 +27,7 @@
/// @param type the result type
/// @param args the constructor arguments
Construct(const type::Type* type, utils::VectorRef<Value*> args);
- Construct(const Construct& inst) = delete;
- Construct(Construct&& inst) = delete;
~Construct() override;
-
- Construct& operator=(const Construct& inst) = delete;
- Construct& operator=(Construct&& inst) = delete;
};
} // namespace tint::ir
diff --git a/src/tint/ir/convert.h b/src/tint/ir/convert.h
index 9fdbc5c..77778e0 100644
--- a/src/tint/ir/convert.h
+++ b/src/tint/ir/convert.h
@@ -31,13 +31,8 @@
Convert(const type::Type* result_type,
const type::Type* from_type,
utils::VectorRef<Value*> args);
- Convert(const Convert& inst) = delete;
- Convert(Convert&& inst) = delete;
~Convert() override;
- Convert& operator=(const Convert& inst) = delete;
- Convert& operator=(Convert&& inst) = delete;
-
/// @returns the from type
const type::Type* FromType() const { return from_type_; }
/// @returns the to type
diff --git a/src/tint/ir/discard.h b/src/tint/ir/discard.h
index 2789e57..e87474c 100644
--- a/src/tint/ir/discard.h
+++ b/src/tint/ir/discard.h
@@ -26,12 +26,7 @@
public:
/// Constructor
Discard();
- Discard(const Discard& inst) = delete;
- Discard(Discard&& inst) = delete;
~Discard() override;
-
- Discard& operator=(const Discard& inst) = delete;
- Discard& operator=(Discard&& inst) = delete;
};
} // namespace tint::ir
diff --git a/src/tint/ir/function.h b/src/tint/ir/function.h
index 86465aa..e966e14 100644
--- a/src/tint/ir/function.h
+++ b/src/tint/ir/function.h
@@ -72,13 +72,8 @@
type::Type* rt,
PipelineStage stage = PipelineStage::kUndefined,
std::optional<std::array<uint32_t, 3>> wg_size = {});
- Function(Function&&) = delete;
- Function(const Function&) = delete;
~Function() override;
- Function& operator=(Function&&) = delete;
- Function& operator=(const Function&) = delete;
-
/// @returns the function name
Symbol Name() const { return name_; }
diff --git a/src/tint/ir/function_param.h b/src/tint/ir/function_param.h
index 1bbb812..2da0584 100644
--- a/src/tint/ir/function_param.h
+++ b/src/tint/ir/function_param.h
@@ -26,13 +26,8 @@
/// Constructor
/// @param type the type of the var
explicit FunctionParam(const type::Type* type);
- FunctionParam(const FunctionParam& inst) = delete;
- FunctionParam(FunctionParam&& inst) = delete;
~FunctionParam() override;
- FunctionParam& operator=(const FunctionParam& inst) = delete;
- FunctionParam& operator=(FunctionParam&& inst) = delete;
-
/// @returns the type of the var
const type::Type* Type() const override { return type_; }
diff --git a/src/tint/ir/if.h b/src/tint/ir/if.h
index d02c32a..d404c94 100644
--- a/src/tint/ir/if.h
+++ b/src/tint/ir/if.h
@@ -32,13 +32,8 @@
/// Constructor
/// @param cond the if condition
explicit If(Value* cond);
- If(const If&) = delete;
- If(If&&) = delete;
~If() override;
- If& operator=(const If&) = delete;
- If& operator=(If&&) = delete;
-
/// @returns the if condition
const Value* Condition() const { return condition_; }
diff --git a/src/tint/ir/instruction.h b/src/tint/ir/instruction.h
index 8b52f01..c3c18cd 100644
--- a/src/tint/ir/instruction.h
+++ b/src/tint/ir/instruction.h
@@ -23,14 +23,9 @@
/// An instruction in the IR.
class Instruction : public utils::Castable<Instruction, Value> {
public:
- Instruction(const Instruction& inst) = delete;
- Instruction(Instruction&& inst) = delete;
/// Destructor
~Instruction() override;
- Instruction& operator=(const Instruction& inst) = delete;
- Instruction& operator=(Instruction&& inst) = delete;
-
protected:
/// Constructor
Instruction();
diff --git a/src/tint/ir/load.h b/src/tint/ir/load.h
index e1a365f..bee65be 100644
--- a/src/tint/ir/load.h
+++ b/src/tint/ir/load.h
@@ -27,13 +27,8 @@
/// @param type the result type
/// @param from the value being loaded from
Load(const type::Type* type, Value* from);
- Load(const Load& inst) = delete;
- Load(Load&& inst) = delete;
~Load() override;
- Load& operator=(const Load& inst) = delete;
- Load& operator=(Load&& inst) = delete;
-
/// @returns the type of the value
const type::Type* Type() const override { return result_type_; }
diff --git a/src/tint/ir/loop.h b/src/tint/ir/loop.h
index 590f49c..44f7881 100644
--- a/src/tint/ir/loop.h
+++ b/src/tint/ir/loop.h
@@ -26,13 +26,8 @@
public:
/// Constructor
Loop();
- Loop(const Loop&) = delete;
- Loop(Loop&&) = delete;
~Loop() override;
- Loop& operator=(const Loop&) = delete;
- Loop& operator=(Loop&&) = delete;
-
/// @returns the switch start branch
const Branch& Start() const { return start_; }
/// @returns the switch start branch
diff --git a/src/tint/ir/root_terminator.h b/src/tint/ir/root_terminator.h
index c6338ba..361aa6d 100644
--- a/src/tint/ir/root_terminator.h
+++ b/src/tint/ir/root_terminator.h
@@ -25,12 +25,7 @@
public:
/// Constructor
RootTerminator();
- RootTerminator(const RootTerminator&) = delete;
- RootTerminator(RootTerminator&&) = delete;
~RootTerminator() override;
-
- RootTerminator& operator=(const RootTerminator&) = delete;
- RootTerminator& operator=(RootTerminator&&) = delete;
};
} // namespace tint::ir
diff --git a/src/tint/ir/store.h b/src/tint/ir/store.h
index af5377d..374fe54 100644
--- a/src/tint/ir/store.h
+++ b/src/tint/ir/store.h
@@ -27,13 +27,8 @@
/// @param to the value to store too
/// @param from the value being stored from
Store(Value* to, Value* from);
- Store(const Store& inst) = delete;
- Store(Store&& inst) = delete;
~Store() override;
- Store& operator=(const Store& inst) = delete;
- Store& operator=(Store&& inst) = delete;
-
/// @returns the value being stored too
Value* To() const { return to_; }
diff --git a/src/tint/ir/switch.h b/src/tint/ir/switch.h
index 2e977ec..b471999 100644
--- a/src/tint/ir/switch.h
+++ b/src/tint/ir/switch.h
@@ -51,13 +51,8 @@
/// Constructor
/// @param cond the condition
explicit Switch(Value* cond);
- Switch(const Switch&) = delete;
- Switch(Switch&&) = delete;
~Switch() override;
- Switch& operator=(const Switch&) = delete;
- Switch& operator=(Switch&&) = delete;
-
/// @returns the switch merge branch
const Branch& Merge() const { return merge_; }
/// @returns the switch merge branch
diff --git a/src/tint/ir/unary.h b/src/tint/ir/unary.h
index 98ad9b8..3b64b79 100644
--- a/src/tint/ir/unary.h
+++ b/src/tint/ir/unary.h
@@ -34,13 +34,8 @@
/// @param result_type the result type
/// @param val the input value for the instruction
Unary(enum Kind kind, const type::Type* result_type, Value* val);
- Unary(const Unary& inst) = delete;
- Unary(Unary&& inst) = delete;
~Unary() override;
- Unary& operator=(const Unary& inst) = delete;
- Unary& operator=(Unary&& inst) = delete;
-
/// @returns the type of the value
const type::Type* Type() const override { return result_type_; }
diff --git a/src/tint/ir/user_call.h b/src/tint/ir/user_call.h
index ba52e20..9e2e4c9 100644
--- a/src/tint/ir/user_call.h
+++ b/src/tint/ir/user_call.h
@@ -29,13 +29,8 @@
/// @param name the function name
/// @param args the function arguments
UserCall(const type::Type* type, Symbol name, utils::VectorRef<Value*> args);
- UserCall(const UserCall& inst) = delete;
- UserCall(UserCall&& inst) = delete;
~UserCall() override;
- UserCall& operator=(const UserCall& inst) = delete;
- UserCall& operator=(UserCall&& inst) = delete;
-
/// @returns the called function name
Symbol Name() const { return name_; }
diff --git a/src/tint/ir/value.h b/src/tint/ir/value.h
index 4b7810b..b090ad8 100644
--- a/src/tint/ir/value.h
+++ b/src/tint/ir/value.h
@@ -32,12 +32,6 @@
/// Destructor
~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.
/// @param inst the instruction
void AddUsage(const Instruction* inst) { uses_.Add(inst); }
diff --git a/src/tint/ir/var.h b/src/tint/ir/var.h
index 67ccf0d..8561e5c 100644
--- a/src/tint/ir/var.h
+++ b/src/tint/ir/var.h
@@ -28,13 +28,8 @@
/// Constructor
/// @param type the type of the var
explicit Var(const type::Type* type);
- Var(const Var& inst) = delete;
- Var(Var&& inst) = delete;
~Var() override;
- Var& operator=(const Var& inst) = delete;
- Var& operator=(Var&& inst) = delete;
-
/// @returns the type of the var
const type::Type* Type() const override { return type_; }