aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorThomas Schwinge <thomas@codesourcery.com>2023-06-29 21:33:06 +0200
committerThomas Schwinge <thomas@codesourcery.com>2023-07-04 14:10:54 +0200
commitd7faf7a54e0598bd6d4042d855b7d7905d269470 (patch)
treecbb9b24fe00280f54d86a47f7361ad2e9670a978 /gcc
parent11350734240dbaf9dfe498ad0b7759a23f101ecc (diff)
downloadgcc-d7faf7a54e0598bd6d4042d855b7d7905d269470.zip
gcc-d7faf7a54e0598bd6d4042d855b7d7905d269470.tar.gz
gcc-d7faf7a54e0598bd6d4042d855b7d7905d269470.tar.bz2
LTO: Capture 'lto_file_decl_data *file_data' in 'class lto_input_block'
... instead of just 'unsigned char *mode_table'. Preparation for a forthcoming change, where we need to capture an additional 'file_data' item, so it seems easier to just capture that one proper. gcc/ * lto-streamer.h (class lto_input_block): Capture 'lto_file_decl_data *file_data' instead of just 'unsigned char *mode_table'. * ipa-devirt.cc (ipa_odr_read_section): Adjust. * ipa-fnsummary.cc (inline_read_section): Likewise. * ipa-icf.cc (sem_item_optimizer::read_section): Likewise. * ipa-modref.cc (read_section): Likewise. * ipa-prop.cc (ipa_prop_read_section, read_replacements_section): Likewise. * ipa-sra.cc (isra_read_summary_section): Likewise. * lto-cgraph.cc (input_cgraph_opt_section): Likewise. * lto-section-in.cc (lto_create_simple_input_block): Likewise. * lto-streamer-in.cc (lto_read_body_or_constructor) (lto_input_toplevel_asms): Likewise. * tree-streamer.h (bp_unpack_machine_mode): Likewise. gcc/lto/ * lto-common.cc (lto_read_decls): Adjust.
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ipa-devirt.cc2
-rw-r--r--gcc/ipa-fnsummary.cc2
-rw-r--r--gcc/ipa-icf.cc2
-rw-r--r--gcc/ipa-modref.cc2
-rw-r--r--gcc/ipa-prop.cc4
-rw-r--r--gcc/ipa-sra.cc2
-rw-r--r--gcc/lto-cgraph.cc2
-rw-r--r--gcc/lto-section-in.cc2
-rw-r--r--gcc/lto-streamer-in.cc6
-rw-r--r--gcc/lto-streamer.h10
-rw-r--r--gcc/lto/lto-common.cc2
-rw-r--r--gcc/tree-streamer.h6
12 files changed, 21 insertions, 21 deletions
diff --git a/gcc/ipa-devirt.cc b/gcc/ipa-devirt.cc
index 2c61a49..87529be 100644
--- a/gcc/ipa-devirt.cc
+++ b/gcc/ipa-devirt.cc
@@ -4147,7 +4147,7 @@ ipa_odr_read_section (struct lto_file_decl_data *file_data, const char *data,
class data_in *data_in;
lto_input_block ib ((const char *) data + main_offset, header->main_size,
- file_data->mode_table);
+ file_data);
data_in
= lto_data_in_create (file_data, (const char *) data + string_offset,
diff --git a/gcc/ipa-fnsummary.cc b/gcc/ipa-fnsummary.cc
index 53dee8f..f1244da2 100644
--- a/gcc/ipa-fnsummary.cc
+++ b/gcc/ipa-fnsummary.cc
@@ -4548,7 +4548,7 @@ inline_read_section (struct lto_file_decl_data *file_data, const char *data,
unsigned int f_count;
lto_input_block ib ((const char *) data + main_offset, header->main_size,
- file_data->mode_table);
+ file_data);
data_in =
lto_data_in_create (file_data, (const char *) data + string_offset,
diff --git a/gcc/ipa-icf.cc b/gcc/ipa-icf.cc
index cb9f768..836d091 100644
--- a/gcc/ipa-icf.cc
+++ b/gcc/ipa-icf.cc
@@ -2204,7 +2204,7 @@ sem_item_optimizer::read_section (lto_file_decl_data *file_data,
unsigned int count;
lto_input_block ib_main ((const char *) data + main_offset, 0,
- header->main_size, file_data->mode_table);
+ header->main_size, file_data);
data_in
= lto_data_in_create (file_data, (const char *) data + string_offset,
diff --git a/gcc/ipa-modref.cc b/gcc/ipa-modref.cc
index e3196df..278b2db 100644
--- a/gcc/ipa-modref.cc
+++ b/gcc/ipa-modref.cc
@@ -3816,7 +3816,7 @@ read_section (struct lto_file_decl_data *file_data, const char *data,
unsigned int f_count;
lto_input_block ib ((const char *) data + main_offset, header->main_size,
- file_data->mode_table);
+ file_data);
data_in
= lto_data_in_create (file_data, (const char *) data + string_offset,
diff --git a/gcc/ipa-prop.cc b/gcc/ipa-prop.cc
index 33bda82..d2b998f 100644
--- a/gcc/ipa-prop.cc
+++ b/gcc/ipa-prop.cc
@@ -5332,7 +5332,7 @@ ipa_prop_read_section (struct lto_file_decl_data *file_data, const char *data,
unsigned int count;
lto_input_block ib_main ((const char *) data + main_offset,
- header->main_size, file_data->mode_table);
+ header->main_size, file_data);
data_in =
lto_data_in_create (file_data, (const char *) data + string_offset,
@@ -5556,7 +5556,7 @@ read_replacements_section (struct lto_file_decl_data *file_data,
unsigned int count;
lto_input_block ib_main ((const char *) data + main_offset,
- header->main_size, file_data->mode_table);
+ header->main_size, file_data);
data_in = lto_data_in_create (file_data, (const char *) data + string_offset,
header->string_size, vNULL);
diff --git a/gcc/ipa-sra.cc b/gcc/ipa-sra.cc
index 21d281a..c35e03b 100644
--- a/gcc/ipa-sra.cc
+++ b/gcc/ipa-sra.cc
@@ -2944,7 +2944,7 @@ isra_read_summary_section (struct lto_file_decl_data *file_data,
unsigned int count;
lto_input_block ib_main ((const char *) data + main_offset,
- header->main_size, file_data->mode_table);
+ header->main_size, file_data);
data_in =
lto_data_in_create (file_data, (const char *) data + string_offset,
diff --git a/gcc/lto-cgraph.cc b/gcc/lto-cgraph.cc
index aed5e9d..32c0f5a 100644
--- a/gcc/lto-cgraph.cc
+++ b/gcc/lto-cgraph.cc
@@ -2174,7 +2174,7 @@ input_cgraph_opt_section (struct lto_file_decl_data *file_data,
unsigned int count;
lto_input_block ib_main ((const char *) data + main_offset,
- header->main_size, file_data->mode_table);
+ header->main_size, file_data);
data_in =
lto_data_in_create (file_data, (const char *) data + string_offset,
diff --git a/gcc/lto-section-in.cc b/gcc/lto-section-in.cc
index 07cf732..5ff00a3 100644
--- a/gcc/lto-section-in.cc
+++ b/gcc/lto-section-in.cc
@@ -262,7 +262,7 @@ lto_create_simple_input_block (struct lto_file_decl_data *file_data,
*datar = data;
return new lto_input_block (data + main_offset, header->main_size,
- file_data->mode_table);
+ file_data);
}
diff --git a/gcc/lto-streamer-in.cc b/gcc/lto-streamer-in.cc
index 2cb8340..6e8bc95 100644
--- a/gcc/lto-streamer-in.cc
+++ b/gcc/lto-streamer-in.cc
@@ -1629,11 +1629,11 @@ lto_read_body_or_constructor (struct lto_file_decl_data *file_data, struct symta
/* Set up the struct function. */
from = data_in->reader_cache->nodes.length ();
lto_input_block ib_main (data + main_offset, header->main_size,
- file_data->mode_table);
+ file_data);
if (TREE_CODE (node->decl) == FUNCTION_DECL)
{
lto_input_block ib_cfg (data + cfg_offset, header->cfg_size,
- file_data->mode_table);
+ file_data);
input_function (fn_decl, data_in, &ib_main, &ib_cfg,
dyn_cast <cgraph_node *>(node));
}
@@ -1954,7 +1954,7 @@ lto_input_toplevel_asms (struct lto_file_decl_data *file_data, int order_base)
string_offset = sizeof (*header) + header->main_size;
lto_input_block ib (data + sizeof (*header), header->main_size,
- file_data->mode_table);
+ file_data);
data_in = lto_data_in_create (file_data, data + string_offset,
header->string_size, vNULL);
diff --git a/gcc/lto-streamer.h b/gcc/lto-streamer.h
index fc7133d..2913b80 100644
--- a/gcc/lto-streamer.h
+++ b/gcc/lto-streamer.h
@@ -344,14 +344,14 @@ public:
/* Special constructor for the string table, it abuses this to
do random access but use the uhwi decoder. */
lto_input_block (const char *data_, unsigned int p_, unsigned int len_,
- const unsigned char *mode_table_)
- : data (data_), mode_table (mode_table_), p (p_), len (len_) {}
+ const lto_file_decl_data *file_data_)
+ : data (data_), file_data (file_data_), p (p_), len (len_) {}
lto_input_block (const char *data_, unsigned int len_,
- const unsigned char *mode_table_)
- : data (data_), mode_table (mode_table_), p (0), len (len_) {}
+ const lto_file_decl_data *file_data_)
+ : data (data_), file_data (file_data_), p (0), len (len_) {}
const char *data;
- const unsigned char *mode_table;
+ const lto_file_decl_data *file_data;
unsigned int p;
unsigned int len;
};
diff --git a/gcc/lto/lto-common.cc b/gcc/lto/lto-common.cc
index 97105c9..cdb37c8 100644
--- a/gcc/lto/lto-common.cc
+++ b/gcc/lto/lto-common.cc
@@ -1883,7 +1883,7 @@ lto_read_decls (struct lto_file_decl_data *decl_data, const void *data,
uint32_t num_decl_states;
lto_input_block ib_main ((const char *) data + main_offset,
- header->main_size, decl_data->mode_table);
+ header->main_size, decl_data);
data_in = lto_data_in_create (decl_data, (const char *) data + string_offset,
header->string_size, resolutions);
diff --git a/gcc/tree-streamer.h b/gcc/tree-streamer.h
index 170d61c..6d565ac 100644
--- a/gcc/tree-streamer.h
+++ b/gcc/tree-streamer.h
@@ -114,9 +114,9 @@ bp_pack_machine_mode (struct bitpack_d *bp, machine_mode mode)
inline machine_mode
bp_unpack_machine_mode (struct bitpack_d *bp)
{
- return (machine_mode)
- ((class lto_input_block *)
- bp->stream)->mode_table[bp_unpack_enum (bp, machine_mode, 1 << 8)];
+ lto_input_block *ib = (class lto_input_block *) bp->stream;
+ unsigned ix = bp_unpack_enum (bp, machine_mode, 1 << 8);
+ return (machine_mode) ib->file_data->mode_table[ix];
}
#endif /* GCC_TREE_STREAMER_H */