[ir] Add ability to clone in the IR.
Add support for cloning in the IR.
This CL is based off of https://dawn-review.googlesource.com/c/dawn/+/152400
Bug: tint:1718
Change-Id: I8fce30872ad2c02c59363d2cd8b5771917d97342
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/152221
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Ben Clayton <bclayton@google.com>
Reviewed-by: Ben Clayton <bclayton@google.com>
diff --git a/src/tint/lang/core/ir/convert.h b/src/tint/lang/core/ir/convert.h
index 1c58228..6699c18 100644
--- a/src/tint/lang/core/ir/convert.h
+++ b/src/tint/lang/core/ir/convert.h
@@ -24,7 +24,7 @@
namespace tint::core::ir {
/// A value conversion instruction in the IR.
-class Convert : public Castable<Convert, Call> {
+class Convert final : public Castable<Convert, Call> {
public:
/// The offset in Operands() for the value
static constexpr size_t kValueOperandOffset = 0;
@@ -35,6 +35,9 @@
Convert(InstructionResult* result, Value* value);
~Convert() override;
+ /// @copydoc Instruction::Clone()
+ Convert* Clone(CloneContext& ctx) override;
+
/// @returns the friendly name for the instruction
std::string FriendlyName() override { return "convert"; }
};