aboutsummaryrefslogtreecommitdiff
path: root/mesalib/src/glsl/ir_clone.cpp
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2014-07-04 19:52:56 +0200
committermarha <marha@users.sourceforge.net>2014-07-04 19:52:56 +0200
commit62ed212e1add98e39c0f7a6e5a8a5726d66f161e (patch)
treea80c4bf566c76665b3449f13fac7de72c66aa80a /mesalib/src/glsl/ir_clone.cpp
parent3095a03ec3cb1f05b49362327d10a767299d7635 (diff)
parentfe03d6aef6338e43593f164b09ae993bcd0ecbdd (diff)
downloadvcxsrv-62ed212e1add98e39c0f7a6e5a8a5726d66f161e.tar.gz
vcxsrv-62ed212e1add98e39c0f7a6e5a8a5726d66f161e.tar.bz2
vcxsrv-62ed212e1add98e39c0f7a6e5a8a5726d66f161e.zip
Merge remote-tracking branch 'origin/released'
Diffstat (limited to 'mesalib/src/glsl/ir_clone.cpp')
-rw-r--r--mesalib/src/glsl/ir_clone.cpp28
1 files changed, 8 insertions, 20 deletions
diff --git a/mesalib/src/glsl/ir_clone.cpp b/mesalib/src/glsl/ir_clone.cpp
index c00adc564..4b444d468 100644
--- a/mesalib/src/glsl/ir_clone.cpp
+++ b/mesalib/src/glsl/ir_clone.cpp
@@ -123,13 +123,11 @@ ir_if::clone(void *mem_ctx, struct hash_table *ht) const
{
ir_if *new_if = new(mem_ctx) ir_if(this->condition->clone(mem_ctx, ht));
- foreach_list(n, &this->then_instructions) {
- ir_instruction *ir = (ir_instruction *) n;
+ foreach_in_list(ir_instruction, ir, &this->then_instructions) {
new_if->then_instructions.push_tail(ir->clone(mem_ctx, ht));
}
- foreach_list(n, &this->else_instructions) {
- ir_instruction *ir = (ir_instruction *) n;
+ foreach_in_list(ir_instruction, ir, &this->else_instructions) {
new_if->else_instructions.push_tail(ir->clone(mem_ctx, ht));
}
@@ -141,8 +139,7 @@ ir_loop::clone(void *mem_ctx, struct hash_table *ht) const
{
ir_loop *new_loop = new(mem_ctx) ir_loop();
- foreach_list(n, &this->body_instructions) {
- ir_instruction *ir = (ir_instruction *) n;
+ foreach_in_list(ir_instruction, ir, &this->body_instructions) {
new_loop->body_instructions.push_tail(ir->clone(mem_ctx, ht));
}
@@ -158,8 +155,7 @@ ir_call::clone(void *mem_ctx, struct hash_table *ht) const
exec_list new_parameters;
- foreach_list(n, &this->actual_parameters) {
- ir_instruction *ir = (ir_instruction *) n;
+ foreach_in_list(ir_instruction, ir, &this->actual_parameters) {
new_parameters.push_tail(ir->clone(mem_ctx, ht));
}
@@ -278,10 +274,7 @@ ir_function::clone(void *mem_ctx, struct hash_table *ht) const
{
ir_function *copy = new(mem_ctx) ir_function(this->name);
- foreach_list_const(node, &this->signatures) {
- const ir_function_signature *const sig =
- (const ir_function_signature *const) node;
-
+ foreach_in_list(const ir_function_signature, sig, &this->signatures) {
ir_function_signature *sig_copy = sig->clone(mem_ctx, ht);
copy->add_signature(sig_copy);
@@ -302,9 +295,7 @@ ir_function_signature::clone(void *mem_ctx, struct hash_table *ht) const
/* Clone the instruction list.
*/
- foreach_list_const(node, &this->body) {
- const ir_instruction *const inst = (const ir_instruction *) node;
-
+ foreach_in_list(const ir_instruction, inst, &this->body) {
ir_instruction *const inst_copy = inst->clone(mem_ctx, ht);
copy->body.push_tail(inst_copy);
}
@@ -324,9 +315,7 @@ ir_function_signature::clone_prototype(void *mem_ctx, struct hash_table *ht) con
/* Clone the parameter list, but NOT the body.
*/
- foreach_list_const(node, &this->parameters) {
- const ir_variable *const param = (const ir_variable *) node;
-
+ foreach_in_list(const ir_variable, param, &this->parameters) {
assert(const_cast<ir_variable *>(param)->as_variable() != NULL);
ir_variable *const param_copy = param->clone(mem_ctx, ht);
@@ -430,8 +419,7 @@ clone_ir_list(void *mem_ctx, exec_list *out, const exec_list *in)
struct hash_table *ht =
hash_table_ctor(0, hash_table_pointer_hash, hash_table_pointer_compare);
- foreach_list_const(node, in) {
- const ir_instruction *const original = (ir_instruction *) node;
+ foreach_in_list(const ir_instruction, original, in) {
ir_instruction *copy = original->clone(mem_ctx, ht);
out->push_tail(copy);