aboutsummaryrefslogtreecommitdiffstats
path: root/lib/hipe/icode/hipe_icode.erl
diff options
context:
space:
mode:
authorKostis Sagonas <[email protected]>2010-05-11 10:12:08 +0000
committerErlang/OTP <[email protected]>2010-05-11 10:12:08 +0000
commitbf9ccd82c744f44f2ca2c07e23b6784cd29c94e3 (patch)
treeabe7503a7f790c9442d19e99643ae59b343c61c5 /lib/hipe/icode/hipe_icode.erl
parent841bda73edef70bce46c5df553e5c3826caf8d67 (diff)
downloadotp-bf9ccd82c744f44f2ca2c07e23b6784cd29c94e3.tar.gz
otp-bf9ccd82c744f44f2ca2c07e23b6784cd29c94e3.tar.bz2
otp-bf9ccd82c744f44f2ca2c07e23b6784cd29c94e3.zip
hipe_icode: Suppress a dialyzer warning
Diffstat (limited to 'lib/hipe/icode/hipe_icode.erl')
-rw-r--r--lib/hipe/icode/hipe_icode.erl32
1 files changed, 12 insertions, 20 deletions
diff --git a/lib/hipe/icode/hipe_icode.erl b/lib/hipe/icode/hipe_icode.erl
index a4614d7237..3e211bf385 100644
--- a/lib/hipe/icode/hipe_icode.erl
+++ b/lib/hipe/icode/hipe_icode.erl
@@ -1,20 +1,20 @@
%% -*- erlang-indent-level: 2 -*-
%%
%% %CopyrightBegin%
-%%
-%% Copyright Ericsson AB 2001-2009. All Rights Reserved.
-%%
+%%
+%% Copyright Ericsson AB 2001-2010. All Rights Reserved.
+%%
%% The contents of this file are subject to the Erlang Public License,
%% Version 1.1, (the "License"); you may not use this file except in
%% compliance with the License. You should have received a copy of the
%% Erlang Public License along with this software. If not, it can be
%% retrieved online at http://www.erlang.org/.
-%%
+%%
%% Software distributed under the License is distributed on an "AS IS"
%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
%% the License for the specific language governing rights and limitations
%% under the License.
-%%
+%%
%% %CopyrightEnd%
%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@@ -1578,27 +1578,19 @@ redirect_jmp(Jmp, ToOld, ToNew) ->
_ -> Jmp
end
end,
- simplify_branch(NewI).
-
-%%
-%% @doc Turns a branch into a goto if it has only one successor and it
-%% is safe to do so.
-%%
-
--spec simplify_branch(icode_instr()) -> icode_instr().
-
-simplify_branch(I) ->
- case ordsets:from_list(successors(I)) of
+ %% Turn a branch into a goto if it has only one successor and it is
+ %% safe to do so.
+ case ordsets:from_list(successors(NewI)) of
[Label] ->
Goto = mk_goto(Label),
- case I of
- #icode_type{} -> Goto;
+ case NewI of
#icode_if{} -> Goto;
#icode_switch_tuple_arity{} -> Goto;
#icode_switch_val{} -> Goto;
- _ -> I
+ #icode_type{} -> Goto;
+ _ -> NewI
end;
- _ -> I
+ _ -> NewI
end.
%%