summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorKenneth Graunke <kenneth@whitecape.org>2010-07-19 21:44:03 -0700
committerKenneth Graunke <kenneth@whitecape.org>2010-07-21 16:37:57 -0700
commitc7a18da69022d3f9b05c21ff2473e8ea390f77f1 (patch)
tree573f255e2bdf860a51dd6f9398547ffb45fef822 /src
parentd5be2acae379783c4aa31243e0a88a9e67e6ca7e (diff)
glsl2: Replace insert_before/remove pairs with exec_node::replace_with.
Diffstat (limited to 'src')
-rw-r--r--src/glsl/ast_function.cpp3
-rw-r--r--src/glsl/ir_expression_flattening.cpp3
-rw-r--r--src/glsl/ir_function_inlining.cpp3
-rw-r--r--src/glsl/ir_if_return.cpp6
-rw-r--r--src/glsl/ir_vec_index_to_cond_assign.cpp3
-rw-r--r--src/glsl/ir_vec_index_to_swizzle.cpp3
6 files changed, 7 insertions, 14 deletions
diff --git a/src/glsl/ast_function.cpp b/src/glsl/ast_function.cpp
index 73af882c53..2348bdf24f 100644
--- a/src/glsl/ast_function.cpp
+++ b/src/glsl/ast_function.cpp
@@ -1081,8 +1081,7 @@ ast_function_expression::hir(exec_list *instructions,
all_parameters_are_constant = false;
if (result != ir) {
- ir->insert_before(result);
- ir->remove();
+ ir->replace_with(result);
}
}
diff --git a/src/glsl/ir_expression_flattening.cpp b/src/glsl/ir_expression_flattening.cpp
index 6dbebc6378..ccb2e2bce9 100644
--- a/src/glsl/ir_expression_flattening.cpp
+++ b/src/glsl/ir_expression_flattening.cpp
@@ -171,8 +171,7 @@ ir_expression_flattening_visitor::visit_enter(ir_call *ir)
ir_rvalue *new_ir = operand_to_temp(ir);
if (new_ir != ir) {
- ir->insert_before(new_ir);
- ir->remove();
+ ir->replace_with(new_ir);
}
}
diff --git a/src/glsl/ir_function_inlining.cpp b/src/glsl/ir_function_inlining.cpp
index 05dd83f7ff..c391f12d88 100644
--- a/src/glsl/ir_function_inlining.cpp
+++ b/src/glsl/ir_function_inlining.cpp
@@ -91,8 +91,7 @@ replace_return_with_assignment(ir_instruction *ir, void *data)
if (ret) {
if (ret->value) {
ir_rvalue *lhs = new(ctx) ir_dereference_variable(retval);
- ret->insert_before(new(ctx) ir_assignment(lhs, ret->value, NULL));
- ret->remove();
+ ret->replace_with(new(ctx) ir_assignment(lhs, ret->value, NULL));
} else {
/* un-valued return has to be the last return, or we shouldn't
* have reached here. (see can_inline()).
diff --git a/src/glsl/ir_if_return.cpp b/src/glsl/ir_if_return.cpp
index a9af7166b9..bfb52e7e68 100644
--- a/src/glsl/ir_if_return.cpp
+++ b/src/glsl/ir_if_return.cpp
@@ -108,13 +108,11 @@ ir_if_return_visitor::visit_enter(ir_if *ir)
assign = new(ir) ir_assignment(new(ir) ir_dereference_variable(new_var),
then_return->value, NULL);
- then_return->insert_before(assign);
- then_return->remove();
+ then_return->replace_with(assign);
assign = new(ir) ir_assignment(new(ir) ir_dereference_variable(new_var),
else_return->value, NULL);
- else_return->insert_before(assign);
- else_return->remove();
+ else_return->replace_with(assign);
ir_dereference_variable *deref = new(ir) ir_dereference_variable(new_var);
ir->insert_after(new(ir) ir_return(deref));
diff --git a/src/glsl/ir_vec_index_to_cond_assign.cpp b/src/glsl/ir_vec_index_to_cond_assign.cpp
index 7e04389b5f..dbc6f9ada8 100644
--- a/src/glsl/ir_vec_index_to_cond_assign.cpp
+++ b/src/glsl/ir_vec_index_to_cond_assign.cpp
@@ -218,8 +218,7 @@ ir_vec_index_to_cond_assign_visitor::visit_enter(ir_call *ir)
ir_rvalue *new_param = convert_vec_index_to_cond_assign(param);
if (new_param != param) {
- param->insert_before(new_param);
- param->remove();
+ param->replace_with(new_param);
}
}
diff --git a/src/glsl/ir_vec_index_to_swizzle.cpp b/src/glsl/ir_vec_index_to_swizzle.cpp
index abeb43cd68..1e170cbae6 100644
--- a/src/glsl/ir_vec_index_to_swizzle.cpp
+++ b/src/glsl/ir_vec_index_to_swizzle.cpp
@@ -121,8 +121,7 @@ ir_vec_index_to_swizzle_visitor::visit_enter(ir_call *ir)
ir_rvalue *new_param = convert_vec_index_to_swizzle(param);
if (new_param != param) {
- param->insert_before(new_param);
- param->remove();
+ param->replace_with(new_param);
}
}