glsl2: Replace insert_before/remove pairs with exec_node::replace_with.
diff --git a/src/glsl/ast_function.cpp b/src/glsl/ast_function.cpp
index 73af882..2348bdf 100644
--- a/src/glsl/ast_function.cpp
+++ b/src/glsl/ast_function.cpp
@@ -1081,8 +1081,7 @@
 	    all_parameters_are_constant = false;
 
 	 if (result != ir) {
-	    ir->insert_before(result);
-	    ir->remove();
+	    ir->replace_with(result);
 	 }
       }