diff options
author | Jan Hubicka <jh@suse.cz> | 2010-05-15 01:39:39 +0200 |
---|---|---|
committer | Jan Hubicka <hubicka@gcc.gnu.org> | 2010-05-14 23:39:39 +0000 |
commit | 4a444e581667f110bfa936aa8d364cd751237770 (patch) | |
tree | 8b66371ae30124b7de964c08882e02d1b3128842 /gcc/cgraph.h | |
parent | c13af44bcc9d9435b4a537d189e5d3b6edffe7fe (diff) | |
download | gcc-4a444e581667f110bfa936aa8d364cd751237770.zip gcc-4a444e581667f110bfa936aa8d364cd751237770.tar.gz gcc-4a444e581667f110bfa936aa8d364cd751237770.tar.bz2 |
cgraph.h (ipa_discover_readonly_nonaddressable_vars): Declare.
* cgraph.h (ipa_discover_readonly_nonaddressable_vars): Declare.
(varpool_all_refs_explicit_p): New inline function.
* ipa-reference.c: Update comment.
(module_statics_written): Remove.
(get_static_decl): Remove.
(ipa_init): Do not initialize module_statics_written.
(analyze_function): Likewise.
(generate_summary): Likewise; do not compute module_statics_readonly
and do not update variable flags.
(propagate): Call ipa_discover_readonly_nonaddressable_vars.
* ipa.c: Inlucde flags.h
(cgraph_local_node_p): New.
(cgraph_remove_unreachable_nodes): Return early when not optimizing;
promote functions to local.
(ipa_discover_readonly_nonaddressable_vars): New function.
(function_and_variable_visibility): Use cgraph_local_node_p.
* varpool.c (varpool_finalize_decl): Set force_output for
DECL_PRESERVE_P vars.
From-SVN: r159421
Diffstat (limited to 'gcc/cgraph.h')
-rw-r--r-- | gcc/cgraph.h | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/gcc/cgraph.h b/gcc/cgraph.h index 1ccae09..6348033 100644 --- a/gcc/cgraph.h +++ b/gcc/cgraph.h @@ -644,6 +644,7 @@ void varpool_node_set_add (varpool_node_set, struct varpool_node *); void varpool_node_set_remove (varpool_node_set, struct varpool_node *); void dump_varpool_node_set (FILE *, varpool_node_set); void debug_varpool_node_set (varpool_node_set); +void ipa_discover_readonly_nonaddressable_vars (void); /* In predict.c */ bool cgraph_maybe_hot_edge_p (struct cgraph_edge *e); @@ -878,6 +879,19 @@ cgraph_can_remove_if_no_direct_calls_p (struct cgraph_node *node) return !node->address_taken && cgraph_can_remove_if_no_direct_calls_and_refs_p (node); } +/* Return true when all references to VNODE must be visible in ipa_ref_list. + i.e. if the variable is not externally visible or not used in some magic + way (asm statement or such). + The magic uses are all sumarized in force_output flag. */ + +static inline bool +varpool_all_refs_explicit_p (struct varpool_node *vnode) +{ + return (!vnode->externally_visible + && !vnode->used_from_other_partition + && !vnode->force_output); +} + /* Constant pool accessor function. */ htab_t constant_pool_htab (void); |