Update `InsertAfter` naming.

The name `InsertAfter` is confusing as it can receive a `FunctionParam`
or `BlockParam` as argument, but it inserts into the _block_ after those
instructions, not the instruction itself.

Update the name to `InsertInBlockAfter` to make it clearer where the
instructions will be placed.

Bug: 361142936
Change-Id: I5ae9b180e274bd6c0589d698a678571de7384347
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/220375
Commit-Queue: James Price <jrprice@google.com>
Reviewed-by: James Price <jrprice@google.com>
Auto-Submit: dan sinclair <dsinclair@chromium.org>
diff --git a/src/tint/lang/core/ir/builder.h b/src/tint/lang/core/ir/builder.h
index 11a46c2..f411d64 100644
--- a/src/tint/lang/core/ir/builder.h
+++ b/src/tint/lang/core/ir/builder.h
@@ -211,11 +211,14 @@
         cb();
     }
 
-    /// Calls @p cb with the builder inserting after @p val
-    /// @param val the insertion point for new instructions
-    /// @param cb the function to call with the builder inserting new instructions after @p val
+    /// Calls @p cb with the builder inserting at the first block position after @p val. This means
+    /// if a `FunctionParam` or `BlockParam` are provided, the callback will insert into the _next_
+    /// block seen after the parameters.
+    /// @param val the value used to determine which block to insert into
+    /// @param cb the function to call with the builder inserting new instructions in the first
+    /// block position after @p val
     template <typename FUNCTION>
-    void InsertAfter(ir::Value* val, FUNCTION&& cb) {
+    void InsertInBlockAfter(ir::Value* val, FUNCTION&& cb) {
         tint::Switch(
             val,
             [&](core::ir::InstructionResult* result) {
diff --git a/src/tint/lang/core/ir/builder_test.cc b/src/tint/lang/core/ir/builder_test.cc
index 91bb796..9241535 100644
--- a/src/tint/lang/core/ir/builder_test.cc
+++ b/src/tint/lang/core/ir/builder_test.cc
@@ -116,7 +116,7 @@
 )");
 }
 
-TEST_F(IR_BuilderTest, InsertAfter_InstructionResult) {
+TEST_F(IR_BuilderTest, InsertInBlockAfter_InstructionResult) {
     auto* func = b.Function("foo", ty.void_());
     Instruction* ip = nullptr;
     b.Append(func->Block(), [&] {
@@ -124,7 +124,7 @@
         ip = b.Let("b", 2_u);
         b.Let("c", 3_u);
     });
-    b.InsertAfter(ip->Result(0), [&] {
+    b.InsertInBlockAfter(ip->Result(0), [&] {
         b.Let("d", 4_u);
         b.Let("e", 5_u);
         b.Let("f", 6_u);
@@ -143,7 +143,7 @@
 )");
 }
 
-TEST_F(IR_BuilderTest, InsertAfter_Param) {
+TEST_F(IR_BuilderTest, InsertInBlockAfter_Param) {
     auto* func = b.Function("foo", ty.void_());
     auto* param = b.FunctionParam("param", ty.u32());
     func->SetParams({param});
@@ -152,7 +152,7 @@
         b.Let("b", 2_u);
         b.Let("c", 3_u);
     });
-    b.InsertAfter(param, [&] {
+    b.InsertInBlockAfter(param, [&] {
         b.Let("d", 4_u);
         b.Let("e", 5_u);
         b.Let("f", 6_u);
@@ -171,11 +171,11 @@
 )");
 }
 
-TEST_F(IR_BuilderTest, InsertAfter_Param_EmptyFunction) {
+TEST_F(IR_BuilderTest, InsertInBlockAfter_Param_EmptyFunction) {
     auto* func = b.Function("foo", ty.void_());
     auto* param = b.FunctionParam("param", ty.u32());
     func->SetParams({param});
-    b.InsertAfter(param, [&] {
+    b.InsertInBlockAfter(param, [&] {
         b.Let("a", 1_u);
         b.Let("b", 2_u);
         b.Let("c", 3_u);
@@ -191,7 +191,7 @@
 )");
 }
 
-TEST_F(IR_BuilderTest, InsertAfter_BlockParam) {
+TEST_F(IR_BuilderTest, InsertInBlockAfter_BlockParam) {
     auto* func = b.Function("foo", ty.void_());
     b.Append(func->Block(), [&] {
         auto* loop = b.Loop();
@@ -202,7 +202,7 @@
             b.Let("b", 2_u);
             b.Let("c", 3_u);
         });
-        b.InsertAfter(param, [&] {
+        b.InsertInBlockAfter(param, [&] {
             b.Let("d", 4_u);
             b.Let("e", 5_u);
             b.Let("f", 6_u);
@@ -226,13 +226,13 @@
 )");
 }
 
-TEST_F(IR_BuilderTest, InsertAfter_BlockParam_EmptyBlock) {
+TEST_F(IR_BuilderTest, InsertInBlockAfter_BlockParam_EmptyBlock) {
     auto* func = b.Function("foo", ty.void_());
     b.Append(func->Block(), [&] {
         auto* loop = b.Loop();
         auto* param = b.BlockParam("param", ty.u32());
         loop->Body()->SetParams({param});
-        b.InsertAfter(param, [&] {
+        b.InsertInBlockAfter(param, [&] {
             b.Let("a", 1_u);
             b.Let("b", 2_u);
             b.Let("c", 3_u);
diff --git a/src/tint/lang/spirv/writer/raise/var_for_dynamic_index.cc b/src/tint/lang/spirv/writer/raise/var_for_dynamic_index.cc
index ea336ae..5a01b2b 100644
--- a/src/tint/lang/spirv/writer/raise/var_for_dynamic_index.cc
+++ b/src/tint/lang/spirv/writer/raise/var_for_dynamic_index.cc
@@ -183,7 +183,7 @@
                         // object.
                         auto* intermediate_source = b.Access(to_replace.dynamic_index_source_type,
                                                              source_object, partial_access.indices);
-                        b.InsertAfter(source_object, [&] { b.Append(intermediate_source); });
+                        b.InsertInBlockAfter(source_object, [&] { b.Append(intermediate_source); });
                         return intermediate_source->Result(0);
                     });
             }
@@ -199,7 +199,7 @@
                                         core::Access::kReadWrite));
                     ir.root_block->Append(decl);
                 } else {
-                    b.InsertAfter(source_object, [&] {
+                    b.InsertInBlockAfter(source_object, [&] {
                         decl = b.Var(ty.ptr(core::AddressSpace::kFunction, source_object->Type(),
                                             core::Access::kReadWrite));