tint/writer/spirv: Use Diagnostics() for errors

Brings the SPIR-V writer in line with other writers.

Change-Id: Iaa261150de953b414f966dd004bd48f7315ceb0c
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/131221
Reviewed-by: Dan Sinclair <dsinclair@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: James Price <jrprice@google.com>
diff --git a/src/tint/writer/spirv/builder_loop_test.cc b/src/tint/writer/spirv/builder_loop_test.cc
index addb283..380b2b2 100644
--- a/src/tint/writer/spirv/builder_loop_test.cc
+++ b/src/tint/writer/spirv/builder_loop_test.cc
@@ -34,7 +34,7 @@
 
     b.PushFunctionForTesting();
 
-    EXPECT_TRUE(b.GenerateLoopStatement(loop)) << b.error();
+    EXPECT_TRUE(b.GenerateLoopStatement(loop)) << b.Diagnostics();
     EXPECT_EQ(DumpInstructions(b.CurrentFunction().instructions()),
               R"(OpBranch %1
 %1 = OpLabel
@@ -64,9 +64,9 @@
     spirv::Builder& b = Build();
 
     b.PushFunctionForTesting();
-    ASSERT_TRUE(b.GenerateGlobalVariable(var)) << b.error();
+    ASSERT_TRUE(b.GenerateGlobalVariable(var)) << b.Diagnostics();
 
-    EXPECT_TRUE(b.GenerateLoopStatement(loop)) << b.error();
+    EXPECT_TRUE(b.GenerateLoopStatement(loop)) << b.Diagnostics();
     EXPECT_EQ(DumpInstructions(b.Module().Types()), R"(%3 = OpTypeInt 32 1
 %2 = OpTypePointer Private %3
 %4 = OpConstantNull %3
@@ -107,9 +107,9 @@
     spirv::Builder& b = Build();
 
     b.PushFunctionForTesting();
-    ASSERT_TRUE(b.GenerateGlobalVariable(var)) << b.error();
+    ASSERT_TRUE(b.GenerateGlobalVariable(var)) << b.Diagnostics();
 
-    EXPECT_TRUE(b.GenerateLoopStatement(loop)) << b.error();
+    EXPECT_TRUE(b.GenerateLoopStatement(loop)) << b.Diagnostics();
     EXPECT_EQ(DumpInstructions(b.Module().Types()), R"(%3 = OpTypeInt 32 1
 %2 = OpTypePointer Private %3
 %4 = OpConstantNull %3
@@ -151,7 +151,7 @@
     spirv::Builder& b = Build();
 
     b.PushFunctionForTesting();
-    EXPECT_TRUE(b.GenerateLoopStatement(loop)) << b.error();
+    EXPECT_TRUE(b.GenerateLoopStatement(loop)) << b.Diagnostics();
 
     EXPECT_EQ(DumpInstructions(b.Module().Types()), R"(%7 = OpTypeInt 32 1
 %6 = OpTypePointer Function %7
@@ -186,7 +186,7 @@
 
     b.PushFunctionForTesting();
 
-    EXPECT_TRUE(b.GenerateLoopStatement(loop)) << b.error();
+    EXPECT_TRUE(b.GenerateLoopStatement(loop)) << b.Diagnostics();
     EXPECT_EQ(DumpInstructions(b.CurrentFunction().instructions()),
               R"(OpBranch %1
 %1 = OpLabel
@@ -217,7 +217,7 @@
 
     b.PushFunctionForTesting();
 
-    EXPECT_TRUE(b.GenerateLoopStatement(loop)) << b.error();
+    EXPECT_TRUE(b.GenerateLoopStatement(loop)) << b.Diagnostics();
     EXPECT_EQ(DumpInstructions(b.CurrentFunction().instructions()),
               R"(OpBranch %1
 %1 = OpLabel
@@ -246,7 +246,7 @@
 
     b.PushFunctionForTesting();
 
-    EXPECT_TRUE(b.GenerateLoopStatement(loop)) << b.error();
+    EXPECT_TRUE(b.GenerateLoopStatement(loop)) << b.Diagnostics();
     EXPECT_EQ(DumpInstructions(b.Module().Types()), R"(%5 = OpTypeBool
 %6 = OpConstantTrue %5
 )");
@@ -277,7 +277,7 @@
 
     b.PushFunctionForTesting();
 
-    EXPECT_TRUE(b.GenerateLoopStatement(loop)) << b.error();
+    EXPECT_TRUE(b.GenerateLoopStatement(loop)) << b.Diagnostics();
     EXPECT_EQ(DumpInstructions(b.Module().Types()), R"(%5 = OpTypeBool
 %6 = OpConstantNull %5
 )");
@@ -311,7 +311,7 @@
 
     b.PushFunctionForTesting();
 
-    EXPECT_TRUE(b.GenerateLoopStatement(loop)) << b.error();
+    EXPECT_TRUE(b.GenerateLoopStatement(loop)) << b.Diagnostics();
     EXPECT_EQ(DumpInstructions(b.Module().Types()), R"(%5 = OpTypeBool
 %6 = OpConstantTrue %5
 %8 = OpTypePointer Function %5
@@ -357,7 +357,7 @@
 
     b.PushFunctionForTesting();
 
-    EXPECT_TRUE(b.GenerateLoopStatement(outer_loop)) << b.error();
+    EXPECT_TRUE(b.GenerateLoopStatement(outer_loop)) << b.Diagnostics();
     EXPECT_EQ(DumpInstructions(b.Module().Types()), R"(%9 = OpTypeBool
 %10 = OpConstantTrue %9
 )");