Update name of the disassembler
This Cl updates the name of the disassembly to disassembler to be closer
to what what the object is doing.
Change-Id: I153ffe9b172cb3b311f536b295c1306e5b6b1374
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/192520
Commit-Queue: dan sinclair <dsinclair@chromium.org>
Reviewed-by: James Price <jrprice@google.com>
Commit-Queue: James Price <jrprice@google.com>
Auto-Submit: dan sinclair <dsinclair@chromium.org>
diff --git a/src/tint/cmd/tint/main.cc b/src/tint/cmd/tint/main.cc
index e1e2313..bf0f8ea 100644
--- a/src/tint/cmd/tint/main.cc
+++ b/src/tint/cmd/tint/main.cc
@@ -41,7 +41,7 @@
#include "src/tint/api/tint.h"
#include "src/tint/cmd/common/helper.h"
-#include "src/tint/lang/core/ir/disassembly.h"
+#include "src/tint/lang/core/ir/disassembler.h"
#include "src/tint/lang/core/ir/module.h"
#include "src/tint/lang/wgsl/ast/module.h"
#include "src/tint/lang/wgsl/ast/transform/first_index_offset.h"
@@ -1264,7 +1264,7 @@
return false;
}
- options.printer->Print(tint::core::ir::Disassemble(result.Get()).Text());
+ options.printer->Print(tint::core::ir::Disassembler(result.Get()).Text());
options.printer->Print(tint::StyledText{} << "\n");
return true;
diff --git a/src/tint/lang/core/ir/BUILD.bazel b/src/tint/lang/core/ir/BUILD.bazel
index cae2a1b..d3867a6 100644
--- a/src/tint/lang/core/ir/BUILD.bazel
+++ b/src/tint/lang/core/ir/BUILD.bazel
@@ -57,7 +57,7 @@
"core_binary.cc",
"core_builtin_call.cc",
"core_unary.cc",
- "disassembly.cc",
+ "disassembler.cc",
"discard.cc",
"exit.cc",
"exit_if.cc",
@@ -110,7 +110,7 @@
"core_binary.h",
"core_builtin_call.h",
"core_unary.h",
- "disassembly.h",
+ "disassembler.h",
"discard.h",
"exit.h",
"exit_if.h",
diff --git a/src/tint/lang/core/ir/BUILD.cmake b/src/tint/lang/core/ir/BUILD.cmake
index 2dd7556..91320f2 100644
--- a/src/tint/lang/core/ir/BUILD.cmake
+++ b/src/tint/lang/core/ir/BUILD.cmake
@@ -78,8 +78,8 @@
lang/core/ir/core_builtin_call.h
lang/core/ir/core_unary.cc
lang/core/ir/core_unary.h
- lang/core/ir/disassembly.cc
- lang/core/ir/disassembly.h
+ lang/core/ir/disassembler.cc
+ lang/core/ir/disassembler.h
lang/core/ir/discard.cc
lang/core/ir/discard.h
lang/core/ir/exit.cc
diff --git a/src/tint/lang/core/ir/BUILD.gn b/src/tint/lang/core/ir/BUILD.gn
index 15bde8b..8bdc863 100644
--- a/src/tint/lang/core/ir/BUILD.gn
+++ b/src/tint/lang/core/ir/BUILD.gn
@@ -80,8 +80,8 @@
"core_builtin_call.h",
"core_unary.cc",
"core_unary.h",
- "disassembly.cc",
- "disassembly.h",
+ "disassembler.cc",
+ "disassembler.h",
"discard.cc",
"discard.h",
"exit.cc",
diff --git a/src/tint/lang/core/ir/binary/roundtrip_fuzz.cc b/src/tint/lang/core/ir/binary/roundtrip_fuzz.cc
index a7d753b..822d078 100644
--- a/src/tint/lang/core/ir/binary/roundtrip_fuzz.cc
+++ b/src/tint/lang/core/ir/binary/roundtrip_fuzz.cc
@@ -28,7 +28,7 @@
#include "src/tint/cmd/fuzz/ir/fuzz.h"
#include "src/tint/lang/core/ir/binary/decode.h"
#include "src/tint/lang/core/ir/binary/encode.h"
-#include "src/tint/lang/core/ir/disassembly.h"
+#include "src/tint/lang/core/ir/disassembler.h"
namespace tint::core::ir::binary {
namespace {
@@ -44,8 +44,8 @@
TINT_ICE() << "Decode() failed\n" << decoded.Failure();
}
- auto in = Disassemble(module).Plain();
- auto out = Disassemble(decoded.Get()).Plain();
+ auto in = Disassembler(module).Plain();
+ auto out = Disassembler(decoded.Get()).Plain();
if (in != out) {
TINT_ICE() << "Roundtrip produced different disassembly\n"
<< "-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-\n"
diff --git a/src/tint/lang/core/ir/binary/roundtrip_test.cc b/src/tint/lang/core/ir/binary/roundtrip_test.cc
index 3cfe333..3e5492b 100644
--- a/src/tint/lang/core/ir/binary/roundtrip_test.cc
+++ b/src/tint/lang/core/ir/binary/roundtrip_test.cc
@@ -29,7 +29,7 @@
#include "src/tint/lang/core/ir/binary/decode.h"
#include "src/tint/lang/core/ir/binary/encode.h"
-#include "src/tint/lang/core/ir/disassembly.h"
+#include "src/tint/lang/core/ir/disassembler.h"
#include "src/tint/lang/core/type/depth_multisampled_texture.h"
#include "src/tint/lang/core/type/depth_texture.h"
#include "src/tint/lang/core/type/external_texture.h"
@@ -48,7 +48,7 @@
class IRBinaryRoundtripTestBase : public IRTestParamHelper<T> {
public:
std::pair<std::string, std::string> Roundtrip() {
- auto pre = Disassemble(this->mod).Plain();
+ auto pre = Disassembler(this->mod).Plain();
auto encoded = Encode(this->mod);
if (encoded != Success) {
return {pre, encoded.Failure().reason.Str()};
@@ -57,7 +57,7 @@
if (decoded != Success) {
return {pre, decoded.Failure().reason.Str()};
}
- auto post = Disassemble(decoded.Get()).Plain();
+ auto post = Disassembler(decoded.Get()).Plain();
return {pre, post};
}
};
diff --git a/src/tint/lang/core/ir/disassembly.cc b/src/tint/lang/core/ir/disassembler.cc
similarity index 93%
rename from src/tint/lang/core/ir/disassembly.cc
rename to src/tint/lang/core/ir/disassembler.cc
index 5d5aa18..eefefa3 100644
--- a/src/tint/lang/core/ir/disassembly.cc
+++ b/src/tint/lang/core/ir/disassembler.cc
@@ -25,7 +25,7 @@
// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-#include "src/tint/lang/core/ir/disassembly.h"
+#include "src/tint/lang/core/ir/disassembler.h"
#include <algorithm>
#include <memory>
@@ -102,11 +102,11 @@
} // namespace
-Disassembly::Disassembly(Disassembly&&) = default;
+Disassembler::Disassembler(Disassembler&&) = default;
-Disassembly::Disassembly(const Module& mod, std::string_view file_name) : mod_(mod) {
+Disassembler::Disassembler(const Module& mod) : mod_(mod) {
Disassemble();
- file_ = std::make_shared<Source::File>(std::string(file_name), Plain());
+ file_ = std::make_shared<Source::File>("", Plain());
auto set_source_file = [&](auto& map) {
for (auto& it : map) {
@@ -122,9 +122,9 @@
set_source_file(function_param_to_src_);
}
-Disassembly::~Disassembly() = default;
+Disassembler::~Disassembler() = default;
-void Disassembly::Disassemble() {
+void Disassembler::Disassemble() {
TINT_DEFER(out_ << StylePlain);
out_.Clear();
out_ << StyleCode;
@@ -145,27 +145,27 @@
}
}
-StyledText& Disassembly::Indent() {
+StyledText& Disassembler::Indent() {
for (uint32_t i = 0; i < indent_size_; i++) {
out_ << " ";
}
return out_;
}
-void Disassembly::EmitLine() {
+void Disassembler::EmitLine() {
out_ << "\n";
current_output_line_ += 1;
current_output_start_pos_ = static_cast<uint32_t>(out_.Length());
}
-Source::Location Disassembly::MakeCurrentLocation() {
+Source::Location Disassembler::MakeCurrentLocation() {
return Source::Location{
current_output_line_,
static_cast<uint32_t>(out_.Length()) - current_output_start_pos_ + 1,
};
}
-void Disassembly::EmitBlock(const Block* blk, std::string_view comment /* = "" */) {
+void Disassembler::EmitBlock(const Block* blk, std::string_view comment /* = "" */) {
Indent();
SourceMarker sm(this);
@@ -207,12 +207,12 @@
EmitLine();
}
-void Disassembly::EmitBindingPoint(BindingPoint p) {
+void Disassembler::EmitBindingPoint(BindingPoint p) {
out_ << StyleAttribute("@binding_point") << "(" << StyleLiteral(p.group) << ", "
<< StyleLiteral(p.binding) << ")";
}
-void Disassembly::EmitLocation(Location loc) {
+void Disassembler::EmitLocation(Location loc) {
out_ << StyleAttribute("@location") << "(" << loc.value << ")";
if (loc.interpolation.has_value()) {
out_ << ", " << StyleAttribute("@interpolate") << "(";
@@ -225,7 +225,7 @@
}
}
-void Disassembly::EmitParamAttributes(const FunctionParam* p) {
+void Disassembler::EmitParamAttributes(const FunctionParam* p) {
if (!p->Invariant() && !p->Location().has_value() && !p->BindingPoint().has_value() &&
!p->Builtin().has_value()) {
return;
@@ -262,7 +262,7 @@
out_ << "]";
}
-void Disassembly::EmitReturnAttributes(const Function* func) {
+void Disassembler::EmitReturnAttributes(const Function* func) {
if (!func->ReturnInvariant() && !func->ReturnLocation().has_value() &&
!func->ReturnBuiltin().has_value()) {
return;
@@ -294,7 +294,7 @@
out_ << "]";
}
-void Disassembly::EmitFunction(const Function* func) {
+void Disassembler::EmitFunction(const Function* func) {
in_function_ = true;
auto fn_id = NameOf(func);
@@ -362,20 +362,20 @@
EmitLine();
}
-void Disassembly::EmitValueWithType(const Instruction* val) {
+void Disassembler::EmitValueWithType(const Instruction* val) {
SourceMarker sm(this);
EmitValueWithType(val->Result(0));
sm.StoreResult(IndexedValue{val, 0});
}
-void Disassembly::EmitValueWithType(const Value* val) {
+void Disassembler::EmitValueWithType(const Value* val) {
EmitValue(val);
if (val) {
out_ << ":" << StyleType(val->Type()->FriendlyName());
}
}
-void Disassembly::EmitValue(const Value* val) {
+void Disassembler::EmitValue(const Value* val) {
if (!val) {
out_ << StyleLiteral("undef");
return;
@@ -426,13 +426,13 @@
[&](Default) { out_ << NameOf(val); });
}
-void Disassembly::EmitInstructionName(const Instruction* inst) {
+void Disassembler::EmitInstructionName(const Instruction* inst) {
SourceMarker sm(this);
out_ << StyleInstruction(inst->FriendlyName());
sm.Store(inst);
}
-void Disassembly::EmitInstruction(const Instruction* inst) {
+void Disassembler::EmitInstruction(const Instruction* inst) {
TINT_DEFER(EmitLine());
if (!inst->Alive()) {
@@ -572,13 +572,13 @@
}
}
-void Disassembly::EmitOperand(const Instruction* inst, size_t index) {
+void Disassembler::EmitOperand(const Instruction* inst, size_t index) {
SourceMarker marker(this);
EmitValue(inst->Operand(index));
marker.Store(IndexedValue{inst, static_cast<uint32_t>(index)});
}
-void Disassembly::EmitOperandList(const Instruction* inst, size_t start_index /* = 0 */) {
+void Disassembler::EmitOperandList(const Instruction* inst, size_t start_index /* = 0 */) {
for (size_t i = start_index, n = inst->Operands().Length(); i < n; i++) {
if (i != start_index) {
out_ << ", ";
@@ -587,7 +587,7 @@
}
}
-void Disassembly::EmitOperandList(const Instruction* inst, size_t start_index, size_t count) {
+void Disassembler::EmitOperandList(const Instruction* inst, size_t start_index, size_t count) {
size_t n = std::min(start_index + count, inst->Operands().Length());
for (size_t i = start_index; i < n; i++) {
if (i != start_index) {
@@ -597,7 +597,7 @@
}
}
-void Disassembly::EmitIf(const If* if_) {
+void Disassembler::EmitIf(const If* if_) {
SourceMarker sm(this);
if (auto results = if_->Results(); !results.IsEmpty()) {
for (size_t i = 0; i < results.Length(); ++i) {
@@ -648,7 +648,7 @@
out_ << "}";
}
-void Disassembly::EmitLoop(const Loop* l) {
+void Disassembler::EmitLoop(const Loop* l) {
SourceMarker sm(this);
if (auto results = l->Results(); !results.IsEmpty()) {
for (size_t i = 0; i < results.Length(); ++i) {
@@ -701,7 +701,7 @@
out_ << "}";
}
-void Disassembly::EmitSwitch(const Switch* s) {
+void Disassembler::EmitSwitch(const Switch* s) {
SourceMarker sm(this);
if (auto results = s->Results(); !results.IsEmpty()) {
for (size_t i = 0; i < results.Length(); ++i) {
@@ -750,7 +750,7 @@
out_ << "}";
}
-void Disassembly::EmitTerminator(const Terminator* term) {
+void Disassembler::EmitTerminator(const Terminator* term) {
SourceMarker sm(this);
auto args_offset = tint::Switch<std::optional<size_t>>(
term,
@@ -836,7 +836,7 @@
});
}
-void Disassembly::EmitBinary(const Binary* b) {
+void Disassembler::EmitBinary(const Binary* b) {
SourceMarker sm(this);
EmitValueWithType(b);
out_ << " = " << NameOf(b->Op()) << " ";
@@ -845,7 +845,7 @@
sm.Store(b);
}
-void Disassembly::EmitUnary(const Unary* u) {
+void Disassembler::EmitUnary(const Unary* u) {
SourceMarker sm(this);
EmitValueWithType(u);
out_ << " = " << NameOf(u->Op()) << " ";
@@ -854,7 +854,7 @@
sm.Store(u);
}
-void Disassembly::EmitStructDecl(const core::type::Struct* str) {
+void Disassembler::EmitStructDecl(const core::type::Struct* str) {
out_ << StyleType(str->Name().Name()) << " = " << StyleKeyword("struct") << " "
<< StyleAttribute("@align") << "(" << StyleLiteral(str->Align()) << ")";
if (str->StructFlags().Contains(core::type::StructFlag::kBlock)) {
@@ -892,13 +892,13 @@
EmitLine();
}
-StyledText Disassembly::NameOf(const Block* node) {
+StyledText Disassembler::NameOf(const Block* node) {
TINT_ASSERT(node);
auto id = block_ids_.GetOrAdd(node, [&] { return block_ids_.Count(); });
return StyledText{} << StyleLabel("$B", id);
}
-StyledText Disassembly::NameOf(const Value* value) {
+StyledText Disassembler::NameOf(const Value* value) {
TINT_ASSERT(value);
auto id = value_ids_.GetOrAdd(value, [&] {
if (auto sym = mod_.NameOf(value)) {
@@ -923,7 +923,7 @@
return StyledText{} << style("%", id);
}
-StyledText Disassembly::NameOf(const If* inst) {
+StyledText Disassembler::NameOf(const If* inst) {
if (!inst) {
return StyledText{} << StyleError("undef");
}
@@ -932,7 +932,7 @@
return StyledText{} << StyleInstruction(name);
}
-StyledText Disassembly::NameOf(const Loop* inst) {
+StyledText Disassembler::NameOf(const Loop* inst) {
if (!inst) {
return StyledText{} << StyleError("undef");
}
@@ -942,7 +942,7 @@
return StyledText{} << StyleInstruction(name);
}
-StyledText Disassembly::NameOf(const Switch* inst) {
+StyledText Disassembler::NameOf(const Switch* inst) {
if (!inst) {
return StyledText{} << StyleError("undef");
}
@@ -952,7 +952,7 @@
return StyledText{} << StyleInstruction(name);
}
-StyledText Disassembly::NameOf(BinaryOp op) {
+StyledText Disassembler::NameOf(BinaryOp op) {
switch (op) {
case BinaryOp::kAdd:
return StyledText{} << StyleInstruction("add");
@@ -994,7 +994,7 @@
TINT_UNREACHABLE() << op;
}
-StyledText Disassembly::NameOf(UnaryOp op) {
+StyledText Disassembler::NameOf(UnaryOp op) {
switch (op) {
case UnaryOp::kComplement:
return StyledText{} << StyleInstruction("complement");
diff --git a/src/tint/lang/core/ir/disassembly.h b/src/tint/lang/core/ir/disassembler.h
similarity index 93%
rename from src/tint/lang/core/ir/disassembly.h
rename to src/tint/lang/core/ir/disassembler.h
index 99dfced..24dd2a8 100644
--- a/src/tint/lang/core/ir/disassembly.h
+++ b/src/tint/lang/core/ir/disassembler.h
@@ -25,8 +25,8 @@
// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-#ifndef SRC_TINT_LANG_CORE_IR_DISASSEMBLY_H_
-#define SRC_TINT_LANG_CORE_IR_DISASSEMBLY_H_
+#ifndef SRC_TINT_LANG_CORE_IR_DISASSEMBLER_H_
+#define SRC_TINT_LANG_CORE_IR_DISASSEMBLER_H_
#include <memory>
#include <string>
@@ -52,8 +52,8 @@
namespace tint::core::ir {
-/// Disassembly holds the disassembly of an IR module.
-class Disassembly {
+/// Disassembler is responsible for creating the disassembly of an IR module.
+class Disassembler {
public:
/// A reference to an instruction's operand or result.
struct IndexedValue {
@@ -77,13 +77,13 @@
/// Performs the disassembly of the module @p mod, constructing a Source::File with the name @p
/// file_name.
/// @param mod the module to disassemble
- Disassembly(const Module& mod, std::string_view file_name);
+ explicit Disassembler(const Module& mod);
/// Move constructor
- Disassembly(Disassembly&&);
+ Disassembler(Disassembler&&);
/// Destructor
- ~Disassembly();
+ ~Disassembler();
/// @returns the string representation of the module
const StyledText& Text() const { return out_; }
@@ -154,6 +154,34 @@
}
private:
+ class SourceMarker {
+ public:
+ explicit SourceMarker(Disassembler* d) : dis_(d), begin_(dis_->MakeCurrentLocation()) {}
+ ~SourceMarker() = default;
+
+ void Store(const Instruction* inst) { dis_->SetSource(inst, MakeSource()); }
+
+ void Store(const Block* blk) { dis_->SetSource(blk, MakeSource()); }
+
+ void Store(const BlockParam* param) { dis_->SetSource(param, MakeSource()); }
+
+ void Store(const Function* func) { dis_->SetSource(func, MakeSource()); }
+
+ void Store(const FunctionParam* param) { dis_->SetSource(param, MakeSource()); }
+
+ void Store(IndexedValue operand) { dis_->SetSource(operand, MakeSource()); }
+
+ void StoreResult(IndexedValue result) { dis_->SetResultSource(result, MakeSource()); }
+
+ Source MakeSource() const {
+ return Source(Source::Range(begin_, dis_->MakeCurrentLocation()));
+ }
+
+ private:
+ Disassembler* dis_ = nullptr;
+ Source::Location begin_;
+ };
+
/// Performs the disassembling of the module.
void Disassemble();
@@ -197,34 +225,6 @@
/// @returns the source location for the current emission location
Source::Location MakeCurrentLocation();
- class SourceMarker {
- public:
- explicit SourceMarker(Disassembly* d) : dis_(d), begin_(dis_->MakeCurrentLocation()) {}
- ~SourceMarker() = default;
-
- void Store(const Instruction* inst) { dis_->SetSource(inst, MakeSource()); }
-
- void Store(const Block* blk) { dis_->SetSource(blk, MakeSource()); }
-
- void Store(const BlockParam* param) { dis_->SetSource(param, MakeSource()); }
-
- void Store(const Function* func) { dis_->SetSource(func, MakeSource()); }
-
- void Store(const FunctionParam* param) { dis_->SetSource(param, MakeSource()); }
-
- void Store(IndexedValue operand) { dis_->SetSource(operand, MakeSource()); }
-
- void StoreResult(IndexedValue result) { dis_->SetResultSource(result, MakeSource()); }
-
- Source MakeSource() const {
- return Source(Source::Range(begin_, dis_->MakeCurrentLocation()));
- }
-
- private:
- Disassembly* dis_ = nullptr;
- Source::Location begin_;
- };
-
StyledText& Indent();
void EmitBlock(const Block* blk, std::string_view comment = "");
@@ -276,11 +276,6 @@
Hashset<std::string, 32> ids_;
};
-/// @returns the disassembly for the module @p mod, using the file name @p file_name
-inline Disassembly Disassemble(const Module& mod, std::string_view file_name = "") {
- return Disassembly(mod, file_name);
-}
-
} // namespace tint::core::ir
-#endif // SRC_TINT_LANG_CORE_IR_DISASSEMBLY_H_
+#endif // SRC_TINT_LANG_CORE_IR_DISASSEMBLER_H_
diff --git a/src/tint/lang/core/ir/ice.h b/src/tint/lang/core/ir/ice.h
index cdc3e09..f798073 100644
--- a/src/tint/lang/core/ir/ice.h
+++ b/src/tint/lang/core/ir/ice.h
@@ -28,9 +28,9 @@
#ifndef SRC_TINT_LANG_CORE_IR_ICE_H_
#define SRC_TINT_LANG_CORE_IR_ICE_H_
-#include "src/tint/lang/core/ir/disassembly.h"
+#include "src/tint/lang/core/ir/disassembler.h"
/// Emit an ICE message with the disassembly of `mod` attached.
-#define TINT_IR_ICE(mod) TINT_ICE() << tint::core::ir::Disassemble(mod).Plain() << "\n"
+#define TINT_IR_ICE(mod) TINT_ICE() << tint::core::ir::Disassembler(mod).Plain() << "\n"
#endif // SRC_TINT_LANG_CORE_IR_ICE_H_
diff --git a/src/tint/lang/core/ir/transform/common/referenced_module_vars_test.cc b/src/tint/lang/core/ir/transform/common/referenced_module_vars_test.cc
index 3a5a032..a8ee411 100644
--- a/src/tint/lang/core/ir/transform/common/referenced_module_vars_test.cc
+++ b/src/tint/lang/core/ir/transform/common/referenced_module_vars_test.cc
@@ -30,7 +30,7 @@
#include <string>
#include "gmock/gmock.h"
-#include "src/tint/lang/core/ir/disassembly.h"
+#include "src/tint/lang/core/ir/disassembler.h"
#include "src/tint/lang/core/ir/ir_helper_test.h"
namespace tint::core::ir {
@@ -44,7 +44,7 @@
class IR_ReferencedModuleVarsTest : public IRTestHelper {
protected:
/// @returns the module as a disassembled string
- std::string Disassemble() const { return "\n" + ir::Disassemble(mod).Plain(); }
+ std::string Disassemble() const { return "\n" + ir::Disassembler(mod).Plain(); }
};
TEST_F(IR_ReferencedModuleVarsTest, EmptyRootBlock) {
diff --git a/src/tint/lang/core/ir/transform/direct_variable_access_wgsl_test.cc b/src/tint/lang/core/ir/transform/direct_variable_access_wgsl_test.cc
index dd5da1d..5ae4d32 100644
--- a/src/tint/lang/core/ir/transform/direct_variable_access_wgsl_test.cc
+++ b/src/tint/lang/core/ir/transform/direct_variable_access_wgsl_test.cc
@@ -81,7 +81,7 @@
return "DirectVariableAccess failed:\n" + res.Failure().reason.Str();
}
- auto pre_raise = ir::Disassemble(module.Get()).Plain();
+ auto pre_raise = ir::Disassembler(module.Get()).Plain();
if (auto raise = wgsl::writer::Raise(module.Get()); raise != Success) {
return "wgsl::writer::Raise failed:\n" + res.Failure().reason.Str();
@@ -90,15 +90,15 @@
auto program_out = wgsl::writer::IRToProgram(module.Get(), program_options);
if (!program_out.IsValid()) {
return "wgsl::writer::IRToProgram() failed: \n" + program_out.Diagnostics().Str() +
- "\n\nIR (pre):\n" + pre_raise + //
- "\n\nIR (post):\n" + ir::Disassemble(module.Get()).Plain() + //
+ "\n\nIR (pre):\n" + pre_raise + //
+ "\n\nIR (post):\n" + ir::Disassembler(module.Get()).Plain() + //
"\n\nAST:\n" + Program::printer(program_out);
}
auto output = wgsl::writer::Generate(program_out, wgsl::writer::Options{});
if (output != Success) {
return "wgsl::writer::IRToProgram() failed: \n" + output.Failure().reason.Str() +
- "\n\nIR:\n" + ir::Disassemble(module.Get()).Plain();
+ "\n\nIR:\n" + ir::Disassembler(module.Get()).Plain();
}
return "\n" + output->wgsl;
diff --git a/src/tint/lang/core/ir/transform/helper_test.h b/src/tint/lang/core/ir/transform/helper_test.h
index 8daa4d0..e0e2583 100644
--- a/src/tint/lang/core/ir/transform/helper_test.h
+++ b/src/tint/lang/core/ir/transform/helper_test.h
@@ -35,7 +35,7 @@
#include "gtest/gtest.h"
#include "src/tint/lang/core/ir/builder.h"
-#include "src/tint/lang/core/ir/disassembly.h"
+#include "src/tint/lang/core/ir/disassembler.h"
#include "src/tint/lang/core/ir/validator.h"
#include "src/tint/utils/containers/enum_set.h"
@@ -62,7 +62,7 @@
}
/// @returns the transformed module as a disassembled string
- std::string str() { return "\n" + ir::Disassemble(mod).Plain(); }
+ std::string str() { return "\n" + ir::Disassembler(mod).Plain(); }
protected:
/// The test IR module.
diff --git a/src/tint/lang/core/ir/transform/rename_conflicts_test.cc b/src/tint/lang/core/ir/transform/rename_conflicts_test.cc
index 74ee81a..7e4a983 100644
--- a/src/tint/lang/core/ir/transform/rename_conflicts_test.cc
+++ b/src/tint/lang/core/ir/transform/rename_conflicts_test.cc
@@ -32,7 +32,7 @@
#include "gtest/gtest.h"
#include "src/tint/lang/core/ir/builder.h"
-#include "src/tint/lang/core/ir/disassembly.h"
+#include "src/tint/lang/core/ir/disassembler.h"
#include "src/tint/lang/core/ir/validator.h"
#include "src/tint/lang/core/type/matrix.h"
@@ -65,7 +65,7 @@
}
/// @returns the transformed module as a disassembled string
- std::string str() { return "\n" + core::ir::Disassemble(mod).Plain(); }
+ std::string str() { return "\n" + core::ir::Disassembler(mod).Plain(); }
protected:
/// The test IR module.
diff --git a/src/tint/lang/core/ir/validator.cc b/src/tint/lang/core/ir/validator.cc
index 4f13d0f..e286ca5 100644
--- a/src/tint/lang/core/ir/validator.cc
+++ b/src/tint/lang/core/ir/validator.cc
@@ -46,7 +46,7 @@
#include "src/tint/lang/core/ir/control_instruction.h"
#include "src/tint/lang/core/ir/convert.h"
#include "src/tint/lang/core/ir/core_builtin_call.h"
-#include "src/tint/lang/core/ir/disassembly.h"
+#include "src/tint/lang/core/ir/disassembler.h"
#include "src/tint/lang/core/ir/discard.h"
#include "src/tint/lang/core/ir/exit_if.h"
#include "src/tint/lang/core/ir/exit_loop.h"
@@ -175,7 +175,7 @@
private:
/// @returns the IR disassembly, performing a disassemble if this is the first call.
- ir::Disassembly& Disassembly();
+ ir::Disassembler& Disassemble();
/// Adds an error for the @p inst and highlights the instruction in the disassembly
/// @param inst the instruction
@@ -495,7 +495,7 @@
const Module& mod_;
Capabilities capabilities_;
- std::optional<ir::Disassembly> disassembly_; // Use Disassembly()
+ std::optional<ir::Disassembler> disassembler_; // Use Disassemble()
diag::List diagnostics_;
Hashset<const Function*, 4> all_functions_;
Hashset<const Instruction*, 4> visited_instructions_;
@@ -513,11 +513,11 @@
Validator::~Validator() = default;
-Disassembly& Validator::Disassembly() {
- if (!disassembly_) {
- disassembly_.emplace(Disassemble(mod_));
+Disassembler& Validator::Disassemble() {
+ if (!disassembler_) {
+ disassembler_.emplace(ir::Disassembler(mod_));
}
- return *disassembly_;
+ return *disassembler_;
}
Result<SuccessType> Validator::Run() {
@@ -553,7 +553,7 @@
}
if (diagnostics_.ContainsErrors()) {
- diagnostics_.AddNote(Source{}) << "# Disassembly\n" << Disassembly().Text();
+ diagnostics_.AddNote(Source{}) << "# Disassembly\n" << Disassemble().Text();
return Failure{std::move(diagnostics_)};
}
return Success;
@@ -561,7 +561,7 @@
diag::Diagnostic& Validator::AddError(const Instruction* inst) {
diagnostics_.ReserveAdditional(2); // Ensure diagnostics don't resize alive after AddNote()
- auto src = Disassembly().InstructionSource(inst);
+ auto src = Disassemble().InstructionSource(inst);
auto& diag = AddError(src) << inst->FriendlyName() << ": ";
if (!block_stack_.IsEmpty()) {
@@ -573,7 +573,7 @@
diag::Diagnostic& Validator::AddError(const Instruction* inst, size_t idx) {
diagnostics_.ReserveAdditional(2); // Ensure diagnostics don't resize alive after AddNote()
auto src =
- Disassembly().OperandSource(Disassembly::IndexedValue{inst, static_cast<uint32_t>(idx)});
+ Disassemble().OperandSource(Disassembler::IndexedValue{inst, static_cast<uint32_t>(idx)});
auto& diag = AddError(src) << inst->FriendlyName() << ": ";
if (!block_stack_.IsEmpty()) {
@@ -585,7 +585,7 @@
diag::Diagnostic& Validator::AddResultError(const Instruction* inst, size_t idx) {
diagnostics_.ReserveAdditional(2); // Ensure diagnostics don't resize alive after AddNote()
auto src =
- Disassembly().ResultSource(Disassembly::IndexedValue{inst, static_cast<uint32_t>(idx)});
+ Disassemble().ResultSource(Disassembler::IndexedValue{inst, static_cast<uint32_t>(idx)});
auto& diag = AddError(src) << inst->FriendlyName() << ": ";
if (!block_stack_.IsEmpty()) {
@@ -595,61 +595,61 @@
}
diag::Diagnostic& Validator::AddError(const Block* blk) {
- auto src = Disassembly().BlockSource(blk);
+ auto src = Disassemble().BlockSource(blk);
return AddError(src);
}
diag::Diagnostic& Validator::AddError(const BlockParam* param) {
- auto src = Disassembly().BlockParamSource(param);
+ auto src = Disassemble().BlockParamSource(param);
return AddError(src);
}
diag::Diagnostic& Validator::AddError(const Function* func) {
- auto src = Disassembly().FunctionSource(func);
+ auto src = Disassemble().FunctionSource(func);
return AddError(src);
}
diag::Diagnostic& Validator::AddError(const FunctionParam* param) {
- auto src = Disassembly().FunctionParamSource(param);
+ auto src = Disassemble().FunctionParamSource(param);
return AddError(src);
}
diag::Diagnostic& Validator::AddNote(const Instruction* inst) {
- auto src = Disassembly().InstructionSource(inst);
+ auto src = Disassemble().InstructionSource(inst);
return AddNote(src);
}
diag::Diagnostic& Validator::AddNote(const Function* func) {
- auto src = Disassembly().FunctionSource(func);
+ auto src = Disassemble().FunctionSource(func);
return AddNote(src);
}
diag::Diagnostic& Validator::AddOperandNote(const Instruction* inst, size_t idx) {
auto src =
- Disassembly().OperandSource(Disassembly::IndexedValue{inst, static_cast<uint32_t>(idx)});
+ Disassemble().OperandSource(Disassembler::IndexedValue{inst, static_cast<uint32_t>(idx)});
return AddNote(src);
}
diag::Diagnostic& Validator::AddResultNote(const Instruction* inst, size_t idx) {
auto src =
- Disassembly().ResultSource(Disassembly::IndexedValue{inst, static_cast<uint32_t>(idx)});
+ Disassemble().ResultSource(Disassembler::IndexedValue{inst, static_cast<uint32_t>(idx)});
return AddNote(src);
}
diag::Diagnostic& Validator::AddNote(const Block* blk) {
- auto src = Disassembly().BlockSource(blk);
+ auto src = Disassemble().BlockSource(blk);
return AddNote(src);
}
diag::Diagnostic& Validator::AddError(Source src) {
auto& diag = diagnostics_.AddError(src);
- diag.owned_file = Disassembly().File();
+ diag.owned_file = Disassemble().File();
return diag;
}
diag::Diagnostic& Validator::AddNote(Source src) {
auto& diag = diagnostics_.AddNote(src);
- diag.owned_file = Disassembly().File();
+ diag.owned_file = Disassemble().File();
return diag;
}
@@ -665,14 +665,14 @@
}
void Validator::AddDeclarationNote(const Block* block) {
- auto src = Disassembly().BlockSource(block);
+ auto src = Disassemble().BlockSource(block);
if (src.file) {
AddNote(src) << NameOf(block) << " declared here";
}
}
void Validator::AddDeclarationNote(const BlockParam* param) {
- auto src = Disassembly().BlockParamSource(param);
+ auto src = Disassemble().BlockParamSource(param);
if (src.file) {
AddNote(src) << NameOf(param) << " declared here";
}
@@ -683,14 +683,14 @@
}
void Validator::AddDeclarationNote(const FunctionParam* param) {
- auto src = Disassembly().FunctionParamSource(param);
+ auto src = Disassemble().FunctionParamSource(param);
if (src.file) {
AddNote(src) << NameOf(param) << " declared here";
}
}
void Validator::AddDeclarationNote(const Instruction* inst) {
- auto src = Disassembly().InstructionSource(inst);
+ auto src = Disassemble().InstructionSource(inst);
if (src.file) {
AddNote(src) << NameOf(inst) << " declared here";
}
@@ -718,7 +718,7 @@
}
StyledText Validator::NameOf(const Value* value) {
- return Disassembly().NameOf(value);
+ return Disassemble().NameOf(value);
}
StyledText Validator::NameOf(const Instruction* inst) {
@@ -727,7 +727,7 @@
StyledText Validator::NameOf(const Block* block) {
return StyledText{} << style::Instruction(block->Parent()->FriendlyName()) << " block "
- << Disassembly().NameOf(block);
+ << Disassemble().NameOf(block);
}
void Validator::CheckOperandNotNull(const Instruction* inst, const ir::Value* operand, size_t idx) {
@@ -1207,7 +1207,7 @@
if (overload->return_type != result->Type()) {
AddError(b) << "result value type " << style::Type(result->Type()->FriendlyName())
<< " does not match "
- << style::Instruction(Disassembly().NameOf(b->Op())) << " result type "
+ << style::Instruction(Disassemble().NameOf(b->Op())) << " result type "
<< style::Type(overload->return_type->FriendlyName());
}
}
@@ -1230,7 +1230,7 @@
if (overload->return_type != result->Type()) {
AddError(u) << "result value type " << style::Type(result->Type()->FriendlyName())
<< " does not match "
- << style::Instruction(Disassembly().NameOf(u->Op())) << " result type "
+ << style::Instruction(Disassemble().NameOf(u->Op())) << " result type "
<< style::Type(overload->return_type->FriendlyName());
}
}
diff --git a/src/tint/lang/spirv/reader/parser/helper_test.h b/src/tint/lang/spirv/reader/parser/helper_test.h
index 865aa4c..1dc7617 100644
--- a/src/tint/lang/spirv/reader/parser/helper_test.h
+++ b/src/tint/lang/spirv/reader/parser/helper_test.h
@@ -34,7 +34,7 @@
#include "gmock/gmock.h"
#include "gtest/gtest.h"
-#include "src/tint/lang/core/ir/disassembly.h"
+#include "src/tint/lang/core/ir/disassembler.h"
#include "src/tint/lang/core/ir/module.h"
#include "src/tint/lang/core/ir/validator.h"
#include "src/tint/lang/spirv/reader/common/helper_test.h"
@@ -82,7 +82,7 @@
}
// Return the disassembled IR module.
- return core::ir::Disassemble(parsed.Get()).Plain();
+ return core::ir::Disassembler(parsed.Get()).Plain();
}
};
diff --git a/src/tint/lang/spirv/reader/reader_test.cc b/src/tint/lang/spirv/reader/reader_test.cc
index 5242819..2b422df 100644
--- a/src/tint/lang/spirv/reader/reader_test.cc
+++ b/src/tint/lang/spirv/reader/reader_test.cc
@@ -31,7 +31,7 @@
#include "gmock/gmock.h"
#include "gtest/gtest.h"
-#include "src/tint/lang/core/ir/disassembly.h"
+#include "src/tint/lang/core/ir/disassembler.h"
#include "src/tint/lang/core/ir/module.h"
#include "src/tint/lang/core/ir/validator.h"
#include "src/tint/lang/spirv/reader/common/helper_test.h"
@@ -64,7 +64,7 @@
}
// Return the disassembled IR module.
- return "\n" + core::ir::Disassemble(ir.Get()).Plain();
+ return "\n" + core::ir::Disassembler(ir.Get()).Plain();
}
};
diff --git a/src/tint/lang/spirv/writer/common/helper_test.h b/src/tint/lang/spirv/writer/common/helper_test.h
index bedc457..56b52bb 100644
--- a/src/tint/lang/spirv/writer/common/helper_test.h
+++ b/src/tint/lang/spirv/writer/common/helper_test.h
@@ -36,7 +36,7 @@
#include "gtest/gtest.h"
#include "spirv-tools/libspirv.hpp"
#include "src/tint/lang/core/ir/builder.h"
-#include "src/tint/lang/core/ir/disassembly.h"
+#include "src/tint/lang/core/ir/disassembler.h"
#include "src/tint/lang/core/ir/validator.h"
#include "src/tint/lang/core/type/array.h"
#include "src/tint/lang/core/type/depth_texture.h"
@@ -245,7 +245,7 @@
/// Helper to dump the disassembly of the Tint IR module.
/// @returns the disassembly (with a leading newline)
- std::string IR() { return "\n" + core::ir::Disassemble(mod).Plain(); }
+ std::string IR() { return "\n" + core::ir::Disassembler(mod).Plain(); }
};
using SpirvWriterTest = SpirvWriterTestHelperBase<testing::Test>;
diff --git a/src/tint/lang/spirv/writer/writer_ir_fuzz.cc b/src/tint/lang/spirv/writer/writer_ir_fuzz.cc
index 483dd77..35191fd 100644
--- a/src/tint/lang/spirv/writer/writer_ir_fuzz.cc
+++ b/src/tint/lang/spirv/writer/writer_ir_fuzz.cc
@@ -28,7 +28,7 @@
#include "src/tint/lang/spirv/writer/writer.h"
#include "src/tint/cmd/fuzz/ir/fuzz.h"
-#include "src/tint/lang/core/ir/disassembly.h"
+#include "src/tint/lang/core/ir/disassembler.h"
#include "src/tint/lang/spirv/validate/validate.h"
#include "src/tint/lang/spirv/writer/helpers/generate_bindings.h"
@@ -47,7 +47,7 @@
TINT_ICE() << "output of SPIR-V writer failed to validate with SPIR-V Tools\n"
<< res.Failure() << "\n\n"
<< "IR:\n"
- << core::ir::Disassemble(module).Plain();
+ << core::ir::Disassembler(module).Plain();
}
}
diff --git a/src/tint/lang/wgsl/ir_roundtrip_fuzz.cc b/src/tint/lang/wgsl/ir_roundtrip_fuzz.cc
index 16efce4..6815ffd 100644
--- a/src/tint/lang/wgsl/ir_roundtrip_fuzz.cc
+++ b/src/tint/lang/wgsl/ir_roundtrip_fuzz.cc
@@ -30,7 +30,7 @@
#include <iostream>
#include "src/tint/cmd/fuzz/ir/fuzz.h"
-#include "src/tint/lang/core/ir/disassembly.h"
+#include "src/tint/lang/core/ir/disassembler.h"
#include "src/tint/lang/wgsl/reader/program_to_ir/program_to_ir.h"
#include "src/tint/lang/wgsl/writer/ir_to_program/ir_to_program.h"
#include "src/tint/lang/wgsl/writer/raise/raise.h"
@@ -47,7 +47,7 @@
program_options.allowed_features = AllowedFeatures::Everything();
auto dst = tint::wgsl::writer::IRToProgram(ir, program_options);
if (!dst.IsValid()) {
- std::cerr << "IR:\n" << core::ir::Disassemble(ir).Plain() << "\n";
+ std::cerr << "IR:\n" << core::ir::Disassembler(ir).Plain() << "\n";
if (auto result = tint::wgsl::writer::Generate(dst, {}); result == Success) {
std::cerr << "WGSL:\n" << result->wgsl << "\n\n";
}
diff --git a/src/tint/lang/wgsl/ir_roundtrip_test.cc b/src/tint/lang/wgsl/ir_roundtrip_test.cc
index 52e8abb..7687fa4 100644
--- a/src/tint/lang/wgsl/ir_roundtrip_test.cc
+++ b/src/tint/lang/wgsl/ir_roundtrip_test.cc
@@ -29,7 +29,7 @@
#include "gtest/gtest.h"
-#include "src/tint/lang/core/ir/disassembly.h"
+#include "src/tint/lang/core/ir/disassembler.h"
#include "src/tint/lang/wgsl/reader/program_to_ir/program_to_ir.h"
#include "src/tint/lang/wgsl/reader/reader.h"
#include "src/tint/lang/wgsl/writer/ir_to_program/ir_to_program.h"
@@ -73,14 +73,14 @@
return result;
}
- result.ir_pre_raise = core::ir::Disassemble(ir_module.Get()).Plain();
+ result.ir_pre_raise = core::ir::Disassembler(ir_module.Get()).Plain();
if (auto res = tint::wgsl::writer::Raise(ir_module.Get()); res != Success) {
result.err = res.Failure().reason.Str();
return result;
}
- result.ir_post_raise = core::ir::Disassemble(ir_module.Get()).Plain();
+ result.ir_post_raise = core::ir::Disassembler(ir_module.Get()).Plain();
writer::ProgramOptions program_options;
program_options.allowed_features = AllowedFeatures::Everything();
diff --git a/src/tint/lang/wgsl/reader/program_to_ir/accessor_test.cc b/src/tint/lang/wgsl/reader/program_to_ir/accessor_test.cc
index 2c94788..50854f9 100644
--- a/src/tint/lang/wgsl/reader/program_to_ir/accessor_test.cc
+++ b/src/tint/lang/wgsl/reader/program_to_ir/accessor_test.cc
@@ -25,13 +25,7 @@
// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-#include "gmock/gmock.h"
-#include "src/tint/lang/core/constant/scalar.h"
-#include "src/tint/lang/core/ir/block.h"
-#include "src/tint/lang/core/ir/constant.h"
-#include "src/tint/lang/core/ir/var.h"
-#include "src/tint/lang/wgsl/ast/case_selector.h"
-#include "src/tint/lang/wgsl/ast/int_literal_expression.h"
+#include "src/tint/lang/core/ir/disassembler.h"
#include "src/tint/lang/wgsl/reader/program_to_ir/ir_program_test.h"
namespace tint::wgsl::reader {
@@ -53,7 +47,7 @@
auto m = Build();
ASSERT_EQ(m, Success);
- EXPECT_EQ(Disassemble(m.Get()).Plain(),
+ EXPECT_EQ(core::ir::Disassembler(m.Get()).Plain(),
R"(%test_function = @compute @workgroup_size(1, 1, 1) func():void {
$B1: {
%a:ptr<function, array<u32, 3>, read_write> = var
@@ -79,7 +73,7 @@
auto m = Build();
ASSERT_EQ(m, Success);
- EXPECT_EQ(Disassemble(m.Get()).Plain(),
+ EXPECT_EQ(core::ir::Disassembler(m.Get()).Plain(),
R"(%test_function = @compute @workgroup_size(1, 1, 1) func():void {
$B1: {
%a:ptr<function, array<u32, 3>, read_write> = var
@@ -106,7 +100,7 @@
auto m = Build();
ASSERT_EQ(m, Success);
- EXPECT_EQ(Disassemble(m.Get()).Plain(),
+ EXPECT_EQ(core::ir::Disassembler(m.Get()).Plain(),
R"(%test_function = @compute @workgroup_size(1, 1, 1) func():void {
$B1: {
%a:ptr<function, array<u32, 3>, read_write> = var
@@ -134,7 +128,7 @@
auto m = Build();
ASSERT_EQ(m, Success);
- EXPECT_EQ(Disassemble(m.Get()).Plain(),
+ EXPECT_EQ(core::ir::Disassembler(m.Get()).Plain(),
R"(%test_function = @compute @workgroup_size(1, 1, 1) func():void {
$B1: {
%a:vec3<u32> = let vec3<u32>(0u)
@@ -159,7 +153,7 @@
auto m = Build();
ASSERT_EQ(m, Success);
- EXPECT_EQ(Disassemble(m.Get()).Plain(),
+ EXPECT_EQ(core::ir::Disassembler(m.Get()).Plain(),
R"(%test_function = @compute @workgroup_size(1, 1, 1) func():void {
$B1: {
%a:ptr<function, vec3<u32>, read_write> = var
@@ -184,7 +178,7 @@
auto m = Build();
ASSERT_EQ(m, Success);
- EXPECT_EQ(Disassemble(m.Get()).Plain(),
+ EXPECT_EQ(core::ir::Disassembler(m.Get()).Plain(),
R"(%test_function = @compute @workgroup_size(1, 1, 1) func():void {
$B1: {
%a:ptr<function, vec3<u32>, read_write> = var
@@ -210,7 +204,7 @@
auto m = Build();
ASSERT_EQ(m, Success);
- EXPECT_EQ(Disassemble(m.Get()).Plain(),
+ EXPECT_EQ(core::ir::Disassembler(m.Get()).Plain(),
R"(%test_function = @compute @workgroup_size(1, 1, 1) func():void {
$B1: {
%a:ptr<function, vec3<u32>, read_write> = var
@@ -234,7 +228,7 @@
auto m = Build();
ASSERT_EQ(m, Success);
- EXPECT_EQ(Disassemble(m.Get()).Plain(),
+ EXPECT_EQ(core::ir::Disassembler(m.Get()).Plain(),
R"(%test_function = @compute @workgroup_size(1, 1, 1) func():void {
$B1: {
%a:ptr<function, array<array<f32, 4>, 3>, read_write> = var
@@ -260,7 +254,7 @@
auto m = Build();
ASSERT_EQ(m, Success);
- EXPECT_EQ(Disassemble(m.Get()).Plain(),
+ EXPECT_EQ(core::ir::Disassembler(m.Get()).Plain(),
R"(%test_function = @compute @workgroup_size(1, 1, 1) func():void {
$B1: {
%a:ptr<function, array<array<f32, 4>, 3>, read_write> = var
@@ -287,7 +281,7 @@
auto m = Build();
ASSERT_EQ(m, Success);
- EXPECT_EQ(Disassemble(m.Get()).Plain(),
+ EXPECT_EQ(core::ir::Disassembler(m.Get()).Plain(),
R"(%test_function = @compute @workgroup_size(1, 1, 1) func():void {
$B1: {
%a:ptr<function, array<array<f32, 4>, 3>, read_write> = var
@@ -312,7 +306,7 @@
auto m = Build();
ASSERT_EQ(m, Success);
- EXPECT_EQ(Disassemble(m.Get()).Plain(),
+ EXPECT_EQ(core::ir::Disassembler(m.Get()).Plain(),
R"(%test_function = @compute @workgroup_size(1, 1, 1) func():void {
$B1: {
%a:ptr<function, mat3x4<f32>, read_write> = var
@@ -340,7 +334,7 @@
auto m = Build();
ASSERT_EQ(m, Success);
- EXPECT_EQ(Disassemble(m.Get()).Plain(),
+ EXPECT_EQ(core::ir::Disassembler(m.Get()).Plain(),
R"(MyStruct = struct @align(4) {
foo:i32 @offset(0)
}
@@ -374,7 +368,7 @@
auto m = Build();
ASSERT_EQ(m, Success);
- EXPECT_EQ(Disassemble(m.Get()).Plain(),
+ EXPECT_EQ(core::ir::Disassembler(m.Get()).Plain(),
R"(MyStruct = struct @align(4) {
foo:i32 @offset(0)
}
@@ -409,7 +403,7 @@
auto m = Build();
ASSERT_EQ(m, Success);
- EXPECT_EQ(Disassemble(m.Get()).Plain(),
+ EXPECT_EQ(core::ir::Disassembler(m.Get()).Plain(),
R"(MyStruct = struct @align(4) {
foo:i32 @offset(0)
}
@@ -447,7 +441,7 @@
auto m = Build();
ASSERT_EQ(m, Success);
- EXPECT_EQ(Disassemble(m.Get()).Plain(),
+ EXPECT_EQ(core::ir::Disassembler(m.Get()).Plain(),
R"(Inner = struct @align(4) {
bar:f32 @offset(0)
}
@@ -493,7 +487,7 @@
auto m = Build();
ASSERT_EQ(m, Success);
- EXPECT_EQ(Disassemble(m.Get()).Plain(),
+ EXPECT_EQ(core::ir::Disassembler(m.Get()).Plain(),
R"(Inner = struct @align(16) {
b:i32 @offset(0)
c:f32 @offset(4)
@@ -528,7 +522,7 @@
auto m = Build();
ASSERT_EQ(m, Success);
- EXPECT_EQ(Disassemble(m.Get()).Plain(),
+ EXPECT_EQ(core::ir::Disassembler(m.Get()).Plain(),
R"(%test_function = @compute @workgroup_size(1, 1, 1) func():void {
$B1: {
%a:ptr<function, array<u32, 4>, read_write> = var
@@ -551,7 +545,7 @@
auto m = Build();
ASSERT_EQ(m, Success);
- EXPECT_EQ(Disassemble(m.Get()).Plain(),
+ EXPECT_EQ(core::ir::Disassembler(m.Get()).Plain(),
R"(%test_function = @compute @workgroup_size(1, 1, 1) func():void {
$B1: {
%a:ptr<function, vec2<f32>, read_write> = var
@@ -576,7 +570,7 @@
auto m = Build();
ASSERT_EQ(m, Success);
- EXPECT_EQ(Disassemble(m.Get()).Plain(),
+ EXPECT_EQ(core::ir::Disassembler(m.Get()).Plain(),
R"(%test_function = @compute @workgroup_size(1, 1, 1) func():void {
$B1: {
%a:ptr<function, vec2<f32>, read_write> = var
@@ -602,7 +596,7 @@
auto m = Build();
ASSERT_EQ(m, Success);
- EXPECT_EQ(Disassemble(m.Get()).Plain(),
+ EXPECT_EQ(core::ir::Disassembler(m.Get()).Plain(),
R"(%test_function = @compute @workgroup_size(1, 1, 1) func():void {
$B1: {
%a:ptr<function, vec2<f32>, read_write> = var
@@ -626,7 +620,7 @@
auto m = Build();
ASSERT_EQ(m, Success);
- EXPECT_EQ(Disassemble(m.Get()).Plain(),
+ EXPECT_EQ(core::ir::Disassembler(m.Get()).Plain(),
R"(%test_function = @compute @workgroup_size(1, 1, 1) func():void {
$B1: {
%a:ptr<function, vec3<f32>, read_write> = var
@@ -650,7 +644,7 @@
auto m = Build();
ASSERT_EQ(m, Success);
- EXPECT_EQ(Disassemble(m.Get()).Plain(),
+ EXPECT_EQ(core::ir::Disassembler(m.Get()).Plain(),
R"(%test_function = @compute @workgroup_size(1, 1, 1) func():void {
$B1: {
%a:ptr<function, vec3<f32>, read_write> = var
@@ -682,7 +676,7 @@
auto m = Build();
ASSERT_EQ(m, Success);
- EXPECT_EQ(Disassemble(m.Get()).Plain(),
+ EXPECT_EQ(core::ir::Disassembler(m.Get()).Plain(),
R"(MyStruct = struct @align(16) {
a:i32 @offset(0)
foo:vec4<f32> @offset(16)
@@ -713,7 +707,7 @@
auto m = Build();
ASSERT_EQ(m, Success);
- EXPECT_EQ(Disassemble(m.Get()).Plain(),
+ EXPECT_EQ(core::ir::Disassembler(m.Get()).Plain(),
R"(%test_function = @compute @workgroup_size(1, 1, 1) func():void {
$B1: {
%a:vec3<u32> = let vec3<u32>(0u)
@@ -736,7 +730,7 @@
auto m = Build();
ASSERT_EQ(m, Success);
- EXPECT_EQ(Disassemble(m.Get()).Plain(),
+ EXPECT_EQ(core::ir::Disassembler(m.Get()).Plain(),
R"(%test_function = @compute @workgroup_size(1, 1, 1) func():void {
$B1: {
%a:mat3x4<f32> = let mat3x4<f32>(vec4<f32>(0.0f))
@@ -763,7 +757,7 @@
auto m = Build();
ASSERT_EQ(m, Success);
- EXPECT_EQ(Disassemble(m.Get()).Plain(),
+ EXPECT_EQ(core::ir::Disassembler(m.Get()).Plain(),
R"(MyStruct = struct @align(4) {
foo:i32 @offset(0)
}
@@ -799,7 +793,7 @@
auto m = Build();
ASSERT_EQ(m, Success);
- EXPECT_EQ(Disassemble(m.Get()).Plain(),
+ EXPECT_EQ(core::ir::Disassembler(m.Get()).Plain(),
R"(Inner = struct @align(4) {
bar:f32 @offset(0)
}
@@ -844,7 +838,7 @@
auto m = Build();
ASSERT_EQ(m, Success);
- EXPECT_EQ(Disassemble(m.Get()).Plain(),
+ EXPECT_EQ(core::ir::Disassembler(m.Get()).Plain(),
R"(Inner = struct @align(16) {
b:i32 @offset(0)
c:f32 @offset(4)
@@ -878,7 +872,7 @@
auto m = Build();
ASSERT_EQ(m, Success);
- EXPECT_EQ(Disassemble(m.Get()).Plain(),
+ EXPECT_EQ(core::ir::Disassembler(m.Get()).Plain(),
R"(%test_function = @compute @workgroup_size(1, 1, 1) func():void {
$B1: {
%a:vec2<f32> = let vec2<f32>(0.0f)
@@ -901,7 +895,7 @@
auto m = Build();
ASSERT_EQ(m, Success);
- EXPECT_EQ(Disassemble(m.Get()).Plain(),
+ EXPECT_EQ(core::ir::Disassembler(m.Get()).Plain(),
R"(%test_function = @compute @workgroup_size(1, 1, 1) func():void {
$B1: {
%a:vec3<f32> = let vec3<f32>(0.0f)
@@ -924,7 +918,7 @@
auto m = Build();
ASSERT_EQ(m, Success);
- EXPECT_EQ(Disassemble(m.Get()).Plain(),
+ EXPECT_EQ(core::ir::Disassembler(m.Get()).Plain(),
R"(%test_function = @compute @workgroup_size(1, 1, 1) func():void {
$B1: {
%a:vec3<f32> = let vec3<f32>(0.0f)
@@ -955,7 +949,7 @@
auto m = Build();
ASSERT_EQ(m, Success);
- EXPECT_EQ(Disassemble(m.Get()).Plain(),
+ EXPECT_EQ(core::ir::Disassembler(m.Get()).Plain(),
R"(MyStruct = struct @align(16) {
a:i32 @offset(0)
foo:vec4<f32> @offset(16)
@@ -988,7 +982,7 @@
auto m = Build();
ASSERT_EQ(m, Success);
- EXPECT_EQ(Disassemble(m.Get()).Plain(),
+ EXPECT_EQ(core::ir::Disassembler(m.Get()).Plain(),
R"(%test_function = @compute @workgroup_size(1, 1, 1) func():void {
$B1: {
%i:i32 = let 1i
@@ -1013,7 +1007,7 @@
auto m = Build();
ASSERT_EQ(m, Success);
- EXPECT_EQ(Disassemble(m.Get()).Plain(),
+ EXPECT_EQ(core::ir::Disassembler(m.Get()).Plain(),
R"(%test_function = @compute @workgroup_size(1, 1, 1) func():void {
$B1: {
%i:i32 = let 1i
@@ -1038,7 +1032,7 @@
auto m = Build();
ASSERT_EQ(m, Success);
- EXPECT_EQ(Disassemble(m.Get()).Plain(),
+ EXPECT_EQ(core::ir::Disassembler(m.Get()).Plain(),
R"(%test_function = @compute @workgroup_size(1, 1, 1) func():void {
$B1: {
%i:i32 = let 1i
diff --git a/src/tint/lang/wgsl/reader/program_to_ir/binary_test.cc b/src/tint/lang/wgsl/reader/program_to_ir/binary_test.cc
index 0e2595d..8eddde4 100644
--- a/src/tint/lang/wgsl/reader/program_to_ir/binary_test.cc
+++ b/src/tint/lang/wgsl/reader/program_to_ir/binary_test.cc
@@ -25,10 +25,7 @@
// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-#include "gmock/gmock.h"
-#include "src/tint/lang/core/constant/scalar.h"
-#include "src/tint/lang/wgsl/ast/case_selector.h"
-#include "src/tint/lang/wgsl/ast/int_literal_expression.h"
+#include "src/tint/lang/core/ir/disassembler.h"
#include "src/tint/lang/wgsl/reader/program_to_ir/ir_program_test.h"
namespace tint::wgsl::reader {
@@ -46,7 +43,7 @@
auto m = Build();
ASSERT_EQ(m, Success);
- EXPECT_EQ(Disassemble(m.Get()).Plain(), R"(%my_func = func():u32 {
+ EXPECT_EQ(core::ir::Disassembler(m.Get()).Plain(), R"(%my_func = func():u32 {
$B1: {
ret 0u
}
@@ -70,7 +67,7 @@
auto m = Build();
ASSERT_EQ(m, Success);
- EXPECT_EQ(Disassemble(m.Get()).Plain(), R"($B1: { # root
+ EXPECT_EQ(core::ir::Disassembler(m.Get()).Plain(), R"($B1: { # root
%v1:ptr<private, u32, read_write> = var
}
@@ -93,7 +90,7 @@
auto m = Build();
ASSERT_EQ(m, Success);
- EXPECT_EQ(Disassemble(m.Get()).Plain(), R"($B1: { # root
+ EXPECT_EQ(core::ir::Disassembler(m.Get()).Plain(), R"($B1: { # root
%v1:ptr<private, u32, read_write> = var
}
@@ -116,7 +113,7 @@
auto m = Build();
ASSERT_EQ(m, Success);
- EXPECT_EQ(Disassemble(m.Get()).Plain(), R"(%my_func = func():u32 {
+ EXPECT_EQ(core::ir::Disassembler(m.Get()).Plain(), R"(%my_func = func():u32 {
$B1: {
ret 0u
}
@@ -140,7 +137,7 @@
auto m = Build();
ASSERT_EQ(m, Success);
- EXPECT_EQ(Disassemble(m.Get()).Plain(), R"($B1: { # root
+ EXPECT_EQ(core::ir::Disassembler(m.Get()).Plain(), R"($B1: { # root
%v1:ptr<private, i32, read_write> = var
}
@@ -163,7 +160,7 @@
auto m = Build();
ASSERT_EQ(m, Success);
- EXPECT_EQ(Disassemble(m.Get()).Plain(), R"($B1: { # root
+ EXPECT_EQ(core::ir::Disassembler(m.Get()).Plain(), R"($B1: { # root
%v1:ptr<private, u32, read_write> = var
}
@@ -186,7 +183,7 @@
auto m = Build();
ASSERT_EQ(m, Success);
- EXPECT_EQ(Disassemble(m.Get()).Plain(), R"(%my_func = func():u32 {
+ EXPECT_EQ(core::ir::Disassembler(m.Get()).Plain(), R"(%my_func = func():u32 {
$B1: {
ret 0u
}
@@ -210,7 +207,7 @@
auto m = Build();
ASSERT_EQ(m, Success);
- EXPECT_EQ(Disassemble(m.Get()).Plain(), R"($B1: { # root
+ EXPECT_EQ(core::ir::Disassembler(m.Get()).Plain(), R"($B1: { # root
%v1:ptr<private, u32, read_write> = var
}
@@ -233,7 +230,7 @@
auto m = Build();
ASSERT_EQ(m, Success);
- EXPECT_EQ(Disassemble(m.Get()).Plain(), R"(%my_func = func():u32 {
+ EXPECT_EQ(core::ir::Disassembler(m.Get()).Plain(), R"(%my_func = func():u32 {
$B1: {
ret 0u
}
@@ -257,7 +254,7 @@
auto m = Build();
ASSERT_EQ(m, Success);
- EXPECT_EQ(Disassemble(m.Get()).Plain(), R"($B1: { # root
+ EXPECT_EQ(core::ir::Disassembler(m.Get()).Plain(), R"($B1: { # root
%v1:ptr<private, u32, read_write> = var
}
@@ -280,7 +277,7 @@
auto m = Build();
ASSERT_EQ(m, Success);
- EXPECT_EQ(Disassemble(m.Get()).Plain(), R"(%my_func = func():u32 {
+ EXPECT_EQ(core::ir::Disassembler(m.Get()).Plain(), R"(%my_func = func():u32 {
$B1: {
ret 0u
}
@@ -304,7 +301,7 @@
auto m = Build();
ASSERT_EQ(m, Success);
- EXPECT_EQ(Disassemble(m.Get()).Plain(), R"($B1: { # root
+ EXPECT_EQ(core::ir::Disassembler(m.Get()).Plain(), R"($B1: { # root
%v1:ptr<private, u32, read_write> = var
}
@@ -327,7 +324,7 @@
auto m = Build();
ASSERT_EQ(m, Success);
- EXPECT_EQ(Disassemble(m.Get()).Plain(), R"(%my_func = func():u32 {
+ EXPECT_EQ(core::ir::Disassembler(m.Get()).Plain(), R"(%my_func = func():u32 {
$B1: {
ret 0u
}
@@ -351,7 +348,7 @@
auto m = Build();
ASSERT_EQ(m, Success);
- EXPECT_EQ(Disassemble(m.Get()).Plain(), R"($B1: { # root
+ EXPECT_EQ(core::ir::Disassembler(m.Get()).Plain(), R"($B1: { # root
%v1:ptr<private, bool, read_write> = var
}
@@ -374,7 +371,7 @@
auto m = Build();
ASSERT_EQ(m, Success);
- EXPECT_EQ(Disassemble(m.Get()).Plain(), R"(%my_func = func():u32 {
+ EXPECT_EQ(core::ir::Disassembler(m.Get()).Plain(), R"(%my_func = func():u32 {
$B1: {
ret 0u
}
@@ -398,7 +395,7 @@
auto m = Build();
ASSERT_EQ(m, Success);
- EXPECT_EQ(Disassemble(m.Get()).Plain(), R"($B1: { # root
+ EXPECT_EQ(core::ir::Disassembler(m.Get()).Plain(), R"($B1: { # root
%v1:ptr<private, bool, read_write> = var
}
@@ -421,7 +418,7 @@
auto m = Build();
ASSERT_EQ(m, Success);
- EXPECT_EQ(Disassemble(m.Get()).Plain(), R"(%my_func = func():u32 {
+ EXPECT_EQ(core::ir::Disassembler(m.Get()).Plain(), R"(%my_func = func():u32 {
$B1: {
ret 0u
}
@@ -445,7 +442,7 @@
auto m = Build();
ASSERT_EQ(m, Success);
- EXPECT_EQ(Disassemble(m.Get()).Plain(), R"($B1: { # root
+ EXPECT_EQ(core::ir::Disassembler(m.Get()).Plain(), R"($B1: { # root
%v1:ptr<private, u32, read_write> = var
}
@@ -469,7 +466,7 @@
auto m = Build();
ASSERT_EQ(m, Success);
- EXPECT_EQ(Disassemble(m.Get()).Plain(), R"(%my_func = func():bool {
+ EXPECT_EQ(core::ir::Disassembler(m.Get()).Plain(), R"(%my_func = func():bool {
$B1: {
ret true
}
@@ -506,7 +503,7 @@
auto m = Build();
ASSERT_EQ(m, Success);
- EXPECT_EQ(Disassemble(m.Get()).Plain(), R"(%my_func = func():bool {
+ EXPECT_EQ(core::ir::Disassembler(m.Get()).Plain(), R"(%my_func = func():bool {
$B1: {
ret true
}
@@ -542,7 +539,7 @@
auto m = Build();
ASSERT_EQ(m, Success);
- EXPECT_EQ(Disassemble(m.Get()).Plain(), R"(%my_func = func():u32 {
+ EXPECT_EQ(core::ir::Disassembler(m.Get()).Plain(), R"(%my_func = func():u32 {
$B1: {
ret 0u
}
@@ -566,7 +563,7 @@
auto m = Build();
ASSERT_EQ(m, Success);
- EXPECT_EQ(Disassemble(m.Get()).Plain(), R"(%my_func = func():u32 {
+ EXPECT_EQ(core::ir::Disassembler(m.Get()).Plain(), R"(%my_func = func():u32 {
$B1: {
ret 0u
}
@@ -590,7 +587,7 @@
auto m = Build();
ASSERT_EQ(m, Success);
- EXPECT_EQ(Disassemble(m.Get()).Plain(), R"(%my_func = func():u32 {
+ EXPECT_EQ(core::ir::Disassembler(m.Get()).Plain(), R"(%my_func = func():u32 {
$B1: {
ret 0u
}
@@ -614,7 +611,7 @@
auto m = Build();
ASSERT_EQ(m, Success);
- EXPECT_EQ(Disassemble(m.Get()).Plain(), R"(%my_func = func():u32 {
+ EXPECT_EQ(core::ir::Disassembler(m.Get()).Plain(), R"(%my_func = func():u32 {
$B1: {
ret 0u
}
@@ -638,7 +635,7 @@
auto m = Build();
ASSERT_EQ(m, Success);
- EXPECT_EQ(Disassemble(m.Get()).Plain(), R"(%my_func = func():u32 {
+ EXPECT_EQ(core::ir::Disassembler(m.Get()).Plain(), R"(%my_func = func():u32 {
$B1: {
ret 0u
}
@@ -662,7 +659,7 @@
auto m = Build();
ASSERT_EQ(m, Success);
- EXPECT_EQ(Disassemble(m.Get()).Plain(), R"(%my_func = func():u32 {
+ EXPECT_EQ(core::ir::Disassembler(m.Get()).Plain(), R"(%my_func = func():u32 {
$B1: {
ret 0u
}
@@ -686,7 +683,7 @@
auto m = Build();
ASSERT_EQ(m, Success);
- EXPECT_EQ(Disassemble(m.Get()).Plain(), R"(%my_func = func():u32 {
+ EXPECT_EQ(core::ir::Disassembler(m.Get()).Plain(), R"(%my_func = func():u32 {
$B1: {
ret 0u
}
@@ -710,7 +707,7 @@
auto m = Build();
ASSERT_EQ(m, Success);
- EXPECT_EQ(Disassemble(m.Get()).Plain(), R"($B1: { # root
+ EXPECT_EQ(core::ir::Disassembler(m.Get()).Plain(), R"($B1: { # root
%v1:ptr<private, u32, read_write> = var
}
@@ -733,7 +730,7 @@
auto m = Build();
ASSERT_EQ(m, Success);
- EXPECT_EQ(Disassemble(m.Get()).Plain(), R"(%my_func = func():u32 {
+ EXPECT_EQ(core::ir::Disassembler(m.Get()).Plain(), R"(%my_func = func():u32 {
$B1: {
ret 0u
}
@@ -757,7 +754,7 @@
auto m = Build();
ASSERT_EQ(m, Success);
- EXPECT_EQ(Disassemble(m.Get()).Plain(), R"($B1: { # root
+ EXPECT_EQ(core::ir::Disassembler(m.Get()).Plain(), R"($B1: { # root
%v1:ptr<private, u32, read_write> = var
}
@@ -782,7 +779,7 @@
auto m = Build();
ASSERT_EQ(m, Success);
- EXPECT_EQ(Disassemble(m.Get()).Plain(), R"(%my_func = func():f32 {
+ EXPECT_EQ(core::ir::Disassembler(m.Get()).Plain(), R"(%my_func = func():f32 {
$B1: {
ret 0.0f
}
@@ -820,7 +817,7 @@
auto m = Build();
ASSERT_EQ(m, Success);
- EXPECT_EQ(Disassemble(m.Get()).Plain(), R"(%my_func = func(%p:bool):bool {
+ EXPECT_EQ(core::ir::Disassembler(m.Get()).Plain(), R"(%my_func = func(%p:bool):bool {
$B1: {
ret true
}
diff --git a/src/tint/lang/wgsl/reader/program_to_ir/builtin_test.cc b/src/tint/lang/wgsl/reader/program_to_ir/builtin_test.cc
index b51a00f..f567dc2 100644
--- a/src/tint/lang/wgsl/reader/program_to_ir/builtin_test.cc
+++ b/src/tint/lang/wgsl/reader/program_to_ir/builtin_test.cc
@@ -25,10 +25,7 @@
// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-#include "gmock/gmock.h"
-#include "src/tint/lang/core/constant/scalar.h"
-#include "src/tint/lang/wgsl/ast/case_selector.h"
-#include "src/tint/lang/wgsl/ast/int_literal_expression.h"
+#include "src/tint/lang/core/ir/disassembler.h"
#include "src/tint/lang/wgsl/reader/program_to_ir/ir_program_test.h"
namespace tint::wgsl::reader {
@@ -46,7 +43,7 @@
auto m = Build();
ASSERT_EQ(m, Success);
- EXPECT_EQ(Disassemble(m.Get()).Plain(), R"($B1: { # root
+ EXPECT_EQ(core::ir::Disassembler(m.Get()).Plain(), R"($B1: { # root
%i:ptr<private, f32, read_write> = var, 1.0f
}
diff --git a/src/tint/lang/wgsl/reader/program_to_ir/call_test.cc b/src/tint/lang/wgsl/reader/program_to_ir/call_test.cc
index 5959752..d2683f8 100644
--- a/src/tint/lang/wgsl/reader/program_to_ir/call_test.cc
+++ b/src/tint/lang/wgsl/reader/program_to_ir/call_test.cc
@@ -25,10 +25,7 @@
// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-#include "gmock/gmock.h"
-#include "src/tint/lang/core/constant/scalar.h"
-#include "src/tint/lang/wgsl/ast/case_selector.h"
-#include "src/tint/lang/wgsl/ast/int_literal_expression.h"
+#include "src/tint/lang/core/ir/disassembler.h"
#include "src/tint/lang/wgsl/reader/program_to_ir/ir_program_test.h"
namespace tint::wgsl::reader {
@@ -48,7 +45,7 @@
auto m = Build();
ASSERT_EQ(m, Success);
- EXPECT_EQ(Disassemble(m.Get()).Plain(), R"(%my_func = func():f32 {
+ EXPECT_EQ(core::ir::Disassembler(m.Get()).Plain(), R"(%my_func = func():f32 {
$B1: {
ret 0.0f
}
@@ -74,7 +71,7 @@
auto m = Build();
ASSERT_EQ(m, Success);
- EXPECT_EQ(Disassemble(m.Get()).Plain(), R"(%test_function = @fragment func():void {
+ EXPECT_EQ(core::ir::Disassembler(m.Get()).Plain(), R"(%test_function = @fragment func():void {
$B1: {
discard
ret
@@ -91,7 +88,7 @@
auto m = Build();
ASSERT_EQ(m, Success);
- EXPECT_EQ(Disassemble(m.Get()).Plain(), R"(%my_func = func(%p:f32):void {
+ EXPECT_EQ(core::ir::Disassembler(m.Get()).Plain(), R"(%my_func = func(%p:f32):void {
$B1: {
ret
}
@@ -113,7 +110,7 @@
auto m = Build();
ASSERT_EQ(m, Success);
- EXPECT_EQ(Disassemble(m.Get()).Plain(), R"($B1: { # root
+ EXPECT_EQ(core::ir::Disassembler(m.Get()).Plain(), R"($B1: { # root
%i:ptr<private, i32, read_write> = var, 1i
}
@@ -135,7 +132,7 @@
auto m = Build();
ASSERT_EQ(m, Success);
- EXPECT_EQ(Disassemble(m.Get()).Plain(), R"($B1: { # root
+ EXPECT_EQ(core::ir::Disassembler(m.Get()).Plain(), R"($B1: { # root
%i:ptr<private, vec3<f32>, read_write> = var, vec3<f32>(0.0f)
}
@@ -150,7 +147,7 @@
auto m = Build();
ASSERT_EQ(m, Success);
- EXPECT_EQ(Disassemble(m.Get()).Plain(), R"($B1: { # root
+ EXPECT_EQ(core::ir::Disassembler(m.Get()).Plain(), R"($B1: { # root
%i:ptr<private, f32, read_write> = var, 1.0f
}
diff --git a/src/tint/lang/wgsl/reader/program_to_ir/function_test.cc b/src/tint/lang/wgsl/reader/program_to_ir/function_test.cc
index b9d4bbd..3264da8 100644
--- a/src/tint/lang/wgsl/reader/program_to_ir/function_test.cc
+++ b/src/tint/lang/wgsl/reader/program_to_ir/function_test.cc
@@ -25,10 +25,7 @@
// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-#include "gmock/gmock.h"
-#include "src/tint/lang/core/constant/scalar.h"
-#include "src/tint/lang/wgsl/ast/case_selector.h"
-#include "src/tint/lang/wgsl/ast/int_literal_expression.h"
+#include "src/tint/lang/core/ir/disassembler.h"
#include "src/tint/lang/wgsl/reader/program_to_ir/ir_program_test.h"
namespace tint::wgsl::reader {
@@ -47,7 +44,8 @@
auto m = Build();
ASSERT_EQ(m, Success);
- EXPECT_EQ(Disassemble(m.Get()).Plain(), R"(%test = @vertex func():vec4<f32> [@position] {
+ EXPECT_EQ(core::ir::Disassembler(m.Get()).Plain(),
+ R"(%test = @vertex func():vec4<f32> [@position] {
$B1: {
ret vec4<f32>(0.0f)
}
@@ -62,7 +60,7 @@
auto m = Build();
ASSERT_EQ(m, Success);
- EXPECT_EQ(Disassemble(m.Get()).Plain(), R"(%test = @fragment func():void {
+ EXPECT_EQ(core::ir::Disassembler(m.Get()).Plain(), R"(%test = @fragment func():void {
$B1: {
ret
}
@@ -77,7 +75,7 @@
auto m = Build();
ASSERT_EQ(m, Success);
- EXPECT_EQ(Disassemble(m.Get()).Plain(),
+ EXPECT_EQ(core::ir::Disassembler(m.Get()).Plain(),
R"(%test = @compute @workgroup_size(8, 4, 2) func():void {
$B1: {
ret
@@ -93,7 +91,7 @@
auto m = Build();
ASSERT_EQ(m, Success);
- EXPECT_EQ(Disassemble(m.Get()).Plain(), R"(%test = func():vec3<f32> {
+ EXPECT_EQ(core::ir::Disassembler(m.Get()).Plain(), R"(%test = func():vec3<f32> {
$B1: {
ret vec3<f32>(0.0f)
}
@@ -108,7 +106,7 @@
auto m = Build();
ASSERT_EQ(m, Success);
- EXPECT_EQ(Disassemble(m.Get()).Plain(), R"(%test = func():f32 {
+ EXPECT_EQ(core::ir::Disassembler(m.Get()).Plain(), R"(%test = func():f32 {
$B1: {
if true [t: $B2, f: $B3] { # if_1
$B2: { # true
@@ -132,7 +130,8 @@
auto m = Build();
ASSERT_EQ(m, Success);
- EXPECT_EQ(Disassemble(m.Get()).Plain(), R"(%test = @vertex func():vec4<f32> [@position] {
+ EXPECT_EQ(core::ir::Disassembler(m.Get()).Plain(),
+ R"(%test = @vertex func():vec4<f32> [@position] {
$B1: {
ret vec4<f32>(1.0f, 2.0f, 3.0f, 4.0f)
}
@@ -148,7 +147,7 @@
auto m = Build();
ASSERT_EQ(m, Success);
- EXPECT_EQ(Disassemble(m.Get()).Plain(),
+ EXPECT_EQ(core::ir::Disassembler(m.Get()).Plain(),
R"(%test = @vertex func():vec4<f32> [@invariant, @position] {
$B1: {
ret vec4<f32>(1.0f, 2.0f, 3.0f, 4.0f)
@@ -164,7 +163,7 @@
auto m = Build();
ASSERT_EQ(m, Success);
- EXPECT_EQ(Disassemble(m.Get()).Plain(),
+ EXPECT_EQ(core::ir::Disassembler(m.Get()).Plain(),
R"(%test = @fragment func():vec4<f32> [@location(1)] {
$B1: {
ret vec4<f32>(1.0f, 2.0f, 3.0f, 4.0f)
@@ -182,7 +181,7 @@
auto m = Build();
ASSERT_EQ(m, Success);
- EXPECT_EQ(Disassemble(m.Get()).Plain(),
+ EXPECT_EQ(core::ir::Disassembler(m.Get()).Plain(),
R"(%test = @fragment func():vec4<f32> [@location(1), @interpolate(linear, centroid)] {
$B1: {
ret vec4<f32>(1.0f, 2.0f, 3.0f, 4.0f)
@@ -199,7 +198,8 @@
auto m = Build();
ASSERT_EQ(m, Success);
- EXPECT_EQ(Disassemble(m.Get()).Plain(), R"(%test = @fragment func():f32 [@frag_depth] {
+ EXPECT_EQ(core::ir::Disassembler(m.Get()).Plain(),
+ R"(%test = @fragment func():f32 [@frag_depth] {
$B1: {
ret 1.0f
}
@@ -215,7 +215,8 @@
auto m = Build();
ASSERT_EQ(m, Success);
- EXPECT_EQ(Disassemble(m.Get()).Plain(), R"(%test = @fragment func():u32 [@sample_mask] {
+ EXPECT_EQ(core::ir::Disassembler(m.Get()).Plain(),
+ R"(%test = @fragment func():u32 [@sample_mask] {
$B1: {
ret 1u
}
diff --git a/src/tint/lang/wgsl/reader/program_to_ir/ir_program_test.h b/src/tint/lang/wgsl/reader/program_to_ir/ir_program_test.h
index c6f78cc..7bdf81a 100644
--- a/src/tint/lang/wgsl/reader/program_to_ir/ir_program_test.h
+++ b/src/tint/lang/wgsl/reader/program_to_ir/ir_program_test.h
@@ -28,20 +28,16 @@
#ifndef SRC_TINT_LANG_WGSL_READER_PROGRAM_TO_IR_IR_PROGRAM_TEST_H_
#define SRC_TINT_LANG_WGSL_READER_PROGRAM_TO_IR_IR_PROGRAM_TEST_H_
-#include <memory>
#include <string>
#include <utility>
#include "gtest/gtest.h"
-#include "src/tint/lang/core/ir/disassembly.h"
#include "src/tint/lang/core/ir/validator.h"
-#include "src/tint/lang/core/number.h"
#include "src/tint/lang/wgsl/program/program_builder.h"
#include "src/tint/lang/wgsl/reader/lower/lower.h"
#include "src/tint/lang/wgsl/reader/program_to_ir/program_to_ir.h"
#include "src/tint/lang/wgsl/reader/reader.h"
#include "src/tint/lang/wgsl/resolver/resolve.h"
-#include "src/tint/utils/text/string_stream.h"
namespace tint::wgsl::helpers {
diff --git a/src/tint/lang/wgsl/reader/program_to_ir/let_test.cc b/src/tint/lang/wgsl/reader/program_to_ir/let_test.cc
index d296d16..a54384e 100644
--- a/src/tint/lang/wgsl/reader/program_to_ir/let_test.cc
+++ b/src/tint/lang/wgsl/reader/program_to_ir/let_test.cc
@@ -25,10 +25,7 @@
// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-#include "gmock/gmock.h"
-#include "src/tint/lang/core/constant/scalar.h"
-#include "src/tint/lang/wgsl/ast/case_selector.h"
-#include "src/tint/lang/wgsl/ast/int_literal_expression.h"
+#include "src/tint/lang/core/ir/disassembler.h"
#include "src/tint/lang/wgsl/reader/program_to_ir/ir_program_test.h"
namespace tint::wgsl::reader {
@@ -44,7 +41,7 @@
auto m = Build();
ASSERT_EQ(m, Success);
- EXPECT_EQ(Disassemble(m.Get()).Plain(),
+ EXPECT_EQ(core::ir::Disassembler(m.Get()).Plain(),
R"(%test_function = @compute @workgroup_size(1, 1, 1) func():void {
$B1: {
%a:i32 = let 42i
@@ -60,7 +57,7 @@
auto m = Build();
ASSERT_EQ(m, Success);
- EXPECT_EQ(Disassemble(m.Get()).Plain(),
+ EXPECT_EQ(core::ir::Disassembler(m.Get()).Plain(),
R"(%test_function = @compute @workgroup_size(1, 1, 1) func():void {
$B1: {
%a:i32 = let 3i
@@ -78,7 +75,7 @@
auto m = Build();
ASSERT_EQ(m, Success);
- EXPECT_EQ(Disassemble(m.Get()).Plain(),
+ EXPECT_EQ(core::ir::Disassembler(m.Get()).Plain(),
R"(%test_function = @compute @workgroup_size(1, 1, 1) func():void {
$B1: {
%a:i32 = let 1i
diff --git a/src/tint/lang/wgsl/reader/program_to_ir/literal_test.cc b/src/tint/lang/wgsl/reader/program_to_ir/literal_test.cc
index f6c6169..4000227 100644
--- a/src/tint/lang/wgsl/reader/program_to_ir/literal_test.cc
+++ b/src/tint/lang/wgsl/reader/program_to_ir/literal_test.cc
@@ -25,14 +25,11 @@
// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-#include "gmock/gmock.h"
#include "src/tint/lang/core/constant/scalar.h"
#include "src/tint/lang/core/fluent_types.h"
#include "src/tint/lang/core/ir/block.h"
#include "src/tint/lang/core/ir/constant.h"
#include "src/tint/lang/core/ir/var.h"
-#include "src/tint/lang/wgsl/ast/case_selector.h"
-#include "src/tint/lang/wgsl/ast/int_literal_expression.h"
#include "src/tint/lang/wgsl/reader/program_to_ir/ir_program_test.h"
using namespace tint::core::fluent_types; // NOLINT
diff --git a/src/tint/lang/wgsl/reader/program_to_ir/materialize_test.cc b/src/tint/lang/wgsl/reader/program_to_ir/materialize_test.cc
index 7f3ae1c..6dbb68d 100644
--- a/src/tint/lang/wgsl/reader/program_to_ir/materialize_test.cc
+++ b/src/tint/lang/wgsl/reader/program_to_ir/materialize_test.cc
@@ -25,10 +25,7 @@
// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-#include "gmock/gmock.h"
-#include "src/tint/lang/core/constant/scalar.h"
-#include "src/tint/lang/wgsl/ast/case_selector.h"
-#include "src/tint/lang/wgsl/ast/int_literal_expression.h"
+#include "src/tint/lang/core/ir/disassembler.h"
#include "src/tint/lang/wgsl/reader/program_to_ir/ir_program_test.h"
namespace tint::wgsl::reader {
@@ -46,7 +43,7 @@
auto m = Build();
ASSERT_EQ(m, Success);
- EXPECT_EQ(Disassemble(m.Get()).Plain(), R"(%test_function = func():f32 {
+ EXPECT_EQ(core::ir::Disassembler(m.Get()).Plain(), R"(%test_function = func():f32 {
$B1: {
ret 2.0f
}
diff --git a/src/tint/lang/wgsl/reader/program_to_ir/program_to_ir.cc b/src/tint/lang/wgsl/reader/program_to_ir/program_to_ir.cc
index 83139a4..7b13b29 100644
--- a/src/tint/lang/wgsl/reader/program_to_ir/program_to_ir.cc
+++ b/src/tint/lang/wgsl/reader/program_to_ir/program_to_ir.cc
@@ -27,14 +27,10 @@
#include "src/tint/lang/wgsl/reader/program_to_ir/program_to_ir.h"
-#include <iostream>
-#include <unordered_map>
#include <utility>
#include <variant>
-#include <vector>
#include "src/tint/lang/core/fluent_types.h"
-#include "src/tint/lang/core/ir/block_param.h"
#include "src/tint/lang/core/ir/builder.h"
#include "src/tint/lang/core/ir/exit_if.h"
#include "src/tint/lang/core/ir/exit_loop.h"
@@ -43,19 +39,16 @@
#include "src/tint/lang/core/ir/if.h"
#include "src/tint/lang/core/ir/loop.h"
#include "src/tint/lang/core/ir/module.h"
-#include "src/tint/lang/core/ir/store.h"
#include "src/tint/lang/core/ir/switch.h"
#include "src/tint/lang/core/ir/value.h"
#include "src/tint/lang/core/type/pointer.h"
#include "src/tint/lang/core/type/reference.h"
#include "src/tint/lang/core/type/struct.h"
-#include "src/tint/lang/core/type/void.h"
#include "src/tint/lang/wgsl/ast/accessor_expression.h"
#include "src/tint/lang/wgsl/ast/alias.h"
#include "src/tint/lang/wgsl/ast/assignment_statement.h"
#include "src/tint/lang/wgsl/ast/binary_expression.h"
#include "src/tint/lang/wgsl/ast/block_statement.h"
-#include "src/tint/lang/wgsl/ast/bool_literal_expression.h"
#include "src/tint/lang/wgsl/ast/break_if_statement.h"
#include "src/tint/lang/wgsl/ast/break_statement.h"
#include "src/tint/lang/wgsl/ast/call_expression.h"
@@ -67,16 +60,13 @@
#include "src/tint/lang/wgsl/ast/diagnostic_directive.h"
#include "src/tint/lang/wgsl/ast/discard_statement.h"
#include "src/tint/lang/wgsl/ast/enable.h"
-#include "src/tint/lang/wgsl/ast/float_literal_expression.h"
#include "src/tint/lang/wgsl/ast/for_loop_statement.h"
#include "src/tint/lang/wgsl/ast/function.h"
-#include "src/tint/lang/wgsl/ast/id_attribute.h"
#include "src/tint/lang/wgsl/ast/identifier.h"
#include "src/tint/lang/wgsl/ast/identifier_expression.h"
#include "src/tint/lang/wgsl/ast/if_statement.h"
#include "src/tint/lang/wgsl/ast/increment_decrement_statement.h"
#include "src/tint/lang/wgsl/ast/index_accessor_expression.h"
-#include "src/tint/lang/wgsl/ast/int_literal_expression.h"
#include "src/tint/lang/wgsl/ast/interpolate_attribute.h"
#include "src/tint/lang/wgsl/ast/invariant_attribute.h"
#include "src/tint/lang/wgsl/ast/let.h"
@@ -89,8 +79,6 @@
#include "src/tint/lang/wgsl/ast/return_statement.h"
#include "src/tint/lang/wgsl/ast/statement.h"
#include "src/tint/lang/wgsl/ast/struct.h"
-#include "src/tint/lang/wgsl/ast/struct_member_align_attribute.h"
-#include "src/tint/lang/wgsl/ast/struct_member_size_attribute.h"
#include "src/tint/lang/wgsl/ast/switch_statement.h"
#include "src/tint/lang/wgsl/ast/templated_identifier.h"
#include "src/tint/lang/wgsl/ast/unary_op_expression.h"
@@ -104,7 +92,6 @@
#include "src/tint/lang/wgsl/sem/function.h"
#include "src/tint/lang/wgsl/sem/index_accessor_expression.h"
#include "src/tint/lang/wgsl/sem/load.h"
-#include "src/tint/lang/wgsl/sem/materialize.h"
#include "src/tint/lang/wgsl/sem/member_accessor_expression.h"
#include "src/tint/lang/wgsl/sem/module.h"
#include "src/tint/lang/wgsl/sem/switch_statement.h"
diff --git a/src/tint/lang/wgsl/reader/program_to_ir/program_to_ir.h b/src/tint/lang/wgsl/reader/program_to_ir/program_to_ir.h
index 148cde0..822467d 100644
--- a/src/tint/lang/wgsl/reader/program_to_ir/program_to_ir.h
+++ b/src/tint/lang/wgsl/reader/program_to_ir/program_to_ir.h
@@ -28,10 +28,7 @@
#ifndef SRC_TINT_LANG_WGSL_READER_PROGRAM_TO_IR_PROGRAM_TO_IR_H_
#define SRC_TINT_LANG_WGSL_READER_PROGRAM_TO_IR_PROGRAM_TO_IR_H_
-#include <string>
-
#include "src/tint/lang/core/ir/module.h"
-#include "src/tint/utils/diagnostic/diagnostic.h"
#include "src/tint/utils/result/result.h"
// Forward Declarations
diff --git a/src/tint/lang/wgsl/reader/program_to_ir/program_to_ir_test.cc b/src/tint/lang/wgsl/reader/program_to_ir/program_to_ir_test.cc
index dc57142..c7f53f8 100644
--- a/src/tint/lang/wgsl/reader/program_to_ir/program_to_ir_test.cc
+++ b/src/tint/lang/wgsl/reader/program_to_ir/program_to_ir_test.cc
@@ -25,17 +25,14 @@
// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-#include "gmock/gmock.h"
#include "src/tint/lang/core/builtin_fn.h"
#include "src/tint/lang/core/constant/scalar.h"
#include "src/tint/lang/core/fluent_types.h"
-#include "src/tint/lang/core/ir/block.h"
+#include "src/tint/lang/core/ir/disassembler.h"
#include "src/tint/lang/core/ir/if.h"
#include "src/tint/lang/core/ir/loop.h"
#include "src/tint/lang/core/ir/multi_in_block.h"
#include "src/tint/lang/core/ir/switch.h"
-#include "src/tint/lang/wgsl/ast/case_selector.h"
-#include "src/tint/lang/wgsl/ast/int_literal_expression.h"
#include "src/tint/lang/wgsl/reader/program_to_ir/ir_program_test.h"
using namespace tint::core::fluent_types; // NOLINT
@@ -83,7 +80,7 @@
EXPECT_EQ(m->functions[0]->Stage(), core::ir::Function::PipelineStage::kUndefined);
- EXPECT_EQ(Disassemble(m.Get()).Plain(), R"(%f = func():void {
+ EXPECT_EQ(core::ir::Disassembler(m.Get()).Plain(), R"(%f = func():void {
$B1: {
ret
}
@@ -104,7 +101,7 @@
EXPECT_EQ(m->functions[0]->Stage(), core::ir::Function::PipelineStage::kUndefined);
- EXPECT_EQ(Disassemble(m.Get()).Plain(), R"(%f = func(%a:u32):u32 {
+ EXPECT_EQ(core::ir::Disassembler(m.Get()).Plain(), R"(%f = func(%a:u32):u32 {
$B1: {
ret %a
}
@@ -126,7 +123,7 @@
EXPECT_EQ(m->functions[0]->Stage(), core::ir::Function::PipelineStage::kUndefined);
- EXPECT_EQ(Disassemble(m.Get()).Plain(), R"(%f = func(%a:u32, %b:i32, %c:bool):void {
+ EXPECT_EQ(core::ir::Disassembler(m.Get()).Plain(), R"(%f = func(%a:u32, %b:i32, %c:bool):void {
$B1: {
ret
}
@@ -154,7 +151,7 @@
ASSERT_EQ(1u, m.functions.Length());
- EXPECT_EQ(Disassemble(m).Plain(),
+ EXPECT_EQ(core::ir::Disassembler(m).Plain(),
R"(%test_function = @compute @workgroup_size(1, 1, 1) func():void {
$B1: {
if true [t: $B2, f: $B3] { # if_1
@@ -182,7 +179,7 @@
ASSERT_EQ(1u, m.functions.Length());
- EXPECT_EQ(Disassemble(m).Plain(),
+ EXPECT_EQ(core::ir::Disassembler(m).Plain(),
R"(%test_function = @compute @workgroup_size(1, 1, 1) func():void {
$B1: {
if true [t: $B2] { # if_1
@@ -207,7 +204,7 @@
ASSERT_EQ(1u, m.functions.Length());
- EXPECT_EQ(Disassemble(m).Plain(),
+ EXPECT_EQ(core::ir::Disassembler(m).Plain(),
R"(%test_function = @compute @workgroup_size(1, 1, 1) func():void {
$B1: {
if true [t: $B2, f: $B3] { # if_1
@@ -235,7 +232,7 @@
ASSERT_EQ(1u, m.functions.Length());
- EXPECT_EQ(Disassemble(m).Plain(),
+ EXPECT_EQ(core::ir::Disassembler(m).Plain(),
R"(%test_function = @compute @workgroup_size(1, 1, 1) func():void {
$B1: {
if true [t: $B2, f: $B3] { # if_1
@@ -262,7 +259,7 @@
auto m = res.Move();
- EXPECT_EQ(Disassemble(m).Plain(),
+ EXPECT_EQ(core::ir::Disassembler(m).Plain(),
R"(%test_function = @compute @workgroup_size(1, 1, 1) func():void {
$B1: {
if true [t: $B2] { # if_1
@@ -296,7 +293,7 @@
EXPECT_EQ(0u, loop->Body()->InboundSiblingBranches().Length());
EXPECT_EQ(0u, loop->Continuing()->InboundSiblingBranches().Length());
- EXPECT_EQ(Disassemble(m).Plain(),
+ EXPECT_EQ(core::ir::Disassembler(m).Plain(),
R"(%test_function = @compute @workgroup_size(1, 1, 1) func():void {
$B1: {
loop [b: $B2] { # loop_1
@@ -326,7 +323,7 @@
EXPECT_EQ(1u, loop->Body()->InboundSiblingBranches().Length());
EXPECT_EQ(1u, loop->Continuing()->InboundSiblingBranches().Length());
- EXPECT_EQ(Disassemble(m).Plain(),
+ EXPECT_EQ(core::ir::Disassembler(m).Plain(),
R"(%test_function = @compute @workgroup_size(1, 1, 1) func():void {
$B1: {
loop [b: $B2, c: $B3] { # loop_1
@@ -364,7 +361,7 @@
EXPECT_EQ(1u, loop->Body()->InboundSiblingBranches().Length());
EXPECT_EQ(1u, loop->Continuing()->InboundSiblingBranches().Length());
- EXPECT_EQ(Disassemble(m).Plain(),
+ EXPECT_EQ(core::ir::Disassembler(m).Plain(),
R"(%test_function = @compute @workgroup_size(1, 1, 1) func():void {
$B1: {
loop [b: $B2, c: $B3] { # loop_1
@@ -391,7 +388,7 @@
ASSERT_EQ(res, Success);
auto m = res.Move();
- EXPECT_EQ(Disassemble(m).Plain(),
+ EXPECT_EQ(core::ir::Disassembler(m).Plain(),
R"(%test_function = @compute @workgroup_size(1, 1, 1) func():void {
$B1: {
loop [b: $B2, c: $B3] { # loop_1
@@ -425,7 +422,7 @@
EXPECT_EQ(1u, loop->Body()->InboundSiblingBranches().Length());
EXPECT_EQ(1u, loop->Continuing()->InboundSiblingBranches().Length());
- EXPECT_EQ(Disassemble(m).Plain(),
+ EXPECT_EQ(core::ir::Disassembler(m).Plain(),
R"(%test_function = @compute @workgroup_size(1, 1, 1) func():void {
$B1: {
loop [b: $B2, c: $B3] { # loop_1
@@ -462,7 +459,7 @@
EXPECT_EQ(0u, loop->Body()->InboundSiblingBranches().Length());
EXPECT_EQ(0u, loop->Continuing()->InboundSiblingBranches().Length());
- EXPECT_EQ(Disassemble(m).Plain(),
+ EXPECT_EQ(core::ir::Disassembler(m).Plain(),
R"(%test_function = @compute @workgroup_size(1, 1, 1) func():void {
$B1: {
loop [b: $B2] { # loop_1
@@ -500,7 +497,7 @@
EXPECT_EQ(0u, loop->Body()->InboundSiblingBranches().Length());
EXPECT_EQ(0u, loop->Continuing()->InboundSiblingBranches().Length());
- EXPECT_EQ(Disassemble(m).Plain(),
+ EXPECT_EQ(core::ir::Disassembler(m).Plain(),
R"(%test_function = @compute @workgroup_size(1, 1, 1) func():void {
$B1: {
loop [b: $B2] { # loop_1
@@ -535,7 +532,7 @@
EXPECT_EQ(0u, loop->Body()->InboundSiblingBranches().Length());
EXPECT_EQ(0u, loop->Continuing()->InboundSiblingBranches().Length());
- EXPECT_EQ(Disassemble(m).Plain(),
+ EXPECT_EQ(core::ir::Disassembler(m).Plain(),
R"(%test_function = @compute @workgroup_size(1, 1, 1) func():void {
$B1: {
loop [b: $B2] { # loop_1
@@ -574,7 +571,7 @@
auto m = Build();
ASSERT_EQ(m, Success);
- EXPECT_EQ(Disassemble(m.Get()).Plain(),
+ EXPECT_EQ(core::ir::Disassembler(m.Get()).Plain(),
R"(%test_function = @compute @workgroup_size(1, 1, 1) func():void {
$B1: {
loop [b: $B2, c: $B3] { # loop_1
@@ -642,7 +639,7 @@
EXPECT_EQ(1u, loop->Body()->InboundSiblingBranches().Length());
EXPECT_EQ(1u, loop->Continuing()->InboundSiblingBranches().Length());
- EXPECT_EQ(Disassemble(m).Plain(),
+ EXPECT_EQ(core::ir::Disassembler(m).Plain(),
R"(%test_function = @compute @workgroup_size(1, 1, 1) func():void {
$B1: {
loop [b: $B2, c: $B3] { # loop_1
@@ -682,7 +679,7 @@
EXPECT_EQ(1u, loop->Body()->InboundSiblingBranches().Length());
EXPECT_EQ(0u, loop->Continuing()->InboundSiblingBranches().Length());
- EXPECT_EQ(Disassemble(m).Plain(),
+ EXPECT_EQ(core::ir::Disassembler(m).Plain(),
R"(%test_function = @compute @workgroup_size(1, 1, 1) func():void {
$B1: {
loop [b: $B2, c: $B3] { # loop_1
@@ -722,7 +719,7 @@
EXPECT_EQ(2u, loop->Body()->InboundSiblingBranches().Length());
EXPECT_EQ(1u, loop->Continuing()->InboundSiblingBranches().Length());
- EXPECT_EQ(Disassemble(m).Plain(),
+ EXPECT_EQ(core::ir::Disassembler(m).Plain(),
R"(%test_function = @compute @workgroup_size(1, 1, 1) func():void {
$B1: {
loop [i: $B2, b: $B3, c: $B4] { # loop_1
@@ -771,7 +768,7 @@
EXPECT_EQ(1u, loop->Body()->InboundSiblingBranches().Length());
EXPECT_EQ(0u, loop->Continuing()->InboundSiblingBranches().Length());
- EXPECT_EQ(Disassemble(m).Plain(),
+ EXPECT_EQ(core::ir::Disassembler(m).Plain(),
R"(%test_function = @compute @workgroup_size(1, 1, 1) func():void {
$B1: {
loop [i: $B2, b: $B3] { # loop_1
@@ -804,7 +801,7 @@
EXPECT_EQ(0u, loop->Body()->InboundSiblingBranches().Length());
EXPECT_EQ(0u, loop->Continuing()->InboundSiblingBranches().Length());
- EXPECT_EQ(Disassemble(m).Plain(),
+ EXPECT_EQ(core::ir::Disassembler(m).Plain(),
R"(%test_function = @compute @workgroup_size(1, 1, 1) func():void {
$B1: {
loop [b: $B2] { # loop_1
@@ -849,7 +846,7 @@
ASSERT_EQ(1u, cases[2].selectors.Length());
EXPECT_TRUE(cases[2].selectors[0].IsDefault());
- EXPECT_EQ(Disassemble(m).Plain(),
+ EXPECT_EQ(core::ir::Disassembler(m).Plain(),
R"(%test_function = @compute @workgroup_size(1, 1, 1) func():void {
$B1: {
switch 1i [c: (0i, $B2), c: (1i, $B3), c: (default, $B4)] { # switch_1
@@ -897,7 +894,7 @@
EXPECT_TRUE(cases[0].selectors[2].IsDefault());
- EXPECT_EQ(Disassemble(m).Plain(),
+ EXPECT_EQ(core::ir::Disassembler(m).Plain(),
R"(%test_function = @compute @workgroup_size(1, 1, 1) func():void {
$B1: {
switch 1i [c: (0i 1i default, $B2)] { # switch_1
@@ -928,7 +925,7 @@
ASSERT_EQ(1u, cases[0].selectors.Length());
EXPECT_TRUE(cases[0].selectors[0].IsDefault());
- EXPECT_EQ(Disassemble(m).Plain(),
+ EXPECT_EQ(core::ir::Disassembler(m).Plain(),
R"(%test_function = @compute @workgroup_size(1, 1, 1) func():void {
$B1: {
switch 1i [c: (default, $B2)] { # switch_1
@@ -968,7 +965,7 @@
// This is 1 because the if is dead-code eliminated and the return doesn't happen.
- EXPECT_EQ(Disassemble(m).Plain(),
+ EXPECT_EQ(core::ir::Disassembler(m).Plain(),
R"(%test_function = @compute @workgroup_size(1, 1, 1) func():void {
$B1: {
switch 1i [c: (0i, $B2), c: (default, $B3)] { # switch_1
@@ -1010,7 +1007,7 @@
ASSERT_EQ(1u, cases[1].selectors.Length());
EXPECT_TRUE(cases[1].selectors[0].IsDefault());
- EXPECT_EQ(Disassemble(m).Plain(),
+ EXPECT_EQ(core::ir::Disassembler(m).Plain(),
R"(%test_function = @compute @workgroup_size(1, 1, 1) func():void {
$B1: {
switch 1i [c: (0i, $B2), c: (default, $B3)] { # switch_1
@@ -1034,7 +1031,7 @@
auto m = Build();
ASSERT_EQ(m, Success);
- EXPECT_EQ(Disassemble(m.Get()).Plain(),
+ EXPECT_EQ(core::ir::Disassembler(m.Get()).Plain(),
R"(%b = func():i32 {
$B1: {
ret 1i
@@ -1059,7 +1056,7 @@
ASSERT_EQ(m, Success);
EXPECT_EQ(
- Disassemble(m.Get()).Plain(),
+ core::ir::Disassembler(m.Get()).Plain(),
R"(%f = @fragment func(%a:vec4<f32> [@invariant, @position]):vec4<f32> [@location(1)] {
$B1: {
ret %a
@@ -1075,7 +1072,7 @@
auto m = Build();
ASSERT_EQ(m, Success);
- EXPECT_EQ(Disassemble(m.Get()).Plain(),
+ EXPECT_EQ(core::ir::Disassembler(m.Get()).Plain(),
R"(%f = @fragment func(%a:f32 [@location(2)]):f32 [@location(1)] {
$B1: {
ret %a
@@ -1096,7 +1093,7 @@
ASSERT_EQ(m, Success);
EXPECT_EQ(
- Disassemble(m.Get()).Plain(),
+ core::ir::Disassembler(m.Get()).Plain(),
R"(%f = @fragment func(%a:f32 [@location(2), @interpolate(linear, centroid)]):f32 [@location(1)] {
$B1: {
ret %a
@@ -1115,7 +1112,7 @@
auto m = Build();
ASSERT_EQ(m, Success);
- EXPECT_EQ(Disassemble(m.Get()).Plain(),
+ EXPECT_EQ(core::ir::Disassembler(m.Get()).Plain(),
R"(%f = @fragment func(%a:f32 [@location(2), @interpolate(flat)]):f32 [@location(1)] {
$B1: {
ret %a
@@ -1138,7 +1135,7 @@
EXPECT_EQ(m->functions[0]->Stage(), core::ir::Function::PipelineStage::kUndefined);
- EXPECT_EQ(Disassemble(m.Get()).Plain(), R"(%f = func():void {
+ EXPECT_EQ(core::ir::Disassembler(m.Get()).Plain(), R"(%f = func():void {
$B1: {
ret
}
@@ -1159,7 +1156,7 @@
auto m = Build();
ASSERT_EQ(m, Success);
- EXPECT_EQ(Disassemble(m.Get()).Plain(),
+ EXPECT_EQ(core::ir::Disassembler(m.Get()).Plain(),
R"(%f = func():void {
$B1: {
ret
diff --git a/src/tint/lang/wgsl/reader/program_to_ir/shadowing_test.cc b/src/tint/lang/wgsl/reader/program_to_ir/shadowing_test.cc
index c3bcff5..aaa224d 100644
--- a/src/tint/lang/wgsl/reader/program_to_ir/shadowing_test.cc
+++ b/src/tint/lang/wgsl/reader/program_to_ir/shadowing_test.cc
@@ -25,13 +25,7 @@
// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-#include "gmock/gmock.h"
-#include "src/tint/lang/core/constant/scalar.h"
-#include "src/tint/lang/core/ir/block.h"
-#include "src/tint/lang/core/ir/constant.h"
-#include "src/tint/lang/core/ir/var.h"
-#include "src/tint/lang/wgsl/ast/case_selector.h"
-#include "src/tint/lang/wgsl/ast/int_literal_expression.h"
+#include "src/tint/lang/core/ir/disassembler.h"
#include "src/tint/lang/wgsl/reader/program_to_ir/ir_program_test.h"
namespace tint::wgsl {
@@ -59,7 +53,7 @@
ASSERT_EQ(m, Success);
- EXPECT_EQ(Disassemble(m.Get()).Plain(), R"(S = struct @align(4) {
+ EXPECT_EQ(core::ir::Disassembler(m.Get()).Plain(), R"(S = struct @align(4) {
i:i32 @offset(0)
}
@@ -87,7 +81,7 @@
ASSERT_EQ(m, Success);
- EXPECT_EQ(Disassemble(m.Get()).Plain(), R"(S = struct @align(4) {
+ EXPECT_EQ(core::ir::Disassembler(m.Get()).Plain(), R"(S = struct @align(4) {
i:i32 @offset(0)
}
@@ -113,7 +107,7 @@
ASSERT_EQ(m, Success);
- EXPECT_EQ(Disassemble(m.Get()).Plain(), R"($B1: { # root
+ EXPECT_EQ(core::ir::Disassembler(m.Get()).Plain(), R"($B1: { # root
%i:ptr<private, i32, read_write> = var, 1i
}
@@ -145,7 +139,7 @@
ASSERT_EQ(m, Success);
- EXPECT_EQ(Disassemble(m.Get()).Plain(), R"($B1: { # root
+ EXPECT_EQ(core::ir::Disassembler(m.Get()).Plain(), R"($B1: { # root
%i:ptr<private, i32, read_write> = var, 1i
}
@@ -178,7 +172,7 @@
ASSERT_EQ(m, Success);
- EXPECT_EQ(Disassemble(m.Get()).Plain(), R"(%f = func():i32 {
+ EXPECT_EQ(core::ir::Disassembler(m.Get()).Plain(), R"(%f = func():i32 {
$B1: {
%i:ptr<function, i32, read_write> = var
if true [t: $B2] { # if_1
@@ -217,7 +211,7 @@
ASSERT_EQ(m, Success);
- EXPECT_EQ(Disassemble(m.Get()).Plain(), R"(%f = func():i32 {
+ EXPECT_EQ(core::ir::Disassembler(m.Get()).Plain(), R"(%f = func():i32 {
$B1: {
%i:ptr<function, i32, read_write> = var
if true [t: $B2] { # if_1
@@ -252,7 +246,7 @@
ASSERT_EQ(m, Success);
- EXPECT_EQ(Disassemble(m.Get()).Plain(), R"(%f = func():i32 {
+ EXPECT_EQ(core::ir::Disassembler(m.Get()).Plain(), R"(%f = func():i32 {
$B1: {
%i:ptr<function, i32, read_write> = var
loop [b: $B2, c: $B3] { # loop_1
@@ -298,7 +292,7 @@
ASSERT_EQ(m, Success);
- EXPECT_EQ(Disassemble(m.Get()).Plain(), R"(%f = func():i32 {
+ EXPECT_EQ(core::ir::Disassembler(m.Get()).Plain(), R"(%f = func():i32 {
$B1: {
%i:ptr<function, i32, read_write> = var
loop [b: $B2, c: $B3] { # loop_1
@@ -342,7 +336,7 @@
ASSERT_EQ(m, Success);
- EXPECT_EQ(Disassemble(m.Get()).Plain(), R"(%f = func():i32 {
+ EXPECT_EQ(core::ir::Disassembler(m.Get()).Plain(), R"(%f = func():i32 {
$B1: {
%i:ptr<function, i32, read_write> = var
loop [i: $B2, b: $B3] { # loop_1
@@ -386,7 +380,7 @@
ASSERT_EQ(m, Success);
- EXPECT_EQ(Disassemble(m.Get()).Plain(), R"(%f = func():i32 {
+ EXPECT_EQ(core::ir::Disassembler(m.Get()).Plain(), R"(%f = func():i32 {
$B1: {
%i:ptr<function, i32, read_write> = var
loop [i: $B2, b: $B3] { # loop_1
@@ -429,7 +423,7 @@
ASSERT_EQ(m, Success);
- EXPECT_EQ(Disassemble(m.Get()).Plain(), R"(%f = func():i32 {
+ EXPECT_EQ(core::ir::Disassembler(m.Get()).Plain(), R"(%f = func():i32 {
$B1: {
%i:ptr<function, i32, read_write> = var
loop [i: $B2, b: $B3] { # loop_1
@@ -476,7 +470,7 @@
ASSERT_EQ(m, Success);
- EXPECT_EQ(Disassemble(m.Get()).Plain(), R"(%f = func():i32 {
+ EXPECT_EQ(core::ir::Disassembler(m.Get()).Plain(), R"(%f = func():i32 {
$B1: {
%i:ptr<function, i32, read_write> = var
loop [i: $B2, b: $B3] { # loop_1
@@ -527,7 +521,7 @@
ASSERT_EQ(m, Success);
- EXPECT_EQ(Disassemble(m.Get()).Plain(), R"(%f = func():i32 {
+ EXPECT_EQ(core::ir::Disassembler(m.Get()).Plain(), R"(%f = func():i32 {
$B1: {
%i:ptr<function, i32, read_write> = var
loop [b: $B2, c: $B3] { # loop_1
@@ -581,7 +575,7 @@
ASSERT_EQ(m, Success);
- EXPECT_EQ(Disassemble(m.Get()).Plain(), R"(%f = func():i32 {
+ EXPECT_EQ(core::ir::Disassembler(m.Get()).Plain(), R"(%f = func():i32 {
$B1: {
%i:ptr<function, i32, read_write> = var
loop [b: $B2, c: $B3] { # loop_1
@@ -635,7 +629,7 @@
ASSERT_EQ(m, Success);
- EXPECT_EQ(Disassemble(m.Get()).Plain(), R"(%f = func():i32 {
+ EXPECT_EQ(core::ir::Disassembler(m.Get()).Plain(), R"(%f = func():i32 {
$B1: {
%i:ptr<function, i32, read_write> = var
loop [b: $B2, c: $B3] { # loop_1
@@ -685,7 +679,7 @@
ASSERT_EQ(m, Success);
- EXPECT_EQ(Disassemble(m.Get()).Plain(), R"(%f = func():i32 {
+ EXPECT_EQ(core::ir::Disassembler(m.Get()).Plain(), R"(%f = func():i32 {
$B1: {
%i:ptr<function, i32, read_write> = var
loop [b: $B2, c: $B3] { # loop_1
@@ -735,7 +729,7 @@
ASSERT_EQ(m, Success);
- EXPECT_EQ(Disassemble(m.Get()).Plain(), R"(%f = func():i32 {
+ EXPECT_EQ(core::ir::Disassembler(m.Get()).Plain(), R"(%f = func():i32 {
$B1: {
%i:ptr<function, i32, read_write> = var
%3:i32 = load %i
@@ -783,7 +777,7 @@
ASSERT_EQ(m, Success);
- EXPECT_EQ(Disassemble(m.Get()).Plain(), R"(%f = func():i32 {
+ EXPECT_EQ(core::ir::Disassembler(m.Get()).Plain(), R"(%f = func():i32 {
$B1: {
%i:ptr<function, i32, read_write> = var
%3:i32 = load %i
diff --git a/src/tint/lang/wgsl/reader/program_to_ir/store_test.cc b/src/tint/lang/wgsl/reader/program_to_ir/store_test.cc
index 4d7e15d..6e2806b 100644
--- a/src/tint/lang/wgsl/reader/program_to_ir/store_test.cc
+++ b/src/tint/lang/wgsl/reader/program_to_ir/store_test.cc
@@ -25,10 +25,7 @@
// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-#include "gmock/gmock.h"
-#include "src/tint/lang/core/constant/scalar.h"
-#include "src/tint/lang/wgsl/ast/case_selector.h"
-#include "src/tint/lang/wgsl/ast/int_literal_expression.h"
+#include "src/tint/lang/core/ir/disassembler.h"
#include "src/tint/lang/wgsl/reader/program_to_ir/ir_program_test.h"
namespace tint::wgsl::reader {
@@ -47,7 +44,7 @@
auto m = Build();
ASSERT_EQ(m, Success);
- EXPECT_EQ(Disassemble(m.Get()).Plain(), R"($B1: { # root
+ EXPECT_EQ(core::ir::Disassembler(m.Get()).Plain(), R"($B1: { # root
%a:ptr<private, u32, read_write> = var
}
diff --git a/src/tint/lang/wgsl/reader/program_to_ir/unary_test.cc b/src/tint/lang/wgsl/reader/program_to_ir/unary_test.cc
index e50dcb5..4c8fe31 100644
--- a/src/tint/lang/wgsl/reader/program_to_ir/unary_test.cc
+++ b/src/tint/lang/wgsl/reader/program_to_ir/unary_test.cc
@@ -25,9 +25,7 @@
// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-#include "src/tint/lang/core/constant/scalar.h"
-#include "src/tint/lang/wgsl/ast/case_selector.h"
-#include "src/tint/lang/wgsl/ast/int_literal_expression.h"
+#include "src/tint/lang/core/ir/disassembler.h"
#include "src/tint/lang/wgsl/reader/program_to_ir/ir_program_test.h"
namespace tint::wgsl::reader {
@@ -45,7 +43,7 @@
auto m = Build();
ASSERT_EQ(m, Success);
- EXPECT_EQ(Disassemble(m.Get()).Plain(), R"(%my_func = func():bool {
+ EXPECT_EQ(core::ir::Disassembler(m.Get()).Plain(), R"(%my_func = func():bool {
$B1: {
ret false
}
@@ -69,7 +67,7 @@
auto m = Build();
ASSERT_EQ(m, Success);
- EXPECT_EQ(Disassemble(m.Get()).Plain(), R"(%my_func = func():vec4<bool> {
+ EXPECT_EQ(core::ir::Disassembler(m.Get()).Plain(), R"(%my_func = func():vec4<bool> {
$B1: {
ret vec4<bool>(false)
}
@@ -93,7 +91,7 @@
auto m = Build();
ASSERT_EQ(m, Success);
- EXPECT_EQ(Disassemble(m.Get()).Plain(), R"(%my_func = func():u32 {
+ EXPECT_EQ(core::ir::Disassembler(m.Get()).Plain(), R"(%my_func = func():u32 {
$B1: {
ret 1u
}
@@ -117,7 +115,7 @@
auto m = Build();
ASSERT_EQ(m, Success);
- EXPECT_EQ(Disassemble(m.Get()).Plain(), R"(%my_func = func():i32 {
+ EXPECT_EQ(core::ir::Disassembler(m.Get()).Plain(), R"(%my_func = func():i32 {
$B1: {
ret 1i
}
@@ -142,7 +140,7 @@
auto m = Build();
ASSERT_EQ(m, Success);
- EXPECT_EQ(Disassemble(m.Get()).Plain(), R"($B1: { # root
+ EXPECT_EQ(core::ir::Disassembler(m.Get()).Plain(), R"($B1: { # root
%v1:ptr<private, i32, read_write> = var
}
@@ -166,7 +164,7 @@
auto m = Build();
ASSERT_EQ(m, Success);
- EXPECT_EQ(Disassemble(m.Get()).Plain(), R"($B1: { # root
+ EXPECT_EQ(core::ir::Disassembler(m.Get()).Plain(), R"($B1: { # root
%v1:ptr<private, i32, read_write> = var
}
diff --git a/src/tint/lang/wgsl/reader/program_to_ir/var_test.cc b/src/tint/lang/wgsl/reader/program_to_ir/var_test.cc
index 65f2b6b..f23f9ed 100644
--- a/src/tint/lang/wgsl/reader/program_to_ir/var_test.cc
+++ b/src/tint/lang/wgsl/reader/program_to_ir/var_test.cc
@@ -25,10 +25,7 @@
// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-#include "gmock/gmock.h"
-#include "src/tint/lang/core/constant/scalar.h"
-#include "src/tint/lang/wgsl/ast/case_selector.h"
-#include "src/tint/lang/wgsl/ast/int_literal_expression.h"
+#include "src/tint/lang/core/ir/disassembler.h"
#include "src/tint/lang/wgsl/reader/program_to_ir/ir_program_test.h"
namespace tint::wgsl::reader {
@@ -45,7 +42,7 @@
auto m = Build();
ASSERT_EQ(m, Success);
- EXPECT_EQ(Disassemble(m.Get()).Plain(), R"($B1: { # root
+ EXPECT_EQ(core::ir::Disassembler(m.Get()).Plain(), R"($B1: { # root
%a:ptr<private, u32, read_write> = var
}
@@ -59,7 +56,7 @@
auto m = Build();
ASSERT_EQ(m, Success);
- EXPECT_EQ(Disassemble(m.Get()).Plain(), R"($B1: { # root
+ EXPECT_EQ(core::ir::Disassembler(m.Get()).Plain(), R"($B1: { # root
%a:ptr<private, u32, read_write> = var, 2u
}
@@ -72,7 +69,7 @@
auto m = Build();
ASSERT_EQ(m, Success);
- EXPECT_EQ(Disassemble(m.Get()).Plain(), R"($B1: { # root
+ EXPECT_EQ(core::ir::Disassembler(m.Get()).Plain(), R"($B1: { # root
%a:ptr<storage, u32, read> = var @binding_point(2, 3)
}
@@ -86,7 +83,7 @@
auto m = Build();
ASSERT_EQ(m, Success);
- EXPECT_EQ(Disassemble(m.Get()).Plain(),
+ EXPECT_EQ(core::ir::Disassembler(m.Get()).Plain(),
R"(%test_function = @compute @workgroup_size(1, 1, 1) func():void {
$B1: {
%a:ptr<function, u32, read_write> = var
@@ -104,7 +101,7 @@
auto m = Build();
ASSERT_EQ(m, Success);
- EXPECT_EQ(Disassemble(m.Get()).Plain(),
+ EXPECT_EQ(core::ir::Disassembler(m.Get()).Plain(),
R"(%test_function = @compute @workgroup_size(1, 1, 1) func():void {
$B1: {
%a:ptr<function, u32, read_write> = var, 2u
@@ -122,7 +119,7 @@
auto m = Build();
ASSERT_EQ(m, Success);
- EXPECT_EQ(Disassemble(m.Get()).Plain(),
+ EXPECT_EQ(core::ir::Disassembler(m.Get()).Plain(),
R"(%test_function = @compute @workgroup_size(1, 1, 1) func():void {
$B1: {
%a:ptr<function, u32, read_write> = var
@@ -142,7 +139,7 @@
auto m = Build();
ASSERT_EQ(m, Success);
- EXPECT_EQ(Disassemble(m.Get()).Plain(),
+ EXPECT_EQ(core::ir::Disassembler(m.Get()).Plain(),
R"(%test_function = @compute @workgroup_size(1, 1, 1) func():void {
$B1: {
%a:ptr<function, i32, read_write> = var
@@ -179,7 +176,7 @@
auto m = Build();
ASSERT_EQ(m, Success);
- EXPECT_EQ(Disassemble(m.Get()).Plain(),
+ EXPECT_EQ(core::ir::Disassembler(m.Get()).Plain(),
R"(%f = func(%p:i32):i32 {
$B1: {
ret %p
@@ -225,7 +222,7 @@
auto m = Build();
ASSERT_EQ(m, Success);
- EXPECT_EQ(Disassemble(m.Get()).Plain(),
+ EXPECT_EQ(core::ir::Disassembler(m.Get()).Plain(),
R"(%f = func(%p:i32):i32 {
$B1: {
ret %p
@@ -273,7 +270,7 @@
auto m = Build();
ASSERT_EQ(m, Success);
- EXPECT_EQ(Disassemble(m.Get()).Plain(),
+ EXPECT_EQ(core::ir::Disassembler(m.Get()).Plain(),
R"(%f = func(%p:i32):i32 {
$B1: {
ret %p
@@ -305,7 +302,7 @@
auto m = Build();
ASSERT_EQ(m, Success);
- EXPECT_EQ(Disassemble(m.Get()).Plain(),
+ EXPECT_EQ(core::ir::Disassembler(m.Get()).Plain(),
R"(%test_function = @compute @workgroup_size(1, 1, 1) func():void {
$B1: {
%a:ptr<function, i32, read_write> = var
@@ -344,7 +341,7 @@
auto m = Build();
ASSERT_EQ(m, Success);
- EXPECT_EQ(Disassemble(m.Get()).Plain(),
+ EXPECT_EQ(core::ir::Disassembler(m.Get()).Plain(),
R"(%f = func(%p:i32):i32 {
$B1: {
ret %p
@@ -396,7 +393,7 @@
auto m = Build();
ASSERT_EQ(m, Success);
- EXPECT_EQ(Disassemble(m.Get()).Plain(),
+ EXPECT_EQ(core::ir::Disassembler(m.Get()).Plain(),
R"(%f = func(%p:i32):i32 {
$B1: {
ret %p
diff --git a/src/tint/lang/wgsl/writer/ir_to_program/ir_to_program_test.cc b/src/tint/lang/wgsl/writer/ir_to_program/ir_to_program_test.cc
index 3619a0d..34dd4be 100644
--- a/src/tint/lang/wgsl/writer/ir_to_program/ir_to_program_test.cc
+++ b/src/tint/lang/wgsl/writer/ir_to_program/ir_to_program_test.cc
@@ -32,12 +32,11 @@
#include "src/tint/lang/core/access.h"
#include "src/tint/lang/core/address_space.h"
-#include "src/tint/lang/core/ir/disassembly.h"
+#include "src/tint/lang/core/ir/disassembler.h"
#include "src/tint/lang/core/texel_format.h"
#include "src/tint/lang/core/type/storage_texture.h"
#include "src/tint/lang/core/type/texture_dimension.h"
#include "src/tint/lang/wgsl/ir/builtin_call.h"
-#include "src/tint/lang/wgsl/ir/unary.h"
#include "src/tint/lang/wgsl/writer/ir_to_program/ir_to_program.h"
#include "src/tint/lang/wgsl/writer/ir_to_program/ir_to_program_test.h"
#include "src/tint/lang/wgsl/writer/writer.h"
@@ -51,7 +50,7 @@
IRToProgramTest::Result IRToProgramTest::Run() {
Result result;
- result.ir = tint::core::ir::Disassemble(mod).Plain();
+ result.ir = tint::core::ir::Disassembler(mod).Plain();
ProgramOptions options;
options.allowed_features = AllowedFeatures::Everything();
diff --git a/src/tint/lang/wgsl/writer/raise/ptr_to_ref_test.cc b/src/tint/lang/wgsl/writer/raise/ptr_to_ref_test.cc
index 40f02f4..da66ad8 100644
--- a/src/tint/lang/wgsl/writer/raise/ptr_to_ref_test.cc
+++ b/src/tint/lang/wgsl/writer/raise/ptr_to_ref_test.cc
@@ -32,7 +32,7 @@
#include "gtest/gtest.h"
#include "src/tint/lang/core/ir/builder.h"
-#include "src/tint/lang/core/ir/disassembly.h"
+#include "src/tint/lang/core/ir/disassembler.h"
#include "src/tint/lang/core/ir/validator.h"
namespace tint::wgsl::writer::raise {
@@ -65,7 +65,7 @@
}
/// @returns the transformed module as a disassembled string
- std::string str() { return "\n" + core::ir::Disassemble(mod).Plain(); }
+ std::string str() { return "\n" + core::ir::Disassembler(mod).Plain(); }
protected:
/// The test IR module.
diff --git a/src/tint/lang/wgsl/writer/writer_test.cc b/src/tint/lang/wgsl/writer/writer_test.cc
index 3477d2a..75febee 100644
--- a/src/tint/lang/wgsl/writer/writer_test.cc
+++ b/src/tint/lang/wgsl/writer/writer_test.cc
@@ -32,7 +32,7 @@
#include <string_view>
#include "gtest/gtest.h"
-#include "src/tint/lang/core/ir/disassembly.h"
+#include "src/tint/lang/core/ir/disassembler.h"
#include "src/tint/lang/core/ir/ir_helper_test.h"
#include "src/tint/lang/wgsl/writer/ir_to_program/ir_to_program.h"
#include "src/tint/lang/wgsl/writer/ir_to_program/program_options.h"
@@ -65,14 +65,14 @@
Result Run(std::string_view expected_wgsl) {
Result result;
- result.ir_pre_raise = core::ir::Disassemble(mod).Plain();
+ result.ir_pre_raise = core::ir::Disassembler(mod).Plain();
if (auto res = tint::wgsl::writer::Raise(mod); res != Success) {
result.err = res.Failure().reason.Str();
return result;
}
- result.ir_post_raise = core::ir::Disassemble(mod).Plain();
+ result.ir_post_raise = core::ir::Disassembler(mod).Plain();
writer::ProgramOptions program_options;
program_options.allowed_features = AllowedFeatures::Everything();