1
1
%% -*- erlang-indent-level: 2 -*-
5
%% Copyright Ericsson AB 2004-2009. All Rights Reserved.
7
%% The contents of this file are subject to the Erlang Public License,
8
%% Version 1.1, (the "License"); you may not use this file except in
9
%% compliance with the License. You should have received a copy of the
10
%% Erlang Public License along with this software. If not, it can be
11
%% retrieved online at http://www.erlang.org/.
13
%% Software distributed under the License is distributed on an "AS IS"
14
%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
15
%% the License for the specific language governing rights and limitations
2
20
%% ====================================================================
3
21
%% Filename : hipe_icode_exceptions.erl
4
22
%% Module : hipe_icode_exceptions
364
382
%%---------------------------------------------------------------------
365
383
%% State abstraction
367
-record(state, {cfg :: #cfg{},
368
changed = false :: bool(),
371
start_labels :: [icode_lbl(),...],
373
out = gb_trees:empty() :: gb_tree(),
374
in = gb_trees:empty() :: gb_tree()
385
-record(state, {cfg :: #cfg{},
386
changed = false :: bool(),
389
start_labels :: [icode_lbl(),...],
390
visited = hipe_icode_cfg:none_visited() :: gb_set(),
391
out = gb_trees:empty() :: gb_tree(),
392
in = gb_trees:empty() :: gb_tree()
377
395
init_state(CFG) ->
378
State = #state{cfg = CFG,
379
visited = hipe_icode_cfg:none_visited(),
380
out = gb_trees:empty(),
381
in = gb_trees:empty()
396
State = #state{cfg = CFG},
383
397
refresh_state_cache(State).
385
399
refresh_state_cache(State) ->
386
400
CFG = State#state.cfg,
387
State#state{succ = CFG,
389
start_labels = [hipe_icode_cfg:start_label(CFG)]
401
SLs = [hipe_icode_cfg:start_label(CFG)],
402
State#state{succ = CFG, pred = CFG, start_labels = SLs}.
392
404
get_cfg(State) ->
458
470
get_new_catches_in(Ps, Cs1, State);
459
471
get_new_catches_in([], Cs, _) ->
463
474
%%---------------------------------------------------------------------