From 8eb31304452a57c34ecdb9f249ea0fef233083ca Mon Sep 17 00:00:00 2001 From: James Price Date: Mon, 26 Aug 2024 22:47:00 +0000 Subject: [PATCH] [spirv] Remove PrintModule function This is no longer used or needed. Also remove the Printer::Module() method which was only used by PrintModule(). Change-Id: Ib387cd5c46bc396c4ddc0c03d85c00a4a0ae3ed6 Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/204094 Commit-Queue: James Price Reviewed-by: dan sinclair Auto-Submit: James Price --- src/tint/lang/spirv/writer/printer/printer.cc | 18 ------------------ src/tint/lang/spirv/writer/printer/printer.h | 5 ----- 2 files changed, 23 deletions(-) diff --git a/src/tint/lang/spirv/writer/printer/printer.cc b/src/tint/lang/spirv/writer/printer/printer.cc index 043f4270eef..8d8af5c09d8 100644 --- a/src/tint/lang/spirv/writer/printer/printer.cc +++ b/src/tint/lang/spirv/writer/printer/printer.cc @@ -204,20 +204,6 @@ class Printer { return std::move(writer.Result()); } - /// @returns the generated SPIR-V module on success, or failure - Result Module() { - if (auto res = Generate(); res != Success) { - return res.Failure(); - } - - // Serialize the module into binary SPIR-V. - BinaryWriter writer; - writer.WriteHeader(module_.IdBound(), kWriterVersion); - writer.WriteModule(module_); - module_.Code() = std::move(writer.Result()); - return module_; - } - private: core::ir::Module& ir_; core::ir::Builder b_; @@ -2469,8 +2455,4 @@ tint::Result> Print(core::ir::Module& module, const Option return Printer{module, options}.Code(); } -tint::Result PrintModule(core::ir::Module& module, const Options& options) { - return Printer{module, options}.Module(); -} - } // namespace tint::spirv::writer diff --git a/src/tint/lang/spirv/writer/printer/printer.h b/src/tint/lang/spirv/writer/printer/printer.h index 79abc31e7e3..d85b0da6c15 100644 --- a/src/tint/lang/spirv/writer/printer/printer.h +++ b/src/tint/lang/spirv/writer/printer/printer.h @@ -47,11 +47,6 @@ namespace tint::spirv::writer { /// @param options the printer options tint::Result> Print(core::ir::Module& module, const Options& options); -/// @returns the generated SPIR-V module on success, or failure -/// @param module the Tint IR module to generate -/// @param options the printer options -tint::Result PrintModule(core::ir::Module& module, const Options& options); - } // namespace tint::spirv::writer #endif // SRC_TINT_LANG_SPIRV_WRITER_PRINTER_PRINTER_H_