diff options
author | Jan Hubicka <hubicka@ucw.cz> | 2018-12-15 22:24:52 +0100 |
---|---|---|
committer | Jan Hubicka <hubicka@gcc.gnu.org> | 2018-12-15 21:24:52 +0000 |
commit | f714ecf522782f76d7d9d9826fe1bcd23259cf24 (patch) | |
tree | cad3aa0fcf39b65a7a9442f8e128039691dc8f65 /gcc/cgraph.h | |
parent | 6263c29d28abb099cb835ca373aa234ef36df6a2 (diff) | |
download | gcc-f714ecf522782f76d7d9d9826fe1bcd23259cf24.zip gcc-f714ecf522782f76d7d9d9826fe1bcd23259cf24.tar.gz gcc-f714ecf522782f76d7d9d9826fe1bcd23259cf24.tar.bz2 |
cgraph.h (cgraph_node): Add predicate prevailing_p.
* cgraph.h (cgraph_node): Add predicate prevailing_p.
(cgraph_edge): Add predicate possible_call_in_translation_unit_p.
* ipa-prop.c (ipa_write_jump_function): Optimize streaming of ADDR_EXPR.
(ipa_read_jump_function): Add prevails parameter; optimize streaming.
(ipa_read_edge_info): Break out from ...
(ipa_read_node_info): ... here; optimize streaming.
* cgraph.c (cgraph_edge::possibly_call_in_translation_unit_p): New
predicate.
From-SVN: r267175
Diffstat (limited to 'gcc/cgraph.h')
-rw-r--r-- | gcc/cgraph.h | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/gcc/cgraph.h b/gcc/cgraph.h index b8e23cc..51cea06 100644 --- a/gcc/cgraph.h +++ b/gcc/cgraph.h @@ -308,6 +308,10 @@ public: /* Return availability of NODE when referenced from REF. */ enum availability get_availability (symtab_node *ref = NULL); + /* During LTO stream-in this predicate can be used to check whether node + in question prevails in the linking to save some memory usage. */ + bool prevailing_p (void); + /* Return true if NODE binds to current definition in final executable when referenced from REF. If REF is NULL return conservative value for any reference. */ @@ -1730,6 +1734,10 @@ struct GTY((chain_next ("%h.next_caller"), chain_prev ("%h.prev_caller"), after passes that don't update the cgraph. */ static void rebuild_references (void); + /* During LTO stream in this can be used to check whether call can possibly + be internal to the current translation unit. */ + bool possibly_call_in_translation_unit_p (void); + /* Expected number of executions: calculated in profile.c. */ profile_count count; cgraph_node *caller; @@ -3357,6 +3365,15 @@ xstrdup_for_dump (const char *transient_str) return ggc_strdup (transient_str); } +/* During LTO stream-in this predicate can be used to check whether node + in question prevails in the linking to save some memory usage. */ +inline bool +symtab_node::prevailing_p (void) +{ + return definition && ((!TREE_PUBLIC (decl) && !DECL_EXTERNAL (decl)) + || previous_sharing_asm_name == NULL); +} + extern GTY(()) symbol_table *saved_symtab; #if CHECKING_P |