summaryrefslogtreecommitdiff
path: root/ir_expression_flattening.cpp
diff options
context:
space:
mode:
authorEric Anholt <eric@anholt.net>2010-06-24 15:13:03 -0700
committerEric Anholt <eric@anholt.net>2010-06-24 15:13:03 -0700
commite33c10328caec29616a5433b1d1df9088f3a84df (patch)
tree723cc38803bb10032d28be9a9a161232d05d0fd1 /ir_expression_flattening.cpp
parent9290e0dd28e646c3dc810e0a6405582f8bf643b6 (diff)
parent26bbfb7917a71d46d9227bbf960606cb673636d3 (diff)
Merge remote branch 'cworth/master'
Conflicts: ast_to_hir.cpp ir.cpp This brings in the talloc-based memory management work, so that the compiler (almost) no longer leaks memory.
Diffstat (limited to 'ir_expression_flattening.cpp')
-rw-r--r--ir_expression_flattening.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/ir_expression_flattening.cpp b/ir_expression_flattening.cpp
index 3089f17ae1..5ba24e390b 100644
--- a/ir_expression_flattening.cpp
+++ b/ir_expression_flattening.cpp
@@ -80,18 +80,19 @@ do_expression_flattening(exec_list *instructions,
static ir_rvalue *
operand_to_temp(ir_instruction *base_ir, ir_rvalue *ir)
{
+ void *ctx = talloc_parent(base_ir);
ir_variable *var;
ir_assignment *assign;
- var = new ir_variable(ir->type, "flattening_tmp");
+ var = new(ctx) ir_variable(ir->type, "flattening_tmp");
base_ir->insert_before(var);
- assign = new ir_assignment(new ir_dereference_variable(var),
- ir,
- NULL);
+ assign = new(ctx) ir_assignment(new(ctx) ir_dereference_variable(var),
+ ir,
+ NULL);
base_ir->insert_before(assign);
- return new ir_dereference_variable(var);
+ return new(ctx) ir_dereference_variable(var);
}
ir_visitor_status