Mercurial > hg > CbC > CbC_gcc
comparison gcc/gimple-streamer-out.c @ 145:1830386684a0
gcc-9.2.0
author | anatofuz |
---|---|
date | Thu, 13 Feb 2020 11:34:05 +0900 |
parents | 84e7813d76e9 |
children |
comparison
equal
deleted
inserted
replaced
131:84e7813d76e9 | 145:1830386684a0 |
---|---|
1 /* Routines for emitting GIMPLE to a file stream. | 1 /* Routines for emitting GIMPLE to a file stream. |
2 | 2 |
3 Copyright (C) 2011-2018 Free Software Foundation, Inc. | 3 Copyright (C) 2011-2020 Free Software Foundation, Inc. |
4 Contributed by Diego Novillo <dnovillo@google.com> | 4 Contributed by Diego Novillo <dnovillo@google.com> |
5 | 5 |
6 This file is part of GCC. | 6 This file is part of GCC. |
7 | 7 |
8 GCC is free software; you can redistribute it and/or modify it under | 8 GCC is free software; you can redistribute it and/or modify it under |
55 | 55 |
56 | 56 |
57 /* Emit statement STMT on the main stream of output block OB. */ | 57 /* Emit statement STMT on the main stream of output block OB. */ |
58 | 58 |
59 static void | 59 static void |
60 output_gimple_stmt (struct output_block *ob, gimple *stmt) | 60 output_gimple_stmt (struct output_block *ob, struct function *fn, gimple *stmt) |
61 { | 61 { |
62 unsigned i; | 62 unsigned i; |
63 enum gimple_code code; | 63 enum gimple_code code; |
64 enum LTO_tags tag; | 64 enum LTO_tags tag; |
65 struct bitpack_d bp; | 65 struct bitpack_d bp; |
78 bp_pack_value (&bp, | 78 bp_pack_value (&bp, |
79 gimple_assign_nontemporal_move_p ( | 79 gimple_assign_nontemporal_move_p ( |
80 as_a <gassign *> (stmt)), | 80 as_a <gassign *> (stmt)), |
81 1); | 81 1); |
82 bp_pack_value (&bp, gimple_has_volatile_ops (stmt), 1); | 82 bp_pack_value (&bp, gimple_has_volatile_ops (stmt), 1); |
83 hist = gimple_histogram_value (cfun, stmt); | 83 hist = gimple_histogram_value (fn, stmt); |
84 bp_pack_value (&bp, hist != NULL, 1); | 84 bp_pack_value (&bp, hist != NULL, 1); |
85 bp_pack_var_len_unsigned (&bp, stmt->subcode); | 85 bp_pack_var_len_unsigned (&bp, stmt->subcode); |
86 | 86 |
87 /* Emit location information for the statement. */ | 87 /* Emit location information for the statement. */ |
88 stream_output_location (ob, &bp, LOCATION_LOCUS (gimple_location (stmt))); | 88 stream_output_location (ob, &bp, LOCATION_LOCUS (gimple_location (stmt))); |
137 tree *basep = NULL; | 137 tree *basep = NULL; |
138 /* Wrap all uses of non-automatic variables inside MEM_REFs | 138 /* Wrap all uses of non-automatic variables inside MEM_REFs |
139 so that we do not have to deal with type mismatches on | 139 so that we do not have to deal with type mismatches on |
140 merged symbols during IL read in. The first operand | 140 merged symbols during IL read in. The first operand |
141 of GIMPLE_DEBUG must be a decl, not MEM_REF, though. */ | 141 of GIMPLE_DEBUG must be a decl, not MEM_REF, though. */ |
142 if (op && (i || !is_gimple_debug (stmt))) | 142 if (!flag_wpa && op && (i || !is_gimple_debug (stmt))) |
143 { | 143 { |
144 basep = &op; | 144 basep = &op; |
145 if (TREE_CODE (*basep) == ADDR_EXPR) | 145 if (TREE_CODE (*basep) == ADDR_EXPR) |
146 basep = &TREE_OPERAND (*basep, 0); | 146 basep = &TREE_OPERAND (*basep, 0); |
147 while (handled_component_p (*basep)) | 147 while (handled_component_p (*basep)) |
148 basep = &TREE_OPERAND (*basep, 0); | 148 basep = &TREE_OPERAND (*basep, 0); |
149 if (VAR_P (*basep) | 149 if (VAR_P (*basep) |
150 && !auto_var_in_fn_p (*basep, current_function_decl) | 150 && !auto_var_in_fn_p (*basep, fn->decl) |
151 && !DECL_REGISTER (*basep)) | 151 && !DECL_REGISTER (*basep)) |
152 { | 152 { |
153 bool volatilep = TREE_THIS_VOLATILE (*basep); | 153 bool volatilep = TREE_THIS_VOLATILE (*basep); |
154 tree ptrtype = build_pointer_type (TREE_TYPE (*basep)); | 154 tree ptrtype = build_pointer_type (TREE_TYPE (*basep)); |
155 *basep = build2 (MEM_REF, TREE_TYPE (*basep), | 155 *basep = build2 (MEM_REF, TREE_TYPE (*basep), |
226 { | 226 { |
227 fprintf (streamer_dump_file, " Streaming gimple stmt "); | 227 fprintf (streamer_dump_file, " Streaming gimple stmt "); |
228 print_gimple_stmt (streamer_dump_file, stmt, 0, TDF_SLIM); | 228 print_gimple_stmt (streamer_dump_file, stmt, 0, TDF_SLIM); |
229 } | 229 } |
230 | 230 |
231 output_gimple_stmt (ob, stmt); | 231 output_gimple_stmt (ob, fn, stmt); |
232 | 232 |
233 /* Emit the EH region holding STMT. */ | 233 /* Emit the EH region holding STMT. */ |
234 region = lookup_stmt_eh_lp_fn (fn, stmt); | 234 region = lookup_stmt_eh_lp_fn (fn, stmt); |
235 if (region != 0) | 235 if (region != 0) |
236 { | 236 { |