[tint] Remove unnecessary calls to diag::List::str()
diag: :List supports operator<<(), so we don't need to call str().
Change-Id: I2e9a6430328649dbca5cb7fec13f865be41c3f4c
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/152801
Reviewed-by: dan sinclair <dsinclair@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Ben Clayton <bclayton@google.com>
diff --git a/src/tint/cmd/common/generate_external_texture_bindings_test.cc b/src/tint/cmd/common/generate_external_texture_bindings_test.cc
index 89a45c6..a020927 100644
--- a/src/tint/cmd/common/generate_external_texture_bindings_test.cc
+++ b/src/tint/cmd/common/generate_external_texture_bindings_test.cc
@@ -109,7 +109,7 @@
b.GlobalVar("v4", b.ty.i32(), b.Group(0_a), b.Binding(4_a), kUniform);
tint::Program program(resolver::Resolve(b));
- ASSERT_TRUE(program.IsValid()) << program.Diagnostics().str();
+ ASSERT_TRUE(program.IsValid()) << program.Diagnostics();
auto bindings = GenerateExternalTextureBindings(program);
ASSERT_EQ(bindings.size(), 2u);
diff --git a/src/tint/cmd/tint/main.cc b/src/tint/cmd/tint/main.cc
index 4780e81..c943041 100644
--- a/src/tint/cmd/tint/main.cc
+++ b/src/tint/cmd/tint/main.cc
@@ -1208,7 +1208,7 @@
auto program = transform_manager.Run(info.program, std::move(transform_inputs), outputs);
if (!program.IsValid()) {
tint::cmd::PrintWGSL(std::cerr, program);
- std::cerr << program.Diagnostics().str() << std::endl;
+ std::cerr << program.Diagnostics() << std::endl;
return 1;
}
diff --git a/src/tint/fuzzers/tint_ast_fuzzer/expression_size_test.cc b/src/tint/fuzzers/tint_ast_fuzzer/expression_size_test.cc
index e9b22e6..c362b68 100644
--- a/src/tint/fuzzers/tint_ast_fuzzer/expression_size_test.cc
+++ b/src/tint/fuzzers/tint_ast_fuzzer/expression_size_test.cc
@@ -35,7 +35,7 @@
)";
Source::File file("test.wgsl", content);
auto program = wgsl::reader::Parse(&file);
- ASSERT_TRUE(program.IsValid()) << program.Diagnostics().str();
+ ASSERT_TRUE(program.IsValid()) << program.Diagnostics();
ExpressionSize expression_size(program);
for (const auto* node : program.ASTNodes().Objects()) {
diff --git a/src/tint/fuzzers/tint_ast_fuzzer/fuzzer.cc b/src/tint/fuzzers/tint_ast_fuzzer/fuzzer.cc
index da8290a..dca2487 100644
--- a/src/tint/fuzzers/tint_ast_fuzzer/fuzzer.cc
+++ b/src/tint/fuzzers/tint_ast_fuzzer/fuzzer.cc
@@ -48,7 +48,7 @@
auto program = wgsl::reader::Parse(&file);
if (!program.IsValid()) {
std::cout << "Trying to mutate an invalid program:" << std::endl
- << program.Diagnostics().str() << std::endl;
+ << program.Diagnostics() << std::endl;
return 0;
}
@@ -61,7 +61,7 @@
if (!program.IsValid()) {
std::cout << "Mutator produced invalid WGSL:" << std::endl
<< " seed: " << seed << std::endl
- << program.Diagnostics().str() << std::endl;
+ << program.Diagnostics() << std::endl;
return 0;
}
@@ -115,7 +115,7 @@
fuzzer.Run(data, size);
if (fuzzer.HasErrors()) {
std::cout << "Fuzzing " << target.name << " produced an error" << std::endl
- << fuzzer.Diagnostics().str() << std::endl;
+ << fuzzer.Diagnostics() << std::endl;
}
}
diff --git a/src/tint/fuzzers/tint_ast_fuzzer/jump_tracker_test.cc b/src/tint/fuzzers/tint_ast_fuzzer/jump_tracker_test.cc
index 1a15298..57b2e11 100644
--- a/src/tint/fuzzers/tint_ast_fuzzer/jump_tracker_test.cc
+++ b/src/tint/fuzzers/tint_ast_fuzzer/jump_tracker_test.cc
@@ -72,7 +72,7 @@
)";
Source::File file("test.wgsl", content);
auto program = wgsl::reader::Parse(&file);
- ASSERT_TRUE(program.IsValid()) << program.Diagnostics().str();
+ ASSERT_TRUE(program.IsValid()) << program.Diagnostics();
JumpTracker jump_tracker(program);
@@ -151,7 +151,7 @@
)";
Source::File file("test.wgsl", content);
auto program = wgsl::reader::Parse(&file);
- ASSERT_TRUE(program.IsValid()) << program.Diagnostics().str();
+ ASSERT_TRUE(program.IsValid()) << program.Diagnostics();
JumpTracker jump_tracker(program);
@@ -215,7 +215,7 @@
)";
Source::File file("test.wgsl", content);
auto program = wgsl::reader::Parse(&file);
- ASSERT_TRUE(program.IsValid()) << program.Diagnostics().str();
+ ASSERT_TRUE(program.IsValid()) << program.Diagnostics();
JumpTracker jump_tracker(program);
diff --git a/src/tint/fuzzers/tint_ast_fuzzer/mutations/change_binary_operator_test.cc b/src/tint/fuzzers/tint_ast_fuzzer/mutations/change_binary_operator_test.cc
index 4feadfd..d07df67 100644
--- a/src/tint/fuzzers/tint_ast_fuzzer/mutations/change_binary_operator_test.cc
+++ b/src/tint/fuzzers/tint_ast_fuzzer/mutations/change_binary_operator_test.cc
@@ -80,7 +80,7 @@
)";
Source::File file("test.wgsl", content);
auto program = wgsl::reader::Parse(&file);
- ASSERT_TRUE(program.IsValid()) << program.Diagnostics().str();
+ ASSERT_TRUE(program.IsValid()) << program.Diagnostics();
NodeIdMap node_id_map(program);
@@ -121,7 +121,7 @@
)";
Source::File file("test.wgsl", shader);
auto program = wgsl::reader::Parse(&file);
- ASSERT_TRUE(program.IsValid()) << program.Diagnostics().str();
+ ASSERT_TRUE(program.IsValid()) << program.Diagnostics();
NodeIdMap node_id_map(program);
@@ -139,7 +139,7 @@
ASSERT_TRUE(MaybeApplyMutation(
program, MutationChangeBinaryOperator(sum_expr_id, core::BinaryOp::kSubtract), node_id_map,
program, &node_id_map, nullptr));
- ASSERT_TRUE(program.IsValid()) << program.Diagnostics().str();
+ ASSERT_TRUE(program.IsValid()) << program.Diagnostics();
wgsl::writer::Options options;
auto result = wgsl::writer::Generate(program, options);
@@ -184,7 +184,7 @@
for (auto new_operator : all_operators) {
Source::File file("test.wgsl", shader.str());
auto program = wgsl::reader::Parse(&file);
- ASSERT_TRUE(program.IsValid()) << program.Diagnostics().str();
+ ASSERT_TRUE(program.IsValid()) << program.Diagnostics();
NodeIdMap node_id_map(program);
@@ -211,12 +211,12 @@
if (new_operator != binary_expr->op) {
Source::File invalid_file("test.wgsl", expected_shader.str());
auto invalid_program = wgsl::reader::Parse(&invalid_file);
- ASSERT_FALSE(invalid_program.IsValid()) << program.Diagnostics().str();
+ ASSERT_FALSE(invalid_program.IsValid()) << program.Diagnostics();
}
} else {
ASSERT_TRUE(
MaybeApplyMutation(program, mutation, node_id_map, program, &node_id_map, nullptr));
- ASSERT_TRUE(program.IsValid()) << program.Diagnostics().str();
+ ASSERT_TRUE(program.IsValid()) << program.Diagnostics();
wgsl::writer::Options options;
auto result = wgsl::writer::Generate(program, options);
diff --git a/src/tint/fuzzers/tint_ast_fuzzer/mutations/change_unary_operator_test.cc b/src/tint/fuzzers/tint_ast_fuzzer/mutations/change_unary_operator_test.cc
index 7d9cff2..2eba328 100644
--- a/src/tint/fuzzers/tint_ast_fuzzer/mutations/change_unary_operator_test.cc
+++ b/src/tint/fuzzers/tint_ast_fuzzer/mutations/change_unary_operator_test.cc
@@ -44,7 +44,7 @@
)";
Source::File file("test.wgsl", content);
auto program = wgsl::reader::Parse(&file);
- ASSERT_TRUE(program.IsValid()) << program.Diagnostics().str();
+ ASSERT_TRUE(program.IsValid()) << program.Diagnostics();
NodeIdMap node_id_map(program);
@@ -136,7 +136,7 @@
)";
Source::File file("test.wgsl", content);
auto program = wgsl::reader::Parse(&file);
- ASSERT_TRUE(program.IsValid()) << program.Diagnostics().str();
+ ASSERT_TRUE(program.IsValid()) << program.Diagnostics();
NodeIdMap node_id_map(program);
@@ -155,7 +155,7 @@
ASSERT_TRUE(MaybeApplyMutation(program,
MutationChangeUnaryOperator(comp_a_id, core::UnaryOp::kNegation),
node_id_map, program, &node_id_map, nullptr));
- ASSERT_TRUE(program.IsValid()) << program.Diagnostics().str();
+ ASSERT_TRUE(program.IsValid()) << program.Diagnostics();
wgsl::writer::Options options;
auto result = wgsl::writer::Generate(program, options);
@@ -177,7 +177,7 @@
})";
Source::File file("test.wgsl", content);
auto program = wgsl::reader::Parse(&file);
- ASSERT_TRUE(program.IsValid()) << program.Diagnostics().str();
+ ASSERT_TRUE(program.IsValid()) << program.Diagnostics();
NodeIdMap node_id_map(program);
@@ -196,7 +196,7 @@
ASSERT_TRUE(MaybeApplyMutation(program,
MutationChangeUnaryOperator(comp_b_id, core::UnaryOp::kNegation),
node_id_map, program, &node_id_map, nullptr));
- ASSERT_TRUE(program.IsValid()) << program.Diagnostics().str();
+ ASSERT_TRUE(program.IsValid()) << program.Diagnostics();
wgsl::writer::Options options;
auto result = wgsl::writer::Generate(program, options);
@@ -220,7 +220,7 @@
)";
Source::File file("test.wgsl", content);
auto program = wgsl::reader::Parse(&file);
- ASSERT_TRUE(program.IsValid()) << program.Diagnostics().str();
+ ASSERT_TRUE(program.IsValid()) << program.Diagnostics();
NodeIdMap node_id_map(program);
@@ -239,7 +239,7 @@
ASSERT_TRUE(MaybeApplyMutation(
program, MutationChangeUnaryOperator(neg_a_id, core::UnaryOp::kComplement), node_id_map,
program, &node_id_map, nullptr));
- ASSERT_TRUE(program.IsValid()) << program.Diagnostics().str();
+ ASSERT_TRUE(program.IsValid()) << program.Diagnostics();
wgsl::writer::Options options;
auto result = wgsl::writer::Generate(program, options);
@@ -262,7 +262,7 @@
)";
Source::File file("test.wgsl", content);
auto program = wgsl::reader::Parse(&file);
- ASSERT_TRUE(program.IsValid()) << program.Diagnostics().str();
+ ASSERT_TRUE(program.IsValid()) << program.Diagnostics();
NodeIdMap node_id_map(program);
@@ -281,7 +281,7 @@
ASSERT_TRUE(MaybeApplyMutation(
program, MutationChangeUnaryOperator(neg_b_id, core::UnaryOp::kComplement), node_id_map,
program, &node_id_map, nullptr));
- ASSERT_TRUE(program.IsValid()) << program.Diagnostics().str();
+ ASSERT_TRUE(program.IsValid()) << program.Diagnostics();
wgsl::writer::Options options;
auto result = wgsl::writer::Generate(program, options);
diff --git a/src/tint/fuzzers/tint_ast_fuzzer/mutations/delete_statement_test.cc b/src/tint/fuzzers/tint_ast_fuzzer/mutations/delete_statement_test.cc
index 1f0bb26..d7338b5 100644
--- a/src/tint/fuzzers/tint_ast_fuzzer/mutations/delete_statement_test.cc
+++ b/src/tint/fuzzers/tint_ast_fuzzer/mutations/delete_statement_test.cc
@@ -45,8 +45,8 @@
Source::File expected_file("expected.wgsl", expected);
auto expected_program = wgsl::reader::Parse(&expected_file);
- ASSERT_TRUE(program.IsValid()) << program.Diagnostics().str();
- ASSERT_TRUE(expected_program.IsValid()) << expected_program.Diagnostics().str();
+ ASSERT_TRUE(program.IsValid()) << program.Diagnostics();
+ ASSERT_TRUE(expected_program.IsValid()) << expected_program.Diagnostics();
NodeIdMap node_id_map(program);
const auto* statement = statement_finder(program);
@@ -55,7 +55,7 @@
ASSERT_NE(statement_id, 0);
ASSERT_TRUE(MaybeApplyMutation(program, MutationDeleteStatement(statement_id), node_id_map,
program, &node_id_map, nullptr));
- ASSERT_TRUE(program.IsValid()) << program.Diagnostics().str();
+ ASSERT_TRUE(program.IsValid()) << program.Diagnostics();
wgsl::writer::Options options;
auto transformed_result = wgsl::writer::Generate(program, options);
auto expected_result = wgsl::writer::Generate(expected_program, options);
@@ -70,7 +70,7 @@
Source::File original_file("original.wgsl", original);
auto program = wgsl::reader::Parse(&original_file);
- ASSERT_TRUE(program.IsValid()) << program.Diagnostics().str();
+ ASSERT_TRUE(program.IsValid()) << program.Diagnostics();
NodeIdMap node_id_map(program);
const auto* statement = statement_finder(program);
diff --git a/src/tint/fuzzers/tint_ast_fuzzer/mutations/replace_identifier_test.cc b/src/tint/fuzzers/tint_ast_fuzzer/mutations/replace_identifier_test.cc
index f2d4b8f..86abf7b 100644
--- a/src/tint/fuzzers/tint_ast_fuzzer/mutations/replace_identifier_test.cc
+++ b/src/tint/fuzzers/tint_ast_fuzzer/mutations/replace_identifier_test.cc
@@ -41,7 +41,7 @@
)";
Source::File file("test.wgsl", content);
auto program = wgsl::reader::Parse(&file);
- ASSERT_TRUE(program.IsValid()) << program.Diagnostics().str();
+ ASSERT_TRUE(program.IsValid()) << program.Diagnostics();
NodeIdMap node_id_map(program);
@@ -120,7 +120,7 @@
)";
Source::File file("test.wgsl", shader);
auto program = wgsl::reader::Parse(&file);
- ASSERT_TRUE(program.IsValid()) << program.Diagnostics().str();
+ ASSERT_TRUE(program.IsValid()) << program.Diagnostics();
NodeIdMap node_id_map(program);
@@ -147,7 +147,7 @@
)";
Source::File file("test.wgsl", shader);
auto program = wgsl::reader::Parse(&file);
- ASSERT_TRUE(program.IsValid()) << program.Diagnostics().str();
+ ASSERT_TRUE(program.IsValid()) << program.Diagnostics();
NodeIdMap node_id_map(program);
@@ -179,7 +179,7 @@
)";
Source::File file("test.wgsl", shader);
auto program = wgsl::reader::Parse(&file);
- ASSERT_TRUE(program.IsValid()) << program.Diagnostics().str();
+ ASSERT_TRUE(program.IsValid()) << program.Diagnostics();
NodeIdMap node_id_map(program);
@@ -215,7 +215,7 @@
)";
Source::File file("test.wgsl", shader);
auto program = wgsl::reader::Parse(&file);
- ASSERT_TRUE(program.IsValid()) << program.Diagnostics().str();
+ ASSERT_TRUE(program.IsValid()) << program.Diagnostics();
NodeIdMap node_id_map(program);
@@ -250,7 +250,7 @@
)";
Source::File file("test.wgsl", shader);
auto program = wgsl::reader::Parse(&file);
- ASSERT_TRUE(program.IsValid()) << program.Diagnostics().str();
+ ASSERT_TRUE(program.IsValid()) << program.Diagnostics();
NodeIdMap node_id_map(program);
@@ -286,7 +286,7 @@
)";
Source::File file("test.wgsl", shader);
auto program = wgsl::reader::Parse(&file);
- ASSERT_TRUE(program.IsValid()) << program.Diagnostics().str();
+ ASSERT_TRUE(program.IsValid()) << program.Diagnostics();
NodeIdMap node_id_map(program);
@@ -322,7 +322,7 @@
)";
Source::File file("test.wgsl", shader);
auto program = wgsl::reader::Parse(&file);
- ASSERT_TRUE(program.IsValid()) << program.Diagnostics().str();
+ ASSERT_TRUE(program.IsValid()) << program.Diagnostics();
NodeIdMap node_id_map(program);
@@ -359,7 +359,7 @@
)";
Source::File file("test.wgsl", shader);
auto program = wgsl::reader::Parse(&file);
- ASSERT_TRUE(program.IsValid()) << program.Diagnostics().str();
+ ASSERT_TRUE(program.IsValid()) << program.Diagnostics();
NodeIdMap node_id_map(program);
@@ -394,7 +394,7 @@
)";
Source::File file("test.wgsl", shader);
auto program = wgsl::reader::Parse(&file);
- ASSERT_TRUE(program.IsValid()) << program.Diagnostics().str();
+ ASSERT_TRUE(program.IsValid()) << program.Diagnostics();
NodeIdMap node_id_map(program);
@@ -430,7 +430,7 @@
)";
Source::File file("test.wgsl", shader);
auto program = wgsl::reader::Parse(&file);
- ASSERT_TRUE(program.IsValid()) << program.Diagnostics().str();
+ ASSERT_TRUE(program.IsValid()) << program.Diagnostics();
NodeIdMap node_id_map(program);
@@ -461,7 +461,7 @@
)";
Source::File file("test.wgsl", shader);
auto program = wgsl::reader::Parse(&file);
- ASSERT_TRUE(program.IsValid()) << program.Diagnostics().str();
+ ASSERT_TRUE(program.IsValid()) << program.Diagnostics();
NodeIdMap node_id_map(program);
@@ -484,7 +484,7 @@
ASSERT_TRUE(MaybeApplyMutation(program, MutationReplaceIdentifier(use_id, replacement_id),
node_id_map, program, &node_id_map, nullptr));
- ASSERT_TRUE(program.IsValid()) << program.Diagnostics().str();
+ ASSERT_TRUE(program.IsValid()) << program.Diagnostics();
wgsl::writer::Options options;
auto result = wgsl::writer::Generate(program, options);
@@ -510,7 +510,7 @@
)";
Source::File file("test.wgsl", shader);
auto program = wgsl::reader::Parse(&file);
- ASSERT_TRUE(program.IsValid()) << program.Diagnostics().str();
+ ASSERT_TRUE(program.IsValid()) << program.Diagnostics();
NodeIdMap node_id_map(program);
@@ -528,7 +528,7 @@
ASSERT_TRUE(MaybeApplyMutation(program, MutationReplaceIdentifier(use_id, replacement_id),
node_id_map, program, &node_id_map, nullptr));
- ASSERT_TRUE(program.IsValid()) << program.Diagnostics().str();
+ ASSERT_TRUE(program.IsValid()) << program.Diagnostics();
wgsl::writer::Options options;
auto result = wgsl::writer::Generate(program, options);
@@ -555,7 +555,7 @@
)";
Source::File file("test.wgsl", shader);
auto program = wgsl::reader::Parse(&file);
- ASSERT_TRUE(program.IsValid()) << program.Diagnostics().str();
+ ASSERT_TRUE(program.IsValid()) << program.Diagnostics();
NodeIdMap node_id_map(program);
@@ -588,7 +588,7 @@
)";
Source::File file("test.wgsl", shader);
auto program = wgsl::reader::Parse(&file);
- ASSERT_TRUE(program.IsValid()) << program.Diagnostics().str();
+ ASSERT_TRUE(program.IsValid()) << program.Diagnostics();
NodeIdMap node_id_map(program);
@@ -623,7 +623,7 @@
)";
Source::File file("test.wgsl", shader);
auto program = wgsl::reader::Parse(&file);
- ASSERT_TRUE(program.IsValid()) << program.Diagnostics().str();
+ ASSERT_TRUE(program.IsValid()) << program.Diagnostics();
NodeIdMap node_id_map(program);
diff --git a/src/tint/fuzzers/tint_ast_fuzzer/mutations/wrap_unary_operator_test.cc b/src/tint/fuzzers/tint_ast_fuzzer/mutations/wrap_unary_operator_test.cc
index 6e8b0b1..531bb2b 100644
--- a/src/tint/fuzzers/tint_ast_fuzzer/mutations/wrap_unary_operator_test.cc
+++ b/src/tint/fuzzers/tint_ast_fuzzer/mutations/wrap_unary_operator_test.cc
@@ -38,7 +38,7 @@
)";
Source::File file("test.wgsl", content);
auto program = wgsl::reader::Parse(&file);
- ASSERT_TRUE(program.IsValid()) << program.Diagnostics().str();
+ ASSERT_TRUE(program.IsValid()) << program.Diagnostics();
NodeIdMap node_id_map(program);
@@ -52,7 +52,7 @@
program,
MutationWrapUnaryOperator(expression_id, node_id_map.TakeFreshId(), core::UnaryOp::kNot),
node_id_map, program, &node_id_map, nullptr));
- ASSERT_TRUE(program.IsValid()) << program.Diagnostics().str();
+ ASSERT_TRUE(program.IsValid()) << program.Diagnostics();
wgsl::writer::Options options;
auto result = wgsl::writer::Generate(program, options);
@@ -76,7 +76,7 @@
)";
Source::File file("test.wgsl", content);
auto program = wgsl::reader::Parse(&file);
- ASSERT_TRUE(program.IsValid()) << program.Diagnostics().str();
+ ASSERT_TRUE(program.IsValid()) << program.Diagnostics();
NodeIdMap node_id_map(program);
@@ -93,7 +93,7 @@
program,
MutationWrapUnaryOperator(expression_id, node_id_map.TakeFreshId(), core::UnaryOp::kNot),
node_id_map, program, &node_id_map, nullptr));
- ASSERT_TRUE(program.IsValid()) << program.Diagnostics().str();
+ ASSERT_TRUE(program.IsValid()) << program.Diagnostics();
wgsl::writer::Options options;
auto result = wgsl::writer::Generate(program, options);
@@ -115,7 +115,7 @@
)";
Source::File file("test.wgsl", content);
auto program = wgsl::reader::Parse(&file);
- ASSERT_TRUE(program.IsValid()) << program.Diagnostics().str();
+ ASSERT_TRUE(program.IsValid()) << program.Diagnostics();
NodeIdMap node_id_map(program);
@@ -131,7 +131,7 @@
MutationWrapUnaryOperator(expression_id, node_id_map.TakeFreshId(),
core::UnaryOp::kComplement),
node_id_map, program, &node_id_map, nullptr));
- ASSERT_TRUE(program.IsValid()) << program.Diagnostics().str();
+ ASSERT_TRUE(program.IsValid()) << program.Diagnostics();
wgsl::writer::Options options;
auto result = wgsl::writer::Generate(program, options);
@@ -154,7 +154,7 @@
)";
Source::File file("test.wgsl", content);
auto program = wgsl::reader::Parse(&file);
- ASSERT_TRUE(program.IsValid()) << program.Diagnostics().str();
+ ASSERT_TRUE(program.IsValid()) << program.Diagnostics();
NodeIdMap node_id_map(program);
@@ -173,7 +173,7 @@
MutationWrapUnaryOperator(expression_id, node_id_map.TakeFreshId(),
core::UnaryOp::kComplement),
node_id_map, program, &node_id_map, nullptr));
- ASSERT_TRUE(program.IsValid()) << program.Diagnostics().str();
+ ASSERT_TRUE(program.IsValid()) << program.Diagnostics();
wgsl::writer::Options options;
auto result = wgsl::writer::Generate(program, options);
@@ -195,7 +195,7 @@
)";
Source::File file("test.wgsl", content);
auto program = wgsl::reader::Parse(&file);
- ASSERT_TRUE(program.IsValid()) << program.Diagnostics().str();
+ ASSERT_TRUE(program.IsValid()) << program.Diagnostics();
NodeIdMap node_id_map(program);
@@ -214,7 +214,7 @@
MutationWrapUnaryOperator(expression_id, node_id_map.TakeFreshId(),
core::UnaryOp::kNegation),
node_id_map, program, &node_id_map, nullptr));
- ASSERT_TRUE(program.IsValid()) << program.Diagnostics().str();
+ ASSERT_TRUE(program.IsValid()) << program.Diagnostics();
wgsl::writer::Options options;
auto result = wgsl::writer::Generate(program, options);
@@ -235,7 +235,7 @@
)";
Source::File file("test.wgsl", content);
auto program = wgsl::reader::Parse(&file);
- ASSERT_TRUE(program.IsValid()) << program.Diagnostics().str();
+ ASSERT_TRUE(program.IsValid()) << program.Diagnostics();
NodeIdMap node_id_map(program);
@@ -253,7 +253,7 @@
MutationWrapUnaryOperator(expression_id, node_id_map.TakeFreshId(),
core::UnaryOp::kNegation),
node_id_map, program, &node_id_map, nullptr));
- ASSERT_TRUE(program.IsValid()) << program.Diagnostics().str();
+ ASSERT_TRUE(program.IsValid()) << program.Diagnostics();
wgsl::writer::Options options;
auto result = wgsl::writer::Generate(program, options);
@@ -277,7 +277,7 @@
)";
Source::File file("test.wgsl", content);
auto program = wgsl::reader::Parse(&file);
- ASSERT_TRUE(program.IsValid()) << program.Diagnostics().str();
+ ASSERT_TRUE(program.IsValid()) << program.Diagnostics();
NodeIdMap node_id_map(program);
@@ -296,7 +296,7 @@
MutationWrapUnaryOperator(expression_id, node_id_map.TakeFreshId(),
core::UnaryOp::kNegation),
node_id_map, program, &node_id_map, nullptr));
- ASSERT_TRUE(program.IsValid()) << program.Diagnostics().str();
+ ASSERT_TRUE(program.IsValid()) << program.Diagnostics();
wgsl::writer::Options options;
auto result = wgsl::writer::Generate(program, options);
@@ -320,7 +320,7 @@
)";
Source::File file("test.wgsl", content);
auto program = wgsl::reader::Parse(&file);
- ASSERT_TRUE(program.IsValid()) << program.Diagnostics().str();
+ ASSERT_TRUE(program.IsValid()) << program.Diagnostics();
NodeIdMap node_id_map(program);
@@ -338,7 +338,7 @@
MutationWrapUnaryOperator(expression_id, node_id_map.TakeFreshId(),
core::UnaryOp::kComplement),
node_id_map, program, &node_id_map, nullptr));
- ASSERT_TRUE(program.IsValid()) << program.Diagnostics().str();
+ ASSERT_TRUE(program.IsValid()) << program.Diagnostics();
wgsl::writer::Options options;
auto result = wgsl::writer::Generate(program, options);
@@ -359,7 +359,7 @@
)";
Source::File file("test.wgsl", content);
auto program = wgsl::reader::Parse(&file);
- ASSERT_TRUE(program.IsValid()) << program.Diagnostics().str();
+ ASSERT_TRUE(program.IsValid()) << program.Diagnostics();
NodeIdMap node_id_map(program);
@@ -388,7 +388,7 @@
)";
Source::File file("test.wgsl", content);
auto program = wgsl::reader::Parse(&file);
- ASSERT_TRUE(program.IsValid()) << program.Diagnostics().str();
+ ASSERT_TRUE(program.IsValid()) << program.Diagnostics();
NodeIdMap node_id_map(program);
@@ -416,7 +416,7 @@
)";
Source::File file("test.wgsl", content);
auto program = wgsl::reader::Parse(&file);
- ASSERT_TRUE(program.IsValid()) << program.Diagnostics().str();
+ ASSERT_TRUE(program.IsValid()) << program.Diagnostics();
NodeIdMap node_id_map(program);
@@ -445,7 +445,7 @@
)";
Source::File file("test.wgsl", content);
auto program = wgsl::reader::Parse(&file);
- ASSERT_TRUE(program.IsValid()) << program.Diagnostics().str();
+ ASSERT_TRUE(program.IsValid()) << program.Diagnostics();
NodeIdMap node_id_map(program);
@@ -474,7 +474,7 @@
)";
Source::File file("test.wgsl", content);
auto program = wgsl::reader::Parse(&file);
- ASSERT_TRUE(program.IsValid()) << program.Diagnostics().str();
+ ASSERT_TRUE(program.IsValid()) << program.Diagnostics();
NodeIdMap node_id_map(program);
@@ -501,7 +501,7 @@
)";
Source::File file("test.wgsl", content);
auto program = wgsl::reader::Parse(&file);
- ASSERT_TRUE(program.IsValid()) << program.Diagnostics().str();
+ ASSERT_TRUE(program.IsValid()) << program.Diagnostics();
NodeIdMap node_id_map(program);
@@ -531,7 +531,7 @@
)";
Source::File file("test.wgsl", content);
auto program = wgsl::reader::Parse(&file);
- ASSERT_TRUE(program.IsValid()) << program.Diagnostics().str();
+ ASSERT_TRUE(program.IsValid()) << program.Diagnostics();
NodeIdMap node_id_map(program);
diff --git a/src/tint/lang/core/intrinsic/table_test.cc b/src/tint/lang/core/intrinsic/table_test.cc
index 7b90ec7..88d36f3 100644
--- a/src/tint/lang/core/intrinsic/table_test.cc
+++ b/src/tint/lang/core/intrinsic/table_test.cc
@@ -57,7 +57,7 @@
auto* f32 = create<core::type::F32>();
auto result =
Lookup(context, core::BuiltinFn::kCos, Vector{f32}, EvaluationStage::kConstant, Source{});
- ASSERT_TRUE(result) << Diagnostics().str();
+ ASSERT_TRUE(result) << Diagnostics();
ASSERT_EQ(Diagnostics().str(), "");
EXPECT_EQ(result->return_type, f32);
ASSERT_EQ(result->parameters.Length(), 1u);
@@ -78,7 +78,7 @@
auto* vec2_f32 = create<core::type::Vector>(f32, 2u);
auto result = Lookup(context, core::BuiltinFn::kUnpack2X16Float, Vector{u32},
EvaluationStage::kConstant, Source{});
- ASSERT_TRUE(result) << Diagnostics().str();
+ ASSERT_TRUE(result) << Diagnostics();
ASSERT_EQ(Diagnostics().str(), "");
EXPECT_EQ(result->return_type, vec2_f32);
ASSERT_EQ(result->parameters.Length(), 1u);
@@ -100,7 +100,7 @@
auto* tex = create<core::type::SampledTexture>(core::type::TextureDimension::k1d, f32);
auto result = Lookup(context, core::BuiltinFn::kTextureLoad, Vector{tex, i32, i32},
EvaluationStage::kConstant, Source{});
- ASSERT_TRUE(result) << Diagnostics().str();
+ ASSERT_TRUE(result) << Diagnostics();
ASSERT_EQ(Diagnostics().str(), "");
EXPECT_EQ(result->return_type, vec4_f32);
ASSERT_EQ(result->parameters.Length(), 3u);
@@ -125,7 +125,7 @@
auto* i32 = create<core::type::I32>();
auto result = Lookup(context, core::BuiltinFn::kCountOneBits, Vector{i32},
EvaluationStage::kConstant, Source{});
- ASSERT_TRUE(result) << Diagnostics().str();
+ ASSERT_TRUE(result) << Diagnostics();
ASSERT_EQ(Diagnostics().str(), "");
EXPECT_EQ(result->return_type, i32);
ASSERT_EQ(result->parameters.Length(), 1u);
@@ -136,7 +136,7 @@
auto* u32 = create<core::type::U32>();
auto result = Lookup(context, core::BuiltinFn::kCountOneBits, Vector{u32},
EvaluationStage::kConstant, Source{});
- ASSERT_TRUE(result) << Diagnostics().str();
+ ASSERT_TRUE(result) << Diagnostics();
ASSERT_EQ(Diagnostics().str(), "");
EXPECT_EQ(result->return_type, u32);
ASSERT_EQ(result->parameters.Length(), 1u);
@@ -155,7 +155,7 @@
auto* i32 = create<core::type::I32>();
auto result = Lookup(context, core::BuiltinFn::kClamp, Vector{i32, i32, i32},
EvaluationStage::kConstant, Source{});
- ASSERT_TRUE(result) << Diagnostics().str();
+ ASSERT_TRUE(result) << Diagnostics();
ASSERT_EQ(Diagnostics().str(), "");
EXPECT_EQ(result->return_type, i32);
ASSERT_EQ(result->parameters.Length(), 3u);
@@ -168,7 +168,7 @@
auto* u32 = create<core::type::U32>();
auto result = Lookup(context, core::BuiltinFn::kClamp, Vector{u32, u32, u32},
EvaluationStage::kConstant, Source{});
- ASSERT_TRUE(result) << Diagnostics().str();
+ ASSERT_TRUE(result) << Diagnostics();
ASSERT_EQ(Diagnostics().str(), "");
EXPECT_EQ(result->return_type, u32);
ASSERT_EQ(result->parameters.Length(), 3u);
@@ -181,7 +181,7 @@
auto* f32 = create<core::type::F32>();
auto result = Lookup(context, core::BuiltinFn::kClamp, Vector{f32, f32, f32},
EvaluationStage::kConstant, Source{});
- ASSERT_TRUE(result) << Diagnostics().str();
+ ASSERT_TRUE(result) << Diagnostics();
ASSERT_EQ(Diagnostics().str(), "");
EXPECT_EQ(result->return_type, f32);
ASSERT_EQ(result->parameters.Length(), 3u);
@@ -203,7 +203,7 @@
auto* bool_ = create<core::type::Bool>();
auto result = Lookup(context, core::BuiltinFn::kSelect, Vector{f32, f32, bool_},
EvaluationStage::kConstant, Source{});
- ASSERT_TRUE(result) << Diagnostics().str();
+ ASSERT_TRUE(result) << Diagnostics();
ASSERT_EQ(Diagnostics().str(), "");
EXPECT_EQ(result->return_type, f32);
ASSERT_EQ(result->parameters.Length(), 3u);
@@ -227,7 +227,7 @@
core::Access::kReadWrite);
auto result = Lookup(context, core::BuiltinFn::kAtomicLoad, Vector{ptr},
EvaluationStage::kConstant, Source{});
- ASSERT_TRUE(result) << Diagnostics().str();
+ ASSERT_TRUE(result) << Diagnostics();
ASSERT_EQ(Diagnostics().str(), "");
EXPECT_EQ(result->return_type, i32);
ASSERT_EQ(result->parameters.Length(), 1u);
@@ -250,7 +250,7 @@
create<core::type::Pointer>(core::AddressSpace::kStorage, arr, core::Access::kReadWrite);
auto result = Lookup(context, core::BuiltinFn::kArrayLength, Vector{arr_ptr},
EvaluationStage::kConstant, Source{});
- ASSERT_TRUE(result) << Diagnostics().str();
+ ASSERT_TRUE(result) << Diagnostics();
ASSERT_EQ(Diagnostics().str(), "");
EXPECT_TRUE(result->return_type->Is<core::type::U32>());
ASSERT_EQ(result->parameters.Length(), 1u);
@@ -275,7 +275,7 @@
auto* sampler = create<core::type::Sampler>(core::type::SamplerKind::kSampler);
auto result = Lookup(context, core::BuiltinFn::kTextureSample, Vector{tex, sampler, vec2_f32},
EvaluationStage::kConstant, Source{});
- ASSERT_TRUE(result) << Diagnostics().str();
+ ASSERT_TRUE(result) << Diagnostics();
ASSERT_EQ(Diagnostics().str(), "");
EXPECT_EQ(result->return_type, vec4_f32);
ASSERT_EQ(result->parameters.Length(), 3u);
@@ -305,7 +305,7 @@
auto* tex = create<core::type::SampledTexture>(core::type::TextureDimension::k2d, f32);
auto result = Lookup(context, core::BuiltinFn::kTextureLoad, Vector{tex, vec2_i32, i32},
EvaluationStage::kConstant, Source{});
- ASSERT_TRUE(result) << Diagnostics().str();
+ ASSERT_TRUE(result) << Diagnostics();
ASSERT_EQ(Diagnostics().str(), "");
EXPECT_EQ(result->return_type, vec4_f32);
ASSERT_EQ(result->parameters.Length(), 3u);
@@ -325,7 +325,7 @@
auto* tex = create<core::type::MultisampledTexture>(core::type::TextureDimension::k2d, f32);
auto result = Lookup(context, core::BuiltinFn::kTextureLoad, Vector{tex, vec2_i32, i32},
EvaluationStage::kConstant, Source{});
- ASSERT_TRUE(result) << Diagnostics().str();
+ ASSERT_TRUE(result) << Diagnostics();
ASSERT_EQ(Diagnostics().str(), "");
EXPECT_EQ(result->return_type, vec4_f32);
ASSERT_EQ(result->parameters.Length(), 3u);
@@ -344,7 +344,7 @@
auto* tex = create<core::type::DepthTexture>(core::type::TextureDimension::k2d);
auto result = Lookup(context, core::BuiltinFn::kTextureLoad, Vector{tex, vec2_i32, i32},
EvaluationStage::kConstant, Source{});
- ASSERT_TRUE(result) << Diagnostics().str();
+ ASSERT_TRUE(result) << Diagnostics();
ASSERT_EQ(Diagnostics().str(), "");
EXPECT_EQ(result->return_type, f32);
ASSERT_EQ(result->parameters.Length(), 3u);
@@ -363,7 +363,7 @@
auto* tex = create<core::type::DepthMultisampledTexture>(core::type::TextureDimension::k2d);
auto result = Lookup(context, core::BuiltinFn::kTextureLoad, Vector{tex, vec2_i32, i32},
EvaluationStage::kConstant, Source{});
- ASSERT_TRUE(result) << Diagnostics().str();
+ ASSERT_TRUE(result) << Diagnostics();
ASSERT_EQ(Diagnostics().str(), "");
EXPECT_EQ(result->return_type, f32);
ASSERT_EQ(result->parameters.Length(), 3u);
@@ -383,7 +383,7 @@
auto* tex = create<core::type::ExternalTexture>();
auto result = Lookup(context, core::BuiltinFn::kTextureLoad, Vector{tex, vec2_i32},
EvaluationStage::kConstant, Source{});
- ASSERT_TRUE(result) << Diagnostics().str();
+ ASSERT_TRUE(result) << Diagnostics();
ASSERT_EQ(Diagnostics().str(), "");
EXPECT_EQ(result->return_type, vec4_f32);
ASSERT_EQ(result->parameters.Length(), 2u);
@@ -405,7 +405,7 @@
auto result = Lookup(context, core::BuiltinFn::kTextureStore, Vector{tex, vec2_i32, vec4_f32},
EvaluationStage::kConstant, Source{});
- ASSERT_TRUE(result) << Diagnostics().str();
+ ASSERT_TRUE(result) << Diagnostics();
ASSERT_EQ(Diagnostics().str(), "");
EXPECT_TRUE(result->return_type->Is<type::Void>());
ASSERT_EQ(result->parameters.Length(), 3u);
@@ -435,7 +435,7 @@
core::Access::kReadWrite),
},
EvaluationStage::kConstant, Source{});
- ASSERT_TRUE(result) << Diagnostics().str();
+ ASSERT_TRUE(result) << Diagnostics();
ASSERT_EQ(Diagnostics().str(), "");
EXPECT_EQ(result->return_type, f32);
ASSERT_EQ(result->parameters.Length(), 1u);
@@ -446,7 +446,7 @@
auto* f32 = create<core::type::F32>();
auto result = Lookup(context, core::BuiltinFn::kClamp, Vector{f32, f32, f32},
EvaluationStage::kConstant, Source{});
- ASSERT_TRUE(result) << Diagnostics().str();
+ ASSERT_TRUE(result) << Diagnostics();
ASSERT_EQ(Diagnostics().str(), "");
EXPECT_EQ(result->return_type, f32);
EXPECT_EQ(result->parameters[0].type, f32);
@@ -468,7 +468,7 @@
auto* vec2_f32 = create<core::type::Vector>(f32, 2u);
auto result = Lookup(context, core::BuiltinFn::kClamp, Vector{vec2_f32, vec2_f32, vec2_f32},
EvaluationStage::kConstant, Source{});
- ASSERT_TRUE(result) << Diagnostics().str();
+ ASSERT_TRUE(result) << Diagnostics();
ASSERT_EQ(Diagnostics().str(), "");
EXPECT_EQ(result->return_type, vec2_f32);
ASSERT_EQ(result->parameters.Length(), 3u);
@@ -493,7 +493,7 @@
auto* mat3_f32 = create<core::type::Matrix>(vec3_f32, 3u);
auto result = Lookup(context, core::BuiltinFn::kDeterminant, Vector{mat3_f32},
EvaluationStage::kConstant, Source{});
- ASSERT_TRUE(result) << Diagnostics().str();
+ ASSERT_TRUE(result) << Diagnostics();
ASSERT_EQ(Diagnostics().str(), "");
EXPECT_EQ(result->return_type, f32);
ASSERT_EQ(result->parameters.Length(), 1u);
@@ -515,7 +515,7 @@
auto* bool_ = create<core::type::Bool>();
auto result = Lookup(context, core::BuiltinFn::kSelect, Vector{af, af, bool_},
EvaluationStage::kConstant, Source{});
- ASSERT_TRUE(result) << Diagnostics().str();
+ ASSERT_TRUE(result) << Diagnostics();
ASSERT_EQ(Diagnostics().str(), "");
EXPECT_NE(result->const_eval_fn, nullptr);
EXPECT_EQ(result->return_type, af);
@@ -531,7 +531,7 @@
core::AddressSpace::kFunction, create<core::type::Bool>(), core::Access::kReadWrite);
auto result = Lookup(context, core::BuiltinFn::kSelect, Vector{af, af, bool_ref},
EvaluationStage::kRuntime, Source{});
- ASSERT_TRUE(result) << Diagnostics().str();
+ ASSERT_TRUE(result) << Diagnostics();
ASSERT_EQ(Diagnostics().str(), "");
EXPECT_NE(result->const_eval_fn, nullptr);
EXPECT_TRUE(result->return_type->Is<core::type::F32>());
@@ -546,8 +546,8 @@
auto* u32 = create<core::type::U32>();
auto result = Lookup(context, core::BinaryOp::kShiftLeft, ai, u32, EvaluationStage::kConstant,
Source{}, false);
- ASSERT_TRUE(result) << Diagnostics().str();
- ASSERT_NE(result->const_eval_fn, nullptr) << Diagnostics().str();
+ ASSERT_TRUE(result) << Diagnostics();
+ ASSERT_NE(result->const_eval_fn, nullptr) << Diagnostics();
ASSERT_EQ(Diagnostics().str(), "");
EXPECT_EQ(result->return_type, ai);
EXPECT_EQ(result->parameters[0].type, ai);
@@ -559,8 +559,8 @@
auto* u32 = create<core::type::U32>();
auto result = Lookup(context, core::BinaryOp::kShiftLeft, ai, u32, EvaluationStage::kRuntime,
Source{}, false);
- ASSERT_TRUE(result) << Diagnostics().str();
- ASSERT_NE(result->const_eval_fn, nullptr) << Diagnostics().str();
+ ASSERT_TRUE(result) << Diagnostics();
+ ASSERT_NE(result->const_eval_fn, nullptr) << Diagnostics();
ASSERT_EQ(Diagnostics().str(), "");
EXPECT_TRUE(result->return_type->Is<core::type::I32>());
EXPECT_TRUE(result->parameters[0].type->Is<core::type::I32>());
@@ -760,7 +760,7 @@
auto* vec3_i32 = create<core::type::Vector>(i32, 3u);
auto result = Lookup(context, CtorConv::kVec3, nullptr, Vector{i32, i32, i32},
EvaluationStage::kConstant, Source{{12, 34}});
- ASSERT_TRUE(result) << Diagnostics().str();
+ ASSERT_TRUE(result) << Diagnostics();
EXPECT_EQ(result->return_type, vec3_i32);
EXPECT_TRUE(result->info->flags.Contains(OverloadFlag::kIsConstructor));
ASSERT_EQ(result->parameters.Length(), 3u);
@@ -775,7 +775,7 @@
auto* vec3_i32 = create<core::type::Vector>(i32, 3u);
auto result = Lookup(context, CtorConv::kVec3, i32, Vector{i32, i32, i32},
EvaluationStage::kConstant, Source{{12, 34}});
- ASSERT_TRUE(result) << Diagnostics().str();
+ ASSERT_TRUE(result) << Diagnostics();
EXPECT_EQ(result->return_type, vec3_i32);
EXPECT_TRUE(result->info->flags.Contains(OverloadFlag::kIsConstructor));
ASSERT_EQ(result->parameters.Length(), 3u);
@@ -844,7 +844,7 @@
auto* vec3_ai = create<core::type::Vector>(ai, 3u);
auto result = Lookup(context, CtorConv::kVec3, nullptr, Vector{vec3_ai},
EvaluationStage::kConstant, Source{{12, 34}});
- ASSERT_TRUE(result) << Diagnostics().str();
+ ASSERT_TRUE(result) << Diagnostics();
EXPECT_EQ(result->return_type, vec3_ai);
EXPECT_TRUE(result->info->flags.Contains(OverloadFlag::kIsConstructor));
ASSERT_EQ(result->parameters.Length(), 1u);
@@ -859,7 +859,7 @@
auto* mat2x2_af = create<core::type::Matrix>(vec2_af, 2u);
auto result = Lookup(context, CtorConv::kMat2x2, nullptr, Vector{vec2_ai, vec2_ai},
EvaluationStage::kConstant, Source{{12, 34}});
- ASSERT_TRUE(result) << Diagnostics().str();
+ ASSERT_TRUE(result) << Diagnostics();
EXPECT_TYPE(result->return_type, mat2x2_af);
EXPECT_TRUE(result->info->flags.Contains(OverloadFlag::kIsConstructor));
ASSERT_EQ(result->parameters.Length(), 2u);
@@ -873,7 +873,7 @@
auto* vec3_ai = create<core::type::Vector>(ai, 3u);
auto result = Lookup(context, CtorConv::kVec3, nullptr, Vector{ai, ai, ai},
EvaluationStage::kConstant, Source{{12, 34}});
- ASSERT_TRUE(result) << Diagnostics().str();
+ ASSERT_TRUE(result) << Diagnostics();
EXPECT_NE(result->const_eval_fn, nullptr);
EXPECT_EQ(result->return_type, vec3_ai);
EXPECT_TRUE(result->info->flags.Contains(OverloadFlag::kIsConstructor));
@@ -890,7 +890,7 @@
EvaluationStage::kRuntime, Source{{12, 34}});
auto* i32 = create<type::I32>();
auto* vec3_i32 = create<type::Vector>(i32, 3u);
- ASSERT_TRUE(result) << Diagnostics().str();
+ ASSERT_TRUE(result) << Diagnostics();
EXPECT_NE(result->const_eval_fn, nullptr);
EXPECT_EQ(result->return_type, vec3_i32);
EXPECT_TRUE(result->info->flags.Contains(OverloadFlag::kIsConstructor));
@@ -908,7 +908,7 @@
auto* vec3_f32 = create<core::type::Vector>(f32, 3u);
auto result = Lookup(context, CtorConv::kVec3, i32, Vector{vec3_f32},
EvaluationStage::kConstant, Source{{12, 34}});
- ASSERT_TRUE(result) << Diagnostics().str();
+ ASSERT_TRUE(result) << Diagnostics();
EXPECT_EQ(result->return_type, vec3_i32);
EXPECT_FALSE(result->info->flags.Contains(OverloadFlag::kIsConstructor));
ASSERT_EQ(result->parameters.Length(), 1u);
@@ -951,7 +951,7 @@
auto* vec3_f32 = create<core::type::Vector>(f32, 3u);
auto result = Lookup(context, CtorConv::kVec3, af, Vector{vec3_ai}, EvaluationStage::kConstant,
Source{{12, 34}});
- ASSERT_TRUE(result) << Diagnostics().str();
+ ASSERT_TRUE(result) << Diagnostics();
EXPECT_NE(result->const_eval_fn, nullptr);
// NOTE: Conversions are explicit, so there's no way to have it return abstracts
EXPECT_EQ(result->return_type, vec3_f32);
@@ -968,7 +968,7 @@
auto* vec3_i32 = create<core::type::Vector>(create<core::type::I32>(), 3u);
auto result = Lookup(context, CtorConv::kVec3, af, Vector{vec3_ai}, EvaluationStage::kRuntime,
Source{{12, 34}});
- ASSERT_TRUE(result) << Diagnostics().str();
+ ASSERT_TRUE(result) << Diagnostics();
EXPECT_NE(result->const_eval_fn, nullptr);
EXPECT_EQ(result->return_type, vec3_f32);
EXPECT_FALSE(result->info->flags.Contains(OverloadFlag::kIsConstructor));
@@ -995,7 +995,7 @@
auto* i32 = create<core::type::I32>();
auto result =
Lookup(context, CtorConv::kI32, nullptr, Vector{ai}, EvaluationStage::kConstant, Source{});
- ASSERT_TRUE(result) << Diagnostics().str();
+ ASSERT_TRUE(result) << Diagnostics();
EXPECT_EQ(result->return_type, i32);
EXPECT_EQ(result->parameters.Length(), 1u);
EXPECT_EQ(result->parameters[0].type, ai);
@@ -1042,7 +1042,7 @@
bool matched = result;
bool expected_match = GetParam().expected_match;
- EXPECT_EQ(matched, expected_match) << Diagnostics().str();
+ EXPECT_EQ(matched, expected_match) << Diagnostics();
if (matched) {
auto* expected_result = GetParam().expected_result(*this);
@@ -1225,7 +1225,7 @@
EvaluationStage::kConstant, Source{{12, 34}});
bool expected_match = GetParam().expected_match;
- EXPECT_EQ(builtin == true, expected_match) << Diagnostics().str();
+ EXPECT_EQ(builtin == true, expected_match) << Diagnostics();
auto* result = builtin ? builtin->return_type : nullptr;
auto* expected_result = GetParam().expected_result(*this);
diff --git a/src/tint/lang/core/type/helper_test.h b/src/tint/lang/core/type/helper_test.h
index 8731f61..5babb08 100644
--- a/src/tint/lang/core/type/helper_test.h
+++ b/src/tint/lang/core/type/helper_test.h
@@ -31,7 +31,7 @@
/// @return the built program
Program Build() {
if (!IsValid()) {
- ADD_FAILURE() << "ProgramBuilder is not valid: " << Diagnostics().str();
+ ADD_FAILURE() << "ProgramBuilder is not valid: " << Diagnostics();
}
return resolver::Resolve(*this);
}
diff --git a/src/tint/lang/core/type/storage_texture_test.cc b/src/tint/lang/core/type/storage_texture_test.cc
index 45f7776..c362090 100644
--- a/src/tint/lang/core/type/storage_texture_test.cc
+++ b/src/tint/lang/core/type/storage_texture_test.cc
@@ -101,7 +101,7 @@
auto program = Build();
- ASSERT_TRUE(program.IsValid()) << program.Diagnostics().str();
+ ASSERT_TRUE(program.IsValid()) << program.Diagnostics();
ASSERT_TRUE(s->Is<Texture>());
ASSERT_TRUE(s->Is<StorageTexture>());
EXPECT_TRUE(s->As<StorageTexture>()->type()->Is<F32>());
@@ -114,7 +114,7 @@
auto program = Build();
- ASSERT_TRUE(program.IsValid()) << program.Diagnostics().str();
+ ASSERT_TRUE(program.IsValid()) << program.Diagnostics();
ASSERT_TRUE(s->Is<Texture>());
ASSERT_TRUE(s->Is<StorageTexture>());
EXPECT_TRUE(s->As<StorageTexture>()->type()->Is<U32>());
@@ -127,7 +127,7 @@
auto program = Build();
- ASSERT_TRUE(program.IsValid()) << program.Diagnostics().str();
+ ASSERT_TRUE(program.IsValid()) << program.Diagnostics();
ASSERT_TRUE(s->Is<Texture>());
ASSERT_TRUE(s->Is<StorageTexture>());
EXPECT_TRUE(s->As<StorageTexture>()->type()->Is<I32>());
diff --git a/src/tint/lang/core/type/struct_test.cc b/src/tint/lang/core/type/struct_test.cc
index 6a78e2a..ebb2209 100644
--- a/src/tint/lang/core/type/struct_test.cc
+++ b/src/tint/lang/core/type/struct_test.cc
@@ -65,7 +65,7 @@
});
auto p = Build();
- ASSERT_TRUE(p.IsValid()) << p.Diagnostics().str();
+ ASSERT_TRUE(p.IsValid()) << p.Diagnostics();
auto* sem_inner_st = p.Sem().Get(inner_st);
auto* sem_outer_st = p.Sem().Get(outer_st);
@@ -96,7 +96,7 @@
});
auto p = Build();
- ASSERT_TRUE(p.IsValid()) << p.Diagnostics().str();
+ ASSERT_TRUE(p.IsValid()) << p.Diagnostics();
auto* sem = p.Sem().Get(st);
ASSERT_EQ(2u, sem->Members().Length());
@@ -127,7 +127,7 @@
Member("runtime_sized_array", ty.array<i32>()),
});
auto p = Build();
- ASSERT_TRUE(p.IsValid()) << p.Diagnostics().str();
+ ASSERT_TRUE(p.IsValid()) << p.Diagnostics();
auto* sem_inner = p.Sem().Get(inner);
auto* sem_outer = p.Sem().Get(outer);
@@ -160,7 +160,7 @@
});
auto p = Build();
- ASSERT_TRUE(p.IsValid()) << p.Diagnostics().str();
+ ASSERT_TRUE(p.IsValid()) << p.Diagnostics();
auto* sem_inner = p.Sem().Get(inner);
auto* sem_outer = p.Sem().Get(outer);
@@ -193,7 +193,7 @@
});
auto p = Build();
- ASSERT_TRUE(p.IsValid()) << p.Diagnostics().str();
+ ASSERT_TRUE(p.IsValid()) << p.Diagnostics();
auto* sem_inner = p.Sem().Get(inner);
auto* sem_outer = p.Sem().Get(outer);
diff --git a/src/tint/lang/glsl/writer/ast_printer/helper_test.h b/src/tint/lang/glsl/writer/ast_printer/helper_test.h
index c245c0b..5c5e018 100644
--- a/src/tint/lang/glsl/writer/ast_printer/helper_test.h
+++ b/src/tint/lang/glsl/writer/ast_printer/helper_test.h
@@ -53,11 +53,11 @@
return *gen_;
}
if (!IsValid()) {
- ADD_FAILURE() << "ProgramBuilder is not valid: " << Diagnostics().str();
+ ADD_FAILURE() << "ProgramBuilder is not valid: " << Diagnostics();
}
program = std::make_unique<Program>(resolver::Resolve(*this));
if (!program->IsValid()) {
- ADD_FAILURE() << program->Diagnostics().str();
+ ADD_FAILURE() << program->Diagnostics();
}
gen_ = std::make_unique<ASTPrinter>(*program, version);
return *gen_;
@@ -76,16 +76,16 @@
return *gen_;
}
if (!IsValid()) {
- ADD_FAILURE() << "ProgramBuilder is not valid: " << Diagnostics().str();
+ ADD_FAILURE() << "ProgramBuilder is not valid: " << Diagnostics();
}
program = std::make_unique<Program>(resolver::Resolve(*this));
if (!program->IsValid()) {
- ADD_FAILURE() << program->Diagnostics().str();
+ ADD_FAILURE() << program->Diagnostics();
}
auto sanitized_result = Sanitize(*program, options, /* entry_point */ "");
if (!sanitized_result.program.IsValid()) {
- ADD_FAILURE() << sanitized_result.program.Diagnostics().str();
+ ADD_FAILURE() << sanitized_result.program.Diagnostics();
}
*program = std::move(sanitized_result.program);
diff --git a/src/tint/lang/hlsl/writer/ast_printer/helper_test.h b/src/tint/lang/hlsl/writer/ast_printer/helper_test.h
index a503ec7..18de924 100644
--- a/src/tint/lang/hlsl/writer/ast_printer/helper_test.h
+++ b/src/tint/lang/hlsl/writer/ast_printer/helper_test.h
@@ -52,11 +52,11 @@
return *gen_;
}
if (!IsValid()) {
- ADD_FAILURE() << "ProgramBuilder is not valid: " << Diagnostics().str();
+ ADD_FAILURE() << "ProgramBuilder is not valid: " << Diagnostics();
}
program = std::make_unique<Program>(resolver::Resolve(*this));
if (!program->IsValid()) {
- ADD_FAILURE() << program->Diagnostics().str();
+ ADD_FAILURE() << program->Diagnostics();
}
gen_ = std::make_unique<ASTPrinter>(*program);
return *gen_;
@@ -73,16 +73,16 @@
return *gen_;
}
if (!IsValid()) {
- ADD_FAILURE() << "ProgramBuilder is not valid: " << Diagnostics().str();
+ ADD_FAILURE() << "ProgramBuilder is not valid: " << Diagnostics();
}
program = std::make_unique<Program>(resolver::Resolve(*this));
if (!program->IsValid()) {
- ADD_FAILURE() << program->Diagnostics().str();
+ ADD_FAILURE() << program->Diagnostics();
}
auto sanitized_result = Sanitize(*program, options);
if (!sanitized_result.program.IsValid()) {
- ADD_FAILURE() << sanitized_result.program.Diagnostics().str();
+ ADD_FAILURE() << sanitized_result.program.Diagnostics();
}
ast::transform::Manager transform_manager;
@@ -94,7 +94,7 @@
transform_manager.Add<tint::ast::transform::Renamer>();
auto result = transform_manager.Run(sanitized_result.program, transform_data, outputs);
if (!result.IsValid()) {
- ADD_FAILURE() << result.Diagnostics().str();
+ ADD_FAILURE() << result.Diagnostics();
}
*program = std::move(result);
gen_ = std::make_unique<ASTPrinter>(*program);
diff --git a/src/tint/lang/msl/writer/ast_printer/helper_test.h b/src/tint/lang/msl/writer/ast_printer/helper_test.h
index 27bb279..c8b1167 100644
--- a/src/tint/lang/msl/writer/ast_printer/helper_test.h
+++ b/src/tint/lang/msl/writer/ast_printer/helper_test.h
@@ -50,11 +50,11 @@
return *gen_;
}
if (!IsValid()) {
- ADD_FAILURE() << "ProgramBuilder is not valid: " << Diagnostics().str();
+ ADD_FAILURE() << "ProgramBuilder is not valid: " << Diagnostics();
}
program = std::make_unique<Program>(resolver::Resolve(*this));
if (!program->IsValid()) {
- ADD_FAILURE() << program->Diagnostics().str();
+ ADD_FAILURE() << program->Diagnostics();
}
gen_ = std::make_unique<ASTPrinter>(*program);
return *gen_;
@@ -71,16 +71,16 @@
return *gen_;
}
if (!IsValid()) {
- ADD_FAILURE() << "ProgramBuilder is not valid: " << Diagnostics().str();
+ ADD_FAILURE() << "ProgramBuilder is not valid: " << Diagnostics();
}
program = std::make_unique<Program>(resolver::Resolve(*this));
if (!program->IsValid()) {
- ADD_FAILURE() << program->Diagnostics().str();
+ ADD_FAILURE() << program->Diagnostics();
}
auto result = Sanitize(*program, options);
if (!result.program.IsValid()) {
- ADD_FAILURE() << result.program.Diagnostics().str();
+ ADD_FAILURE() << result.program.Diagnostics();
}
*program = std::move(result.program);
gen_ = std::make_unique<ASTPrinter>(*program);
diff --git a/src/tint/lang/spirv/reader/ast_parser/barrier_test.cc b/src/tint/lang/spirv/reader/ast_parser/barrier_test.cc
index ff4191c..502d2ba 100644
--- a/src/tint/lang/spirv/reader/ast_parser/barrier_test.cc
+++ b/src/tint/lang/spirv/reader/ast_parser/barrier_test.cc
@@ -62,7 +62,7 @@
OpReturn
OpFunctionEnd
)");
- ASSERT_TRUE(program.IsValid()) << program.Diagnostics().str();
+ ASSERT_TRUE(program.IsValid()) << program.Diagnostics();
auto* helper = program.AST().Functions().Find(program.Symbols().Get("helper"));
ASSERT_NE(helper, nullptr);
ASSERT_GT(helper->body->statements.Length(), 0u);
@@ -95,7 +95,7 @@
OpReturn
OpFunctionEnd
)");
- ASSERT_TRUE(program.IsValid()) << program.Diagnostics().str();
+ ASSERT_TRUE(program.IsValid()) << program.Diagnostics();
auto* helper = program.AST().Functions().Find(program.Symbols().Get("helper"));
ASSERT_NE(helper, nullptr);
ASSERT_GT(helper->body->statements.Length(), 0u);
@@ -128,7 +128,7 @@
OpReturn
OpFunctionEnd
)");
- ASSERT_TRUE(program.IsValid()) << program.Diagnostics().str();
+ ASSERT_TRUE(program.IsValid()) << program.Diagnostics();
auto* helper = program.AST().Functions().Find(program.Symbols().Get("helper"));
ASSERT_NE(helper, nullptr);
ASSERT_GT(helper->body->statements.Length(), 0u);
@@ -162,7 +162,7 @@
OpReturn
OpFunctionEnd
)");
- ASSERT_TRUE(program.IsValid()) << program.Diagnostics().str();
+ ASSERT_TRUE(program.IsValid()) << program.Diagnostics();
auto* helper = program.AST().Functions().Find(program.Symbols().Get("helper"));
ASSERT_NE(helper, nullptr);
ASSERT_GT(helper->body->statements.Length(), 2u);
diff --git a/src/tint/lang/spirv/writer/ast_printer/helper_test.h b/src/tint/lang/spirv/writer/ast_printer/helper_test.h
index 4e7945ce..28ac79b 100644
--- a/src/tint/lang/spirv/writer/ast_printer/helper_test.h
+++ b/src/tint/lang/spirv/writer/ast_printer/helper_test.h
@@ -54,11 +54,11 @@
return *spirv_builder;
}
if (!IsValid()) {
- ADD_FAILURE() << "ProgramBuilder is not valid: " << Diagnostics().str();
+ ADD_FAILURE() << "ProgramBuilder is not valid: " << Diagnostics();
}
program = std::make_unique<Program>(resolver::Resolve(*this));
if (!program->IsValid()) {
- ADD_FAILURE() << program->Diagnostics().str();
+ ADD_FAILURE() << program->Diagnostics();
}
spirv_builder = std::make_unique<Builder>(*program);
return *spirv_builder;
@@ -75,15 +75,15 @@
return *spirv_builder;
}
if (!IsValid()) {
- ADD_FAILURE() << "ProgramBuilder is not valid: " << Diagnostics().str();
+ ADD_FAILURE() << "ProgramBuilder is not valid: " << Diagnostics();
}
program = std::make_unique<Program>(resolver::Resolve(*this));
if (!program->IsValid()) {
- ADD_FAILURE() << program->Diagnostics().str();
+ ADD_FAILURE() << program->Diagnostics();
}
auto result = Sanitize(*program, options);
if (!result.program.IsValid()) {
- ADD_FAILURE() << result.program.Diagnostics().str();
+ ADD_FAILURE() << result.program.Diagnostics();
}
*program = std::move(result.program);
bool zero_initialize_workgroup_memory =
diff --git a/src/tint/lang/wgsl/ast/module_clone_test.cc b/src/tint/lang/wgsl/ast/module_clone_test.cc
index 2520091..a683b0a 100644
--- a/src/tint/lang/wgsl/ast/module_clone_test.cc
+++ b/src/tint/lang/wgsl/ast/module_clone_test.cc
@@ -124,12 +124,12 @@
// Parse the wgsl, create the src program
auto src = wgsl::reader::Parse(&file);
- ASSERT_TRUE(src.IsValid()) << src.Diagnostics().str();
+ ASSERT_TRUE(src.IsValid()) << src.Diagnostics();
// Clone the src program to dst
Program dst(src.Clone());
- ASSERT_TRUE(dst.IsValid()) << dst.Diagnostics().str();
+ ASSERT_TRUE(dst.IsValid()) << dst.Diagnostics();
// Expect the printed strings to match
EXPECT_EQ(Program::printer(src), Program::printer(dst));
diff --git a/src/tint/lang/wgsl/ast/transform/helper_test.h b/src/tint/lang/wgsl/ast/transform/helper_test.h
index 68536ea..836209a 100644
--- a/src/tint/lang/wgsl/ast/transform/helper_test.h
+++ b/src/tint/lang/wgsl/ast/transform/helper_test.h
@@ -116,8 +116,7 @@
template <typename TRANSFORM>
bool ShouldRun(Program&& program, const DataMap& data = {}) {
if (!program.IsValid()) {
- ADD_FAILURE() << "ShouldRun() called with invalid program: "
- << program.Diagnostics().str();
+ ADD_FAILURE() << "ShouldRun() called with invalid program: " << program.Diagnostics();
return false;
}
@@ -130,7 +129,7 @@
}
if (!result->IsValid()) {
ADD_FAILURE() << "Apply() called by ShouldRun() returned errors: "
- << result->Diagnostics().str();
+ << result->Diagnostics();
return true;
}
return result.has_value();
diff --git a/src/tint/lang/wgsl/ast/transform/manager.cc b/src/tint/lang/wgsl/ast/transform/manager.cc
index 46e24f7..0b3b47c 100644
--- a/src/tint/lang/wgsl/ast/transform/manager.cc
+++ b/src/tint/lang/wgsl/ast/transform/manager.cc
@@ -48,7 +48,7 @@
std::cout << wgsl << std::endl;
if (!program.IsValid()) {
std::cout << "-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --" << std::endl;
- std::cout << program.Diagnostics().str() << std::endl;
+ std::cout << program.Diagnostics() << std::endl;
}
std::cout << "=========================================================" << std::endl
<< std::endl;
diff --git a/src/tint/lang/wgsl/helpers/flatten_bindings_test.cc b/src/tint/lang/wgsl/helpers/flatten_bindings_test.cc
index a9b43ca..ed04a59 100644
--- a/src/tint/lang/wgsl/helpers/flatten_bindings_test.cc
+++ b/src/tint/lang/wgsl/helpers/flatten_bindings_test.cc
@@ -32,7 +32,7 @@
TEST_F(FlattenBindingsTest, NoBindings) {
ProgramBuilder b;
Program program(resolver::Resolve(b));
- ASSERT_TRUE(program.IsValid()) << program.Diagnostics().str();
+ ASSERT_TRUE(program.IsValid()) << program.Diagnostics();
auto flattened = tint::writer::FlattenBindings(program);
EXPECT_FALSE(flattened);
@@ -45,7 +45,7 @@
b.GlobalVar("c", b.ty.i32(), core::AddressSpace::kUniform, b.Group(0_a), b.Binding(2_a));
Program program(resolver::Resolve(b));
- ASSERT_TRUE(program.IsValid()) << program.Diagnostics().str();
+ ASSERT_TRUE(program.IsValid()) << program.Diagnostics();
auto flattened = tint::writer::FlattenBindings(program);
EXPECT_FALSE(flattened);
@@ -59,7 +59,7 @@
b.WrapInFunction(b.Expr("a"), b.Expr("b"), b.Expr("c"));
Program program(resolver::Resolve(b));
- ASSERT_TRUE(program.IsValid()) << program.Diagnostics().str();
+ ASSERT_TRUE(program.IsValid()) << program.Diagnostics();
auto flattened = tint::writer::FlattenBindings(program);
EXPECT_TRUE(flattened);
@@ -121,7 +121,7 @@
b.Assign(b.Phony(), "texture6"));
Program program(resolver::Resolve(b));
- ASSERT_TRUE(program.IsValid()) << program.Diagnostics().str();
+ ASSERT_TRUE(program.IsValid()) << program.Diagnostics();
auto flattened = tint::writer::FlattenBindings(program);
EXPECT_TRUE(flattened);
diff --git a/src/tint/lang/wgsl/inspector/inspector_builder_test.cc b/src/tint/lang/wgsl/inspector/inspector_builder_test.cc
index 4066063..b93c9eb 100644
--- a/src/tint/lang/wgsl/inspector/inspector_builder_test.cc
+++ b/src/tint/lang/wgsl/inspector/inspector_builder_test.cc
@@ -357,7 +357,7 @@
}
program_ = std::make_unique<Program>(resolver::Resolve(*this));
if (!program_->IsValid()) {
- ADD_FAILURE() << program_->Diagnostics().str();
+ ADD_FAILURE() << program_->Diagnostics();
}
inspector_ = std::make_unique<Inspector>(*program_);
return *inspector_;
diff --git a/src/tint/lang/wgsl/ir_roundtrip_test.cc b/src/tint/lang/wgsl/ir_roundtrip_test.cc
index 2ca1090..bbca278 100644
--- a/src/tint/lang/wgsl/ir_roundtrip_test.cc
+++ b/src/tint/lang/wgsl/ir_roundtrip_test.cc
@@ -32,7 +32,7 @@
auto input = tint::TrimSpace(input_wgsl);
Source::File file("test.wgsl", std::string(input));
auto input_program = wgsl::reader::Parse(&file);
- ASSERT_TRUE(input_program.IsValid()) << input_program.Diagnostics().str();
+ ASSERT_TRUE(input_program.IsValid()) << input_program.Diagnostics();
auto ir_module = wgsl::reader::ProgramToIR(input_program);
ASSERT_TRUE(ir_module) << (ir_module ? "" : ir_module.Failure());
@@ -42,14 +42,14 @@
auto output_program = wgsl::writer::IRToProgram(ir_module.Get());
if (!output_program.IsValid()) {
- FAIL() << output_program.Diagnostics().str() << std::endl //
- << "IR:" << std::endl //
- << disassembly << std::endl //
- << "AST:" << std::endl //
+ FAIL() << output_program.Diagnostics() << std::endl //
+ << "IR:" << std::endl //
+ << disassembly << std::endl //
+ << "AST:" << std::endl //
<< Program::printer(output_program) << std::endl;
}
- ASSERT_TRUE(output_program.IsValid()) << output_program.Diagnostics().str();
+ ASSERT_TRUE(output_program.IsValid()) << output_program.Diagnostics();
auto output = wgsl::writer::Generate(output_program, {});
ASSERT_TRUE(output) << output.Failure();
diff --git a/src/tint/lang/wgsl/resolver/dependency_graph_test.cc b/src/tint/lang/wgsl/resolver/dependency_graph_test.cc
index c46630b..605ffe1 100644
--- a/src/tint/lang/wgsl/resolver/dependency_graph_test.cc
+++ b/src/tint/lang/wgsl/resolver/dependency_graph_test.cc
@@ -37,7 +37,7 @@
DependencyGraph graph;
auto result = DependencyGraph::Build(this->AST(), this->Diagnostics(), graph);
if (expected_error.empty()) {
- EXPECT_TRUE(result) << this->Diagnostics().str();
+ EXPECT_TRUE(result) << this->Diagnostics();
} else {
EXPECT_FALSE(result);
EXPECT_EQ(expected_error, this->Diagnostics().str());
diff --git a/src/tint/lang/wgsl/sem/diagnostic_severity_test.cc b/src/tint/lang/wgsl/sem/diagnostic_severity_test.cc
index adb17f2..511a408 100644
--- a/src/tint/lang/wgsl/sem/diagnostic_severity_test.cc
+++ b/src/tint/lang/wgsl/sem/diagnostic_severity_test.cc
@@ -130,7 +130,7 @@
auto* bar = Func("bar", {}, ty.void_(), tint::Vector{return_bar});
auto p = Build();
- EXPECT_TRUE(p.IsValid()) << p.Diagnostics().str();
+ EXPECT_TRUE(p.IsValid()) << p.Diagnostics();
EXPECT_EQ(p.Sem().DiagnosticSeverity(foo, rule), func_severity);
EXPECT_EQ(p.Sem().DiagnosticSeverity(block_1, rule), block_severity);
diff --git a/src/tint/lang/wgsl/sem/helper_test.h b/src/tint/lang/wgsl/sem/helper_test.h
index 0737060..ece8694 100644
--- a/src/tint/lang/wgsl/sem/helper_test.h
+++ b/src/tint/lang/wgsl/sem/helper_test.h
@@ -31,7 +31,7 @@
/// @return the built program
Program Build() {
if (!IsValid()) {
- ADD_FAILURE() << "ProgramBuilder is not valid: " << Diagnostics().str();
+ ADD_FAILURE() << "ProgramBuilder is not valid: " << Diagnostics();
}
return resolver::Resolve(*this);
}
diff --git a/src/tint/lang/wgsl/writer/ast_printer/helper_test.h b/src/tint/lang/wgsl/writer/ast_printer/helper_test.h
index 14b2ed7..644b2f5 100644
--- a/src/tint/lang/wgsl/writer/ast_printer/helper_test.h
+++ b/src/tint/lang/wgsl/writer/ast_printer/helper_test.h
@@ -48,7 +48,7 @@
program = std::make_unique<Program>(std::move(*this));
}
if (!program->IsValid()) {
- ADD_FAILURE() << program->Diagnostics().str();
+ ADD_FAILURE() << program->Diagnostics();
}
gen_ = std::make_unique<ASTPrinter>(*program);
return *gen_;