Add ability to clone types.

This CL adds a `Clone` method into the type base classes. This allows
the IR to clone types provided by the program into the IR context.

Bug: tint:1718
Change-Id: Ieebf011dcf40bedc98bf5acebd3888acfde863bc
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/116362
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Dan Sinclair <dsinclair@chromium.org>
Reviewed-by: Ben Clayton <bclayton@google.com>
This commit is contained in:
dan sinclair
2023-01-05 21:07:15 +00:00
committed by Dawn LUCI CQ
parent 0300dd0813
commit f8abdc7aef
77 changed files with 605 additions and 22 deletions

View File

@@ -63,6 +63,7 @@ class Any final : public Castable<Any, type::Type> {
// Stub implementations for type::Type conformance.
bool Equals(const type::UniqueNode&) const override { return false; }
std::string FriendlyName(const SymbolTable&) const override { return "<any>"; }
type::Type* Clone(type::CloneContext&) const override { return nullptr; }
};
/// Number is an 32 bit unsigned integer, which can be in one of three states: