[shuffle] Rename spirv::writer::GeneratorImplIr
Rename GeneratorImplIr to Writer, and rename `generator_` to `writer_`
in the test helper.
Bug: tint:1988
Change-Id: I1f5e158806ca961c27bd8b85d2f240e27d6c1c38
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/142302
Reviewed-by: Dan Sinclair <dsinclair@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: James Price <jrprice@google.com>
Auto-Submit: James Price <jrprice@google.com>
diff --git a/src/tint/lang/spirv/writer/test_helper.h b/src/tint/lang/spirv/writer/test_helper.h
index be4f711..a2d704c 100644
--- a/src/tint/lang/spirv/writer/test_helper.h
+++ b/src/tint/lang/spirv/writer/test_helper.h
@@ -62,11 +62,11 @@
return out;
}
-/// Base helper class for testing the SPIR-V generator implementation.
+/// Base helper class for testing the SPIR-V writer implementation.
template <typename BASE>
class SpirvWriterTestHelperBase : public BASE {
public:
- SpirvWriterTestHelperBase() : generator_(&mod, false) {}
+ SpirvWriterTestHelperBase() : writer_(&mod, false) {}
/// The test module.
ir::Module mod;
@@ -76,8 +76,8 @@
type::Manager& ty{mod.Types()};
protected:
- /// The SPIR-V generator.
- GeneratorImplIr generator_;
+ /// The SPIR-V writer.
+ Writer writer_;
/// Errors produced during codegen or SPIR-V validation.
std::string err_;
@@ -88,29 +88,29 @@
/// @returns the error string from the validation
std::string Error() const { return err_; }
- /// Run the specified generator on the IR module and validate the result.
- /// @param generator the generator to use for SPIR-V generation
+ /// Run the specified writer on the IR module and validate the result.
+ /// @param writer the writer to use for SPIR-V generation
/// @returns true if generation and validation succeeded
- bool Generate(GeneratorImplIr& generator) {
- if (!generator.Generate()) {
- err_ = generator.Diagnostics().str();
+ bool Generate(Writer& writer) {
+ if (!writer.Generate()) {
+ err_ = writer.Diagnostics().str();
return false;
}
- output_ = Disassemble(generator.Result(), SPV_BINARY_TO_TEXT_OPTION_FRIENDLY_NAMES |
- SPV_BINARY_TO_TEXT_OPTION_INDENT |
- SPV_BINARY_TO_TEXT_OPTION_COMMENT);
+ output_ = Disassemble(writer.Result(), SPV_BINARY_TO_TEXT_OPTION_FRIENDLY_NAMES |
+ SPV_BINARY_TO_TEXT_OPTION_INDENT |
+ SPV_BINARY_TO_TEXT_OPTION_COMMENT);
- if (!Validate(generator.Result())) {
+ if (!Validate(writer.Result())) {
return false;
}
return true;
}
- /// Run the generator on the IR module and validate the result.
+ /// Run the writer on the IR module and validate the result.
/// @returns true if generation and validation succeeded
- bool Generate() { return Generate(generator_); }
+ bool Generate() { return Generate(writer_); }
/// Validate the generated SPIR-V using the SPIR-V Tools Validator.
/// @param binary the SPIR-V binary module to validate
@@ -148,7 +148,7 @@
}
/// @returns the disassembled types from the generated module.
- std::string DumpTypes() { return DumpInstructions(generator_.Module().Types()); }
+ std::string DumpTypes() { return DumpInstructions(writer_.Module().Types()); }
/// Helper to make a scalar type corresponding to the element type `type`.
/// @param type the element type