Change generators to take a pointer instead of move.

This CL changes the generators so we don't have to move the module into
the generator. This will then allow calling the demangler at a later
point and still having access to the module.

Change-Id: Icad16ddb2b89921cbb174cf7fec520c410139285
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/36942
Reviewed-by: Ben Clayton <bclayton@google.com>
This commit is contained in:
dan sinclair
2021-01-11 16:24:32 +00:00
committed by dan sinclair
parent 7d152e0936
commit b920e604b2
15 changed files with 68 additions and 19 deletions

View File

@@ -550,7 +550,7 @@ int main(int argc, const char** argv) {
#if TINT_BUILD_SPV_WRITER
if (options.format == Format::kSpirv || options.format == Format::kSpvAsm) {
writer = std::make_unique<tint::writer::spirv::Generator>(std::move(mod));
writer = std::make_unique<tint::writer::spirv::Generator>(&mod);
}
#endif // TINT_BUILD_SPV_WRITER
@@ -562,13 +562,13 @@ int main(int argc, const char** argv) {
#if TINT_BUILD_MSL_WRITER
if (options.format == Format::kMsl) {
writer = std::make_unique<tint::writer::msl::Generator>(std::move(mod));
writer = std::make_unique<tint::writer::msl::Generator>(&mod);
}
#endif // TINT_BUILD_MSL_WRITER
#if TINT_BUILD_HLSL_WRITER
if (options.format == Format::kHlsl) {
writer = std::make_unique<tint::writer::hlsl::Generator>(std::move(mod));
writer = std::make_unique<tint::writer::hlsl::Generator>(&mod);
}
#endif // TINT_BUILD_HLSL_WRITER