diff options
author | Richard Biener <rguenther@suse.de> | 2012-10-10 14:27:59 +0000 |
---|---|---|
committer | Richard Biener <rguenth@gcc.gnu.org> | 2012-10-10 14:27:59 +0000 |
commit | 7cb7d208bb9e7811a2343d018ec196b59d6e1998 (patch) | |
tree | 3534db32ee5430daa60040a605add057d9c96f94 /gcc/tree-streamer-out.c | |
parent | 8fc5b387d7eeeffbaf6955920fb0e70d2bcd563b (diff) | |
download | gcc-7cb7d208bb9e7811a2343d018ec196b59d6e1998.zip gcc-7cb7d208bb9e7811a2343d018ec196b59d6e1998.tar.gz gcc-7cb7d208bb9e7811a2343d018ec196b59d6e1998.tar.bz2 |
lto-streamer-in.c (lto_input_location_bitpack): Rename to ...
2012-10-10 Richard Biener <rguenther@suse.de>
* lto-streamer-in.c (lto_input_location_bitpack): Rename to ...
(lto_input_location): ... this. Kill original.
(input_eh_region): Adjust.
(input_struct_function_base): Likewise.
(lto_read_tree): Likewise.
* lto-streamer-out.c (lto_output_location_bitpack): Rename to ...
(lto_output_location): ... this. Kill original.
(lto_write_tree): Adjust.
(output_eh_region): Likewise.
(output_struct_function_base): Likewise.
* lto-streamer.c (lto_streamer_hooks_init): Initialize location
hooks.
* lto-streamer.h (lto_input_location): Adjust prototype.
(lto_output_location): Likewise.
* streamer-hooks.h (struct streamer_hooks): Adjust prototype
of input_location and output_location hooks.
(stream_input_location): New define.
(stream_output_location): Likewise.
* tree-streamer-in.c (unpack_ts_block_value_fields): Adjust.
(unpack_value_fields): Likewise.
(streamer_read_tree_bitfields): Likewise.
(lto_input_ts_decl_minimal_tree_pointers): Likewise.
(lto_input_ts_exp_tree_pointers): Likewise.
(lto_input_ts_block_tree_pointers): Likewise.
* tree-streamer-out.c (pack_ts_block_value_fields): Adjust.
(streamer_pack_tree_bitfields): Likewise.
(write_ts_decl_minimal_tree_pointers): Likewise.
(write_ts_exp_tree_pointers): Likewise.
(write_ts_block_tree_pointers): Likewise.
* gimple-streamer-in.c (input_phi): Adjust.
(input_gimple_stmt): Likewise.
* gimple-streamer-out.c (output_phi): Adjust.
(output_gimple_stmt): Likewise.
* tree-streamer.h (streamer_read_tree_bitfields): Adjust prototype.
(streamer_pack_tree_bitfields): Likewise.
From-SVN: r192317
Diffstat (limited to 'gcc/tree-streamer-out.c')
-rw-r--r-- | gcc/tree-streamer-out.c | 37 |
1 files changed, 22 insertions, 15 deletions
diff --git a/gcc/tree-streamer-out.c b/gcc/tree-streamer-out.c index 4fccd77..73ffb30 100644 --- a/gcc/tree-streamer-out.c +++ b/gcc/tree-streamer-out.c @@ -145,7 +145,6 @@ pack_ts_fixed_cst_value_fields (struct bitpack_d *bp, tree expr) bp_pack_var_len_int (bp, fv.data.high); } - /* Pack all the non-pointer fields of the TS_DECL_COMMON structure of expression EXPR into bitpack BP. */ @@ -299,10 +298,18 @@ pack_ts_type_common_value_fields (struct bitpack_d *bp, tree expr) of expression EXPR into bitpack BP. */ static void -pack_ts_block_value_fields (struct bitpack_d *bp, tree expr) +pack_ts_block_value_fields (struct output_block *ob, + struct bitpack_d *bp, tree expr) { bp_pack_value (bp, BLOCK_ABSTRACT (expr), 1); /* BLOCK_NUMBER is recomputed. */ + /* Stream BLOCK_SOURCE_LOCATION for the limited cases we can handle - those + that represent inlined function scopes. + For the rest them on the floor instead of ICEing in dwarf2out.c. */ + if (inlined_function_outer_scope_p (expr)) + stream_output_location (ob, bp, BLOCK_SOURCE_LOCATION (expr)); + else + stream_output_location (ob, bp, UNKNOWN_LOCATION); } /* Pack all the non-pointer fields of the TS_TRANSLATION_UNIT_DECL structure @@ -317,7 +324,8 @@ pack_ts_translation_unit_decl_value_fields (struct bitpack_d *bp ATTRIBUTE_UNUSE /* Pack all the bitfields in EXPR into a bit pack. */ void -streamer_pack_tree_bitfields (struct bitpack_d *bp, tree expr) +streamer_pack_tree_bitfields (struct output_block *ob, + struct bitpack_d *bp, tree expr) { enum tree_code code; @@ -333,6 +341,9 @@ streamer_pack_tree_bitfields (struct bitpack_d *bp, tree expr) if (CODE_CONTAINS_STRUCT (code, TS_FIXED_CST)) pack_ts_fixed_cst_value_fields (bp, expr); + if (CODE_CONTAINS_STRUCT (code, TS_DECL_MINIMAL)) + stream_output_location (ob, bp, DECL_SOURCE_LOCATION (expr)); + if (CODE_CONTAINS_STRUCT (code, TS_DECL_COMMON)) pack_ts_decl_common_value_fields (bp, expr); @@ -348,8 +359,11 @@ streamer_pack_tree_bitfields (struct bitpack_d *bp, tree expr) if (CODE_CONTAINS_STRUCT (code, TS_TYPE_COMMON)) pack_ts_type_common_value_fields (bp, expr); + if (CODE_CONTAINS_STRUCT (code, TS_EXP)) + stream_output_location (ob, bp, EXPR_LOCATION (expr)); + if (CODE_CONTAINS_STRUCT (code, TS_BLOCK)) - pack_ts_block_value_fields (bp, expr); + pack_ts_block_value_fields (ob, bp, expr); if (CODE_CONTAINS_STRUCT (code, TS_TRANSLATION_UNIT_DECL)) pack_ts_translation_unit_decl_value_fields (bp, expr); @@ -476,7 +490,6 @@ write_ts_decl_minimal_tree_pointers (struct output_block *ob, tree expr, { stream_write_tree (ob, DECL_NAME (expr), ref_p); stream_write_tree (ob, DECL_CONTEXT (expr), ref_p); - lto_output_location (ob, LOCATION_LOCUS (DECL_SOURCE_LOCATION (expr))); } @@ -673,7 +686,6 @@ write_ts_exp_tree_pointers (struct output_block *ob, tree expr, bool ref_p) streamer_write_hwi (ob, TREE_OPERAND_LENGTH (expr)); for (i = 0; i < TREE_OPERAND_LENGTH (expr); i++) stream_write_tree (ob, TREE_OPERAND (expr, i), ref_p); - lto_output_location (ob, LOCATION_LOCUS (EXPR_LOCATION (expr))); stream_write_tree (ob, TREE_BLOCK (expr), ref_p); } @@ -689,21 +701,16 @@ write_ts_block_tree_pointers (struct output_block *ob, tree expr, bool ref_p) stream_write_tree (ob, BLOCK_SUPERCONTEXT (expr), ref_p); - /* Stream BLOCK_ABSTRACT_ORIGIN and BLOCK_SOURCE_LOCATION for - the limited cases we can handle - those that represent inlined - function scopes. For the rest them on the floor instead of ICEing in - dwarf2out.c. */ + /* Stream BLOCK_ABSTRACT_ORIGIN for the limited cases we can handle - those + that represent inlined function scopes. + For the rest them on the floor instead of ICEing in dwarf2out.c. */ if (inlined_function_outer_scope_p (expr)) { tree ultimate_origin = block_ultimate_origin (expr); stream_write_tree (ob, ultimate_origin, ref_p); - lto_output_location (ob, BLOCK_SOURCE_LOCATION (expr)); } else - { - stream_write_tree (ob, NULL_TREE, ref_p); - lto_output_location (ob, UNKNOWN_LOCATION); - } + stream_write_tree (ob, NULL_TREE, ref_p); /* Do not stream BLOCK_NONLOCALIZED_VARS. We cannot handle debug information for early inlined BLOCKs so drop it on the floor instead of ICEing in dwarf2out.c. */ |