summaryrefslogtreecommitdiff
path: root/gcc/lto-streamer-in.c
diff options
context:
space:
mode:
authorhubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4>2011-05-25 12:07:38 +0000
committerhubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4>2011-05-25 12:07:38 +0000
commit5f8d4adf262a569ffe265df9fe29020259e29bdd (patch)
tree1b42ff9de53077e317f6573fb7a0e6580fe3254f /gcc/lto-streamer-in.c
parent6b88f2fe9d8dd7d78c1c072d0b66835f3620d2b8 (diff)
downloadgcc-5f8d4adf262a569ffe265df9fe29020259e29bdd.tar.gz
* lto-streamer-out.c (output_record_start): Use lto_output_enum
(lto_output_tree): Use output_record_start. * lto-streamer-in.c (input_record_start): Use lto_input_enum (lto_get_pickled_tree): Use input_record_start. * lto-section-in.c (lto_section_overrun): Turn into fatal error. (lto_value_range_error): New function. * lto-streamer.h (lto_value_range_error): Declare. (lto_output_int_in_range, lto_input_int_in_range): New functions. (lto_output_enum, lto_input_enum): New macros. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@174186 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/lto-streamer-in.c')
-rw-r--r--gcc/lto-streamer-in.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/gcc/lto-streamer-in.c b/gcc/lto-streamer-in.c
index d3a9dd2235b..dd14c0cedf9 100644
--- a/gcc/lto-streamer-in.c
+++ b/gcc/lto-streamer-in.c
@@ -231,11 +231,10 @@ lto_input_string (struct data_in *data_in, struct lto_input_block *ib)
/* Return the next tag in the input block IB. */
-static enum LTO_tags
+static inline enum LTO_tags
input_record_start (struct lto_input_block *ib)
{
- enum LTO_tags tag = (enum LTO_tags) lto_input_uleb128 (ib);
- return tag;
+ return lto_input_enum (ib, LTO_tags, LTO_NUM_TAGS);
}
@@ -2558,7 +2557,7 @@ lto_get_pickled_tree (struct lto_input_block *ib, struct data_in *data_in)
enum LTO_tags expected_tag;
ix = lto_input_uleb128 (ib);
- expected_tag = (enum LTO_tags) lto_input_uleb128 (ib);
+ expected_tag = lto_input_enum (ib, LTO_tags, LTO_NUM_TAGS);
result = lto_streamer_cache_get (data_in->reader_cache, ix);
gcc_assert (result