cleanup. rename local variable.

This commit is contained in:
Yuichi Nishiwaki 2014-03-22 19:19:49 +09:00
parent ac4e46783c
commit d8ab5cadd1
1 changed files with 6 additions and 6 deletions

View File

@ -1088,32 +1088,32 @@ static void
create_cv_table(pic_state *pic, codegen_context *cxt)
{
size_t i;
xhash *vars;
xhash *regs;
pic_sym *var;
size_t offset;
vars = xh_new_int();
regs = xh_new_int();
/* number local variables */
offset = 1;
for (i = 0; i < cxt->args.size; ++i) {
var = xv_get(&cxt->args, i);
xh_put_int(vars, *var, i + offset);
xh_put_int(regs, *var, i + offset);
}
offset += i;
for (i = 0; i < cxt->locals.size; ++i) {
var = xv_get(&cxt->locals, i);
xh_put_int(vars, *var, i + offset);
xh_put_int(regs, *var, i + offset);
}
/* closed variables */
cxt->cv_tbl = pic_calloc(pic, cxt->captures.size, sizeof(unsigned));
for (i = 0; i < cxt->captures.size; ++i) {
var = xv_get(&cxt->captures, i);
cxt->cv_tbl[i] = xh_get_int(vars, *var)->val;
cxt->cv_tbl[i] = xh_get_int(regs, *var)->val;
}
xh_destroy(vars);
xh_destroy(regs);
}
static void