add mrbc option --remove-lv

* refactor: move `irep_remove_lv` from `mruby-bin-strip` gem to src/dump and rename to `mrb_irep_remove_lv`
* add: mrbc option `--remove-lv` to remove LVAR section
This commit is contained in:
yuri
2018-07-10 01:42:33 +09:00
parent 17c9e65603
commit dabb20ddbb
4 changed files with 26 additions and 17 deletions
+15
View File
@@ -1103,4 +1103,19 @@ mrb_dump_irep_cfunc(mrb_state *mrb, mrb_irep *irep, uint8_t flags, FILE *fp, con
return result;
}
void
mrb_irep_remove_lv(mrb_state *mrb, mrb_irep *irep)
{
int i;
if (irep->lv) {
mrb_free(mrb, irep->lv);
irep->lv = NULL;
}
for (i = 0; i < irep->rlen; ++i) {
mrb_irep_remove_lv(mrb, irep->reps[i]);
}
}
#endif /* MRB_DISABLE_STDIO */