aboutsummaryrefslogtreecommitdiff
path: root/gcc/ipa-icf.h
diff options
context:
space:
mode:
authorMartin Liska <mliska@suse.cz>2019-11-14 09:35:25 +0100
committerMartin Liska <marxin@gcc.gnu.org>2019-11-14 08:35:25 +0000
commita37f58f506e436bdf8f4f5be4afbf2d246538058 (patch)
treed38650119a98e2f0c28c37b44b54bf5daa1344a2 /gcc/ipa-icf.h
parent5d0152bf59a626fd01b64c95bb8d91d890d93820 (diff)
downloadgcc-a37f58f506e436bdf8f4f5be4afbf2d246538058.zip
gcc-a37f58f506e436bdf8f4f5be4afbf2d246538058.tar.gz
gcc-a37f58f506e436bdf8f4f5be4afbf2d246538058.tar.bz2
Use func_checker::hash_operand for hashing of GIMPLE operands.
2019-11-14 Martin Liska <mliska@suse.cz> * ipa-icf-gimple.h (func_checker::func_checker): Add default constructor. * ipa-icf.c (sem_function::init): Make operand_equal_p and hash_operand public. (sem_item::add_expr): Remove. (sem_item::add_type): Remove. (sem_function::hash_stmt): Use m_checker for hashing of GIMPLE statements. (sem_function::parse): Init with checker. (sem_variable::parse): Pass NULL as checker. (sem_item_optimizer::parse_funcs_and_vars): Pass checker to ::parse function. (sem_item_optimizer::parse_nonsingleton_classes): Likewise. (sem_variable::parse): New function. (sem_variable::get_hash): Only return computed hash value. (sem_variable::init): Initialize hash of a variable. * ipa-icf.h: Remove add_expr, add_type and add func_checker to couple of functions as a new argument. From-SVN: r278207
Diffstat (limited to 'gcc/ipa-icf.h')
-rw-r--r--gcc/ipa-icf.h20
1 files changed, 7 insertions, 13 deletions
diff --git a/gcc/ipa-icf.h b/gcc/ipa-icf.h
index 0b99a61..9060022 100644
--- a/gcc/ipa-icf.h
+++ b/gcc/ipa-icf.h
@@ -191,7 +191,7 @@ public:
DEBUG_FUNCTION void dump (void);
/* Semantic item initialization function. */
- virtual void init (void) = 0;
+ virtual void init (ipa_icf_gimple::func_checker *) = 0;
/* Add reference to a semantic TARGET. */
void add_reference (ref_map *map, sem_item *target);
@@ -269,11 +269,6 @@ public:
protected:
/* Cached, once calculated hash for the item. */
- /* Accumulate to HSTATE a hash of expression EXP. */
- static void add_expr (const_tree exp, inchash::hash &hstate);
- /* Accumulate to HSTATE a hash of type T. */
- static void add_type (const_tree t, inchash::hash &hstate);
-
/* Compare properties of symbol that does not affect semantics of symbol
itself but affects semantics of its references.
If ADDRESS is true, do extra checking needed for IPA_REF_ADDR. */
@@ -322,7 +317,7 @@ public:
~sem_function ();
- virtual void init (void);
+ virtual void init (ipa_icf_gimple::func_checker *);
virtual bool equals_wpa (sem_item *item,
hash_map <symtab_node *, sem_item *> &ignored_nodes);
virtual hashval_t get_hash (void);
@@ -351,7 +346,8 @@ public:
/* For a given call graph NODE, the function constructs new
semantic function item. */
- static sem_function *parse (cgraph_node *node, bitmap_obstack *stack);
+ static sem_function *parse (cgraph_node *node, bitmap_obstack *stack,
+ ipa_icf_gimple::func_checker *checker);
/* Perform additional checks needed to match types of used function
paramters. */
@@ -423,10 +419,7 @@ public:
sem_variable (varpool_node *_node, bitmap_obstack *stack);
/* Semantic variable initialization function. */
- inline virtual void init (void)
- {
- decl = get_node ()->decl;
- }
+ virtual void init (ipa_icf_gimple::func_checker *);
virtual hashval_t get_hash (void);
virtual bool merge (sem_item *alias_item);
@@ -445,7 +438,8 @@ public:
}
/* Parser function that visits a varpool NODE. */
- static sem_variable *parse (varpool_node *node, bitmap_obstack *stack);
+ static sem_variable *parse (varpool_node *node, bitmap_obstack *stack,
+ ipa_icf_gimple::func_checker *checker);
private:
/* Compares trees T1 and T2 for semantic equality. */