diff options
author | Björn Gustavsson <[email protected]> | 2012-09-04 12:40:26 +0200 |
---|---|---|
committer | Björn Gustavsson <[email protected]> | 2012-10-09 15:24:41 +0200 |
commit | 105e056cddaf765952d58813e2ec5c9bdfd4403c (patch) | |
tree | 240f4942ec4360336272d495009c498380e4b3be /lib/compiler/src/beam_jump.erl | |
parent | 8c9863948b440f2741b6df3ffda2c6dd2b7b363c (diff) | |
download | otp-105e056cddaf765952d58813e2ec5c9bdfd4403c.tar.gz otp-105e056cddaf765952d58813e2ec5c9bdfd4403c.tar.bz2 otp-105e056cddaf765952d58813e2ec5c9bdfd4403c.zip |
Refactor removal of unused labels
Since we always want to remove unused labels directly after code
generation (whether we'll run the optimization passes or not),
we can simplify the code by doing it in beam_a.
Diffstat (limited to 'lib/compiler/src/beam_jump.erl')
-rw-r--r-- | lib/compiler/src/beam_jump.erl | 9 |
1 files changed, 1 insertions, 8 deletions
diff --git a/lib/compiler/src/beam_jump.erl b/lib/compiler/src/beam_jump.erl index e7025ea6e8..2b68b3ed20 100644 --- a/lib/compiler/src/beam_jump.erl +++ b/lib/compiler/src/beam_jump.erl @@ -20,7 +20,7 @@ -module(beam_jump). --export([module/2,module_labels/1, +-export([module/2, is_unreachable_after/1,is_exit_instruction/1, remove_unused_labels/1,is_label_used_in/2]). @@ -133,13 +133,6 @@ module({Mod,Exp,Attr,Fs0,Lc}, _Opt) -> Fs = [function(F) || F <- Fs0], {ok,{Mod,Exp,Attr,Fs,Lc}}. -module_labels({Mod,Exp,Attr,Fs,Lc}) -> - {Mod,Exp,Attr,[function_labels(F) || F <- Fs],Lc}. - -function_labels({function,Name,Arity,CLabel,Asm0}) -> - Asm = remove_unused_labels(Asm0), - {function,Name,Arity,CLabel,Asm}. - %% function(Function) -> Function' %% Optimize jumps and branches. %% |