diff options
Diffstat (limited to 'gcc/symtab-thunks.cc')
-rw-r--r-- | gcc/symtab-thunks.cc | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/gcc/symtab-thunks.cc b/gcc/symtab-thunks.cc index 1a4aaa2..2199f4e 100644 --- a/gcc/symtab-thunks.cc +++ b/gcc/symtab-thunks.cc @@ -52,6 +52,14 @@ along with GCC; see the file COPYING3. If not see /* Used for vtable lookup in thunk adjusting. */ static GTY (()) tree vtable_entry_type; +struct GTY (()) unprocessed_thunk +{ + cgraph_node *node; + thunk_info *info; +}; +/* To be PCH safe we store thunks into a vector before end of compilation + unit. */ +static GTY (()) vec<unprocessed_thunk, va_gc> *thunks; namespace { @@ -147,6 +155,33 @@ thunk_info::hash () return hstate.end (); } +/* Add unprocessed thunk. */ +void +thunk_info::register_early (cgraph_node *node) +{ + unprocessed_thunk entry = {node, new (ggc_alloc <thunk_info> ()) thunk_info}; + *entry.info = *this; + vec_safe_push (thunks, entry); +} + +/* Attach recorded thunks to cgraph_nodes. + All this is done only to avoid need to stream summaries to PCH. */ +void +thunk_info::process_early_thunks () +{ + unprocessed_thunk *e; + unsigned int i; + if (!thunks) + return; + + FOR_EACH_VEC_ELT (*thunks, i, e) + { + *thunk_info::get_create (e->node) = *e->info; + } + vec_free (thunks); + thunks = NULL; +} + /* Adjust PTR by the constant FIXED_OFFSET, by the vtable offset indicated by VIRTUAL_OFFSET, and by the indirect offset indicated by INDIRECT_OFFSET, if it is non-null. THIS_ADJUSTING is nonzero for a this adjusting thunk and zero |