summaryrefslogtreecommitdiff
path: root/gcc/compiler-probe.c
diff options
context:
space:
mode:
authorbstarynk <bstarynk@138bc75d-0d04-0410-961f-82ee72b054a4>2009-05-07 13:32:51 +0000
committerbstarynk <bstarynk@138bc75d-0d04-0410-961f-82ee72b054a4>2009-05-07 13:32:51 +0000
commit4e9adeea5667e56738817e9ccb26316576eabb60 (patch)
tree4879e1538f9705d052c8148e678e6929584b8da6 /gcc/compiler-probe.c
parentc789d03839a7a90a88e0ca6758788263fc8524cb (diff)
downloadgcc-4e9adeea5667e56738817e9ccb26316576eabb60.tar.gz
2009-05-07 Basile Starynkevitch <basile@starynkevitch.net>
* gcc/compiler-probe.c (hash_info_tree): replacing switch by ifs and more casts in pointer compare to suppress warnings. (hash_info_bb, hash_info_gimple): likewise. (pass_compiler_probe): use TV_NONE instead of 0 to avoid warning. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/melt-branch@147236 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/compiler-probe.c')
-rw-r--r--gcc/compiler-probe.c74
1 files changed, 34 insertions, 40 deletions
diff --git a/gcc/compiler-probe.c b/gcc/compiler-probe.c
index 44b803b576a..516da2d570d 100644
--- a/gcc/compiler-probe.c
+++ b/gcc/compiler-probe.c
@@ -303,23 +303,21 @@ static hashval_t
hash_info_tree (const void *d)
{
comprobe_ix_t lg = (comprobe_ix_t) d;
- switch (lg)
+ if ( (const void*) d == (const void*) HTAB_EMPTY_ENTRY
+ || (const void*) d == (const void*) HTAB_DELETED_ENTRY)
+ return (hashval_t) 0;
+ else if ( (const void*) d == (const void*) HTAB_SEEKED_ENTRY)
{
- case (comprobe_ix_t) HTAB_EMPTY_ENTRY:
- case (comprobe_ix_t) HTAB_DELETED_ENTRY:
- return (hashval_t) 0;
- case (comprobe_ix_t) HTAB_SEEKED_ENTRY:
lg = (comprobe_ix_t) unique_seeked_tree;
return (hashval_t) (lg ^ (lg >> 10));
- default:
- if (lg > 2 && unique_tree_vector
- && lg < VEC_length (tree, unique_tree_vector))
- {
- lg = (comprobe_ix_t) VEC_index (tree, unique_tree_vector, lg);
- return (hashval_t) (lg ^ (lg >> 10));
- };
- return 0;
- }
+ };
+ if (lg > 2 && unique_tree_vector
+ && lg < VEC_length (tree, unique_tree_vector))
+ {
+ lg = (comprobe_ix_t) VEC_index (tree, unique_tree_vector, lg);
+ return (hashval_t) (lg ^ (lg >> 10));
+ };
+ return 0;
}
@@ -408,23 +406,21 @@ static hashval_t
hash_info_bb (const void *d)
{
comprobe_ix_t lg = (comprobe_ix_t) d;
- switch (lg)
+ if ((const void*) d == (const void*) HTAB_EMPTY_ENTRY
+ || (const void*) d == (const void*) HTAB_DELETED_ENTRY)
+ return (hashval_t) 0;
+ else if ((const void*) d == (const void*) HTAB_SEEKED_ENTRY)
{
- case (comprobe_ix_t) HTAB_EMPTY_ENTRY:
- case (comprobe_ix_t) HTAB_DELETED_ENTRY:
- return (hashval_t) 0;
- case (comprobe_ix_t) HTAB_SEEKED_ENTRY:
lg = (comprobe_ix_t) unique_seeked_bb;
return (hashval_t) (lg ^ (lg >> 10));
- default:
- if (lg > 2 && unique_bb_vector
+ }
+ else if (lg > 2 && unique_bb_vector
&& lg < VEC_length (basic_block, unique_bb_vector))
- {
- lg = (comprobe_ix_t) VEC_index (basic_block, unique_bb_vector, lg);
- return (hashval_t) (lg ^ (lg >> 10));
- };
+ {
+ lg = (comprobe_ix_t) VEC_index (basic_block, unique_bb_vector, lg);
+ return (hashval_t) (lg ^ (lg >> 10));
+ };
return 0;
- }
}
@@ -461,23 +457,21 @@ static hashval_t
hash_info_gimple (const void *d)
{
comprobe_ix_t lg = (comprobe_ix_t) d;
- switch (lg)
+ if ((const void*) d == (const void*) HTAB_EMPTY_ENTRY
+ || (const void*) d == HTAB_DELETED_ENTRY)
+ return (hashval_t) 0;
+ else if ((const void*) d == (const void*) HTAB_SEEKED_ENTRY)
{
- case (comprobe_ix_t) HTAB_EMPTY_ENTRY:
- case (comprobe_ix_t) HTAB_DELETED_ENTRY:
- return (hashval_t) 0;
- case (comprobe_ix_t) HTAB_SEEKED_ENTRY:
lg = (comprobe_ix_t) unique_seeked_gimple;
return (hashval_t) (lg ^ (lg >> 10));
- default:
- if (lg > 2 && unique_gimple_vector
- && lg < VEC_length (gimple, unique_gimple_vector))
- {
- lg = (comprobe_ix_t) VEC_index (gimple, unique_gimple_vector, lg);
- return (hashval_t) (lg ^ (lg >> 10));
- };
- return 0;
}
+ else if (lg > 2 && unique_gimple_vector
+ && lg < VEC_length (gimple, unique_gimple_vector))
+ {
+ lg = (comprobe_ix_t) VEC_index (gimple, unique_gimple_vector, lg);
+ return (hashval_t) (lg ^ (lg >> 10));
+ };
+ return 0;
}
@@ -2403,7 +2397,7 @@ struct gimple_opt_pass pass_compiler_probe = {
NULL, /* sub */
NULL, /* next */
0, /* static_pass_number */
- 0, /* tv_id */
+ TV_NONE, /* tv_id */
PROP_cfg, /* properties_required */
0, /* properties_provided */
0, /* properties_destroyed */