diff options
author | Diego Novillo <dnovillo@google.com> | 2009-07-22 17:05:26 +0000 |
---|---|---|
committer | Diego Novillo <dnovillo@google.com> | 2009-07-22 17:05:26 +0000 |
commit | d24afda56c5a7fbaf30a83bcb253f312a99db29c (patch) | |
tree | 236a6e4309bf8dc38fd5ad5c2f2e979386234250 | |
parent | d2b6ef57788b155bb966be42410f4fc90af82274 (diff) |
* lto-streamer-out.c (last_eh_region_seen): Remove.
Update all users.
(output_bb): Fix emission of EH region numbers.
* lto-streamer-in.c (input_bb): Corresponding changes.
* lto-streamer.h (enum LTO_tags): Remove LTO_set_eh0.
Rename LTO_set_eh1 to LTO_eh_region.
Update all users.
git-svn-id: https://gcc.gnu.org/svn/gcc/branches/lto@149948 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r-- | gcc/ChangeLog.lto | 10 | ||||
-rw-r--r-- | gcc/lto-streamer-in.c | 22 | ||||
-rw-r--r-- | gcc/lto-streamer-out.c | 19 | ||||
-rw-r--r-- | gcc/lto-streamer.c | 6 | ||||
-rw-r--r-- | gcc/lto-streamer.h | 16 |
5 files changed, 27 insertions, 46 deletions
diff --git a/gcc/ChangeLog.lto b/gcc/ChangeLog.lto index 7958ee023e1..e4bbbf1efc9 100644 --- a/gcc/ChangeLog.lto +++ b/gcc/ChangeLog.lto @@ -1,5 +1,15 @@ 2009-07-22 Diego Novillo <dnovillo@google.com> + * lto-streamer-out.c (last_eh_region_seen): Remove. + Update all users. + (output_bb): Fix emission of EH region numbers. + * lto-streamer-in.c (input_bb): Corresponding changes. + * lto-streamer.h (enum LTO_tags): Remove LTO_set_eh0. + Rename LTO_set_eh1 to LTO_eh_region. + Update all users. + +2009-07-22 Diego Novillo <dnovillo@google.com> + * tree-pass.h (TDF_EH): Define. * gimple-pretty-print.c (dump_gimple_stmt): If FLAGS contains TDF_EH, print the EH region number holding GS. diff --git a/gcc/lto-streamer-in.c b/gcc/lto-streamer-in.c index bda5d21b214..38d3e71c061 100644 --- a/gcc/lto-streamer-in.c +++ b/gcc/lto-streamer-in.c @@ -977,7 +977,6 @@ input_bb (struct lto_input_block *ib, enum LTO_tags tag, unsigned int index; basic_block bb; gimple_stmt_iterator bsi; - HOST_WIDE_INT curr_eh_region; /* This routine assumes that CFUN is set to FN, as it needs to call basic GIMPLE routines that use CFUN. */ @@ -995,7 +994,6 @@ input_bb (struct lto_input_block *ib, enum LTO_tags tag, if (tag == LTO_bb0) return; - curr_eh_region = -1; bsi = gsi_start_bb (bb); tag = input_record_start (ib); while (tag) @@ -1007,23 +1005,13 @@ input_bb (struct lto_input_block *ib, enum LTO_tags tag, /* After the statement, expect a 0 delimiter or the EH region that the previous statement belongs to. */ tag = input_record_start (ib); - gcc_assert (tag == LTO_set_eh1 || tag == LTO_set_eh0 || tag == LTO_null); + gcc_assert (tag == LTO_eh_region || tag == LTO_null); - if (tag == LTO_set_eh1 || tag == LTO_set_eh0) + if (tag == LTO_eh_region) { - HOST_WIDE_INT region = 0; - - if (tag == LTO_set_eh1) - region = lto_input_sleb128 (ib); - - if (region != curr_eh_region) - curr_eh_region = region; - } - - if (curr_eh_region >= 0) - { - gcc_assert (curr_eh_region <= num_eh_regions ()); - add_stmt_to_eh_region (stmt, curr_eh_region); + HOST_WIDE_INT region = lto_input_uleb128 (ib); + gcc_assert (region <= num_eh_regions ()); + add_stmt_to_eh_region (stmt, region); } tag = input_record_start (ib); diff --git a/gcc/lto-streamer-out.c b/gcc/lto-streamer-out.c index 9cfc9820506..4b303c64754 100644 --- a/gcc/lto-streamer-out.c +++ b/gcc/lto-streamer-out.c @@ -44,11 +44,6 @@ along with GCC; see the file COPYING3. If not see #include "lto-symtab.h" #include "lto-streamer.h" -/* The index of the last eh_region seen for an instruction. The - eh_region for an instruction is only emitted if it is different - from the last instruction. */ -static int last_eh_region_seen; - /* Returns nonzero if P1 and P2 are equal. */ static int @@ -1839,16 +1834,12 @@ output_bb (struct output_block *ob, basic_block bb, struct function *fn) output_gimple_stmt (ob, stmt); - /* Emit the EH region holding STMT. If the EH region is the - same as the previous statement, emit a 0 for brevity. */ + /* Emit the EH region holding STMT. */ region = lookup_stmt_eh_region_fn (fn, stmt); - if (region != last_eh_region_seen) + if (region >= 0) { - output_record_start (ob, (region) ? LTO_set_eh1 : LTO_set_eh0); - if (region) - output_sleb128 (ob, region); - - last_eh_region_seen = region; + output_record_start (ob, LTO_eh_region); + output_uleb128 (ob, region); } else output_zero (ob); @@ -1955,8 +1946,6 @@ output_function (struct cgraph_node *node) /* Make string 0 be a NULL string. */ lto_output_1_stream (ob->string_stream, 0); - last_eh_region_seen = 0; - output_record_start (ob, LTO_function); /* Write all the attributes for FN. */ diff --git a/gcc/lto-streamer.c b/gcc/lto-streamer.c index 572233bd487..650e80fb99b 100644 --- a/gcc/lto-streamer.c +++ b/gcc/lto-streamer.c @@ -69,10 +69,8 @@ lto_tag_name (enum LTO_tags tag) return "LTO_bb0"; case LTO_bb1: return "LTO_bb1"; - case LTO_set_eh0: - return "LTO_set_eh0"; - case LTO_set_eh1: - return "LTO_set_eh1"; + case LTO_eh_region: + return "LTO_eh_region"; case LTO_function: return "LTO_function"; case LTO_eh_table: diff --git a/gcc/lto-streamer.h b/gcc/lto-streamer.h index 428d98affb3..2cac1b369da 100644 --- a/gcc/lto-streamer.h +++ b/gcc/lto-streamer.h @@ -111,13 +111,10 @@ along with GCC; see the file COPYING3. If not see the statements - A gimple tree, as described above. These are only present for LTO_BB1. Following each statement is an optional - exception handling record LTO_set_eh1 or - LTO_set_eh0 if the exception handling for - this statement differed from the last region - output. LTO_set_eh0 is a special case that - sets the region to 0. LTO_set_eh1 contains - the region number in sleb128 form. - + exception handling record LTO_eh_region + which contains the region number (for + regions >= 0). + zero - This is only present for LTO_BB1 and is used to terminate the statements and exception regions within this block. @@ -185,9 +182,8 @@ enum LTO_tags LTO_bb0 = 1 + NUM_TREE_CODES + LAST_AND_UNUSED_GIMPLE_CODE, LTO_bb1, - /* Variant 1 is used to set region to a nonzero value. */ - LTO_set_eh0, - LTO_set_eh1, + /* EH region holding the previous statement. */ + LTO_eh_region, /* An MD or NORMAL builtin. Only the code and class are streamed out. */ LTO_builtin_decl, |