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_a.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_a.erl')
-rw-r--r-- | lib/compiler/src/beam_a.erl | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/compiler/src/beam_a.erl b/lib/compiler/src/beam_a.erl index 3d073f63df..496b0aba41 100644 --- a/lib/compiler/src/beam_a.erl +++ b/lib/compiler/src/beam_a.erl @@ -28,8 +28,11 @@ module({Mod,Exp,Attr,Fs0,Lc}, _Opt) -> Fs = [function(F) || F <- Fs0], {ok,{Mod,Exp,Attr,Fs,Lc}}. -function({function,Name,Arity,CLabel,Is}) -> +function({function,Name,Arity,CLabel,Is0}) -> try + %% Remove unusued labels for cleanliness and to help + %% optimization passes and HiPE. + Is = beam_jump:remove_unused_labels(Is0), {function,Name,Arity,CLabel,Is} catch Class:Error -> |