[tint][ir] Move terminator validation to CheckTerminator()

Instead of doing another dynamic cast in BeginBlock().
Also clean up the diagnostic message.

Change-Id: I561ddab62214be5db24c7148fe57418ac77c1ba2
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/188980
Commit-Queue: Ben Clayton <bclayton@google.com>
Reviewed-by: James Price <jrprice@google.com>
diff --git a/src/tint/lang/core/ir/validator.cc b/src/tint/lang/core/ir/validator.cc
index 1d69625..504d50e 100644
--- a/src/tint/lang/core/ir/validator.cc
+++ b/src/tint/lang/core/ir/validator.cc
@@ -716,11 +716,6 @@
         if (inst->Block() != blk) {
             AddError(inst) << "block instruction does not have same block as parent";
             AddNote(blk) << "in block";
-            continue;
-        }
-        if (inst->Is<ir::Terminator>() && inst != blk->Terminator()) {
-            AddError(inst) << "block terminator which isn't the final instruction";
-            continue;
         }
     }
 
@@ -1173,6 +1168,10 @@
         [&](const ir::TerminateInvocation*) {},                      //
         [&](const ir::Unreachable*) {},                              //
         [&](Default) { AddError(b) << "missing validation"; });
+
+    if (b->next) {
+        AddError(b) << "must be the last instruction in the block";
+    }
 }
 
 void Validator::CheckContinue(const Continue* c) {