summaryrefslogtreecommitdiffhomepage
path: root/mrbgems/mruby-bin-strip
diff options
context:
space:
mode:
authoryuri <[email protected]>2018-07-10 01:42:33 +0900
committeryuri <[email protected]>2018-07-10 01:42:33 +0900
commitdabb20ddbb51e6dac3bb6a8bac6dfcfd76808ac0 (patch)
tree0c2ff85799ce7781324114dc58a6a52b9fe33b4a /mrbgems/mruby-bin-strip
parent17c9e65603f3e21abc9f383532dbd33666245309 (diff)
downloadmruby-dabb20ddbb51e6dac3bb6a8bac6dfcfd76808ac0.tar.gz
mruby-dabb20ddbb51e6dac3bb6a8bac6dfcfd76808ac0.zip
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
Diffstat (limited to 'mrbgems/mruby-bin-strip')
-rw-r--r--mrbgems/mruby-bin-strip/tools/mruby-strip/mruby-strip.c18
1 files changed, 1 insertions, 17 deletions
diff --git a/mrbgems/mruby-bin-strip/tools/mruby-strip/mruby-strip.c b/mrbgems/mruby-bin-strip/tools/mruby-strip/mruby-strip.c
index deb66d54c..fb78b0c3b 100644
--- a/mrbgems/mruby-bin-strip/tools/mruby-strip/mruby-strip.c
+++ b/mrbgems/mruby-bin-strip/tools/mruby-strip/mruby-strip.c
@@ -12,22 +12,6 @@ struct strip_args {
mrb_bool lvar;
};
-
-static void
-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) {
- irep_remove_lv(mrb, irep->reps[i]);
- }
-}
-
static void
print_usage(const char *f)
{
@@ -99,7 +83,7 @@ strip(mrb_state *mrb, struct strip_args *args)
/* clear lv if --lvar is enabled */
if (args->lvar) {
- irep_remove_lv(mrb, irep);
+ mrb_irep_remove_lv(mrb, irep);
}
wfile = fopen(filename, "wb");