-#ifndef NEW_ALLOC_STRAT
- local_var_end = fun.firstlocal;
- for (i = 0; i < vec_size(irfun->locals); ++i) {
- if (!ir_builder_gen_global(ir, irfun->locals[i], true)) {
- irerror(irfun->locals[i]->context, "Failed to generate local %s", irfun->locals[i]->name);
- return false;
- }
- }
- if (vec_size(irfun->locals)) {
- ir_value *last = vec_last(irfun->locals);
- local_var_end = last->code.globaladdr;
- if (last->vtype == TYPE_FIELD && last->fieldtype == TYPE_VECTOR)
- local_var_end += type_sizeof[TYPE_VECTOR];
- else
- local_var_end += type_sizeof[last->vtype];
- }
- for (i = 0; i < vec_size(irfun->values); ++i)
- {
- /* generate code.globaladdr for ssa values */
- ir_value *v = irfun->values[i];
- ir_value_code_setaddr(v, local_var_end + v->code.local);
- }
- for (i = 0; i < irfun->allocated_locals; ++i) {
- /* fill the locals with zeros */
- vec_push(code_globals, 0);
- }
-
- fun.locals = vec_size(code_globals) - fun.firstlocal;
-#else