From 9296257c716a7a8c35324f38f0ab5cfede7ba74d Mon Sep 17 00:00:00 2001 From: "Wolfgang (Blub) Bumiller" Date: Wed, 22 Aug 2012 16:29:27 +0200 Subject: [PATCH] fix the functiondef's .locals... --- ir.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/ir.c b/ir.c index 0dc785a..dff566e 100644 --- a/ir.c +++ b/ir.c @@ -2558,7 +2558,6 @@ static bool gen_global_function(ir_builder *ir, ir_value *global) } fun.firstlocal = code_globals_elements; - fun.locals = irfun->allocated_locals + irfun->locals_count; local_var_end = fun.firstlocal; for (i = 0; i < irfun->locals_count; ++i) { @@ -2583,6 +2582,8 @@ static bool gen_global_function(ir_builder *ir, ir_value *global) code_globals_add(0); } + fun.locals = code_globals_elements - fun.firstlocal; + if (irfun->builtin) fun.entry = irfun->builtin; else { @@ -2926,7 +2927,7 @@ void ir_function_dump(ir_function *f, char *ind, for (i = 0; i < f->locals_count; ++i) { size_t l; ir_value *v = f->locals[i]; - oprintf("%s\t%s: ", ind, v->name); + oprintf("%s\t%s: unique ", ind, v->name); for (l = 0; l < v->life_count; ++l) { oprintf("[%i,%i] ", v->life[l].start, v->life[l].end); } @@ -2935,7 +2936,7 @@ void ir_function_dump(ir_function *f, char *ind, for (i = 0; i < f->values_count; ++i) { size_t l; ir_value *v = f->values[i]; - oprintf("%s\t%s: (%i)", ind, v->name, (int)v->life_count); + oprintf("%s\t%s: @%i ", ind, v->name, (int)v->code.local); for (l = 0; l < v->life_count; ++l) { oprintf("[%i,%i] ", v->life[l].start, v->life[l].end); } -- 2.39.2