diff options
author | jamborm <jamborm@138bc75d-0d04-0410-961f-82ee72b054a4> | 2008-07-07 19:06:28 +0000 |
---|---|---|
committer | jamborm <jamborm@138bc75d-0d04-0410-961f-82ee72b054a4> | 2008-07-07 19:06:28 +0000 |
commit | dd1c91571a66d7e9917e7bde989fc343ee5f6cc3 (patch) | |
tree | 61b998ffc2d6713cc2e2c2ee4e3b71ae3e4fafdc /gcc/cgraph.h | |
parent | 4b15d28a82d466efa032ca62097154b1310d1f41 (diff) | |
download | ppe42-gcc-dd1c91571a66d7e9917e7bde989fc343ee5f6cc3.tar.gz ppe42-gcc-dd1c91571a66d7e9917e7bde989fc343ee5f6cc3.zip |
2008-07-07 Martin Jambor <mjambor@suse.cz>
* cgraph.c (cgraph_edge_max_uid): New variable.
(struct cgraph_edge_hook_list): New type.
(struct cgraph_node_hook_list): New type.
(struct cgraph_2edge_hook_list): New type.
(struct cgraph_2node_hook_list): New type.
(first_cgraph_edge_removal_hook): New variable.
(first_cgraph_node_removal_hook): New variable.
(first_cgraph_edge_duplicated_hook): New variable.
(first_cgraph_node_duplicated_hook): New variable.
(cgraph_add_edge_removal_hook): New function.
(cgraph_remove_edge_removal_hook): New function.
(cgraph_call_edge_removal_hooks): New function.
(cgraph_add_node_removal_hook): New function.
(cgraph_remove_node_removal_hook): New function.
(cgraph_call_node_removal_hooks): New function.
(cgraph_add_edge_duplication_hook): New function.
(cgraph_remove_edge_duplication_hook): New function.
(cgraph_call_edge_duplication_hooks): New function.
(cgraph_add_node_duplication_hook): New function.
(cgraph_remove_node_duplication_hook): New function.
(cgraph_call_node_duplication_hooks): New function.
(cgraph_create_edge): Assign to edge uid.
(cgraph_remove_edge): Call edge removal hooks.
(cgraph_node_remove_callees): Call edge removal hooks.
(cgraph_node_remove_callers): Call edge removal hooks.
(cgraph_remove_node): Call node removal hooks.
(cgraph_clone_edge): Call edge duplication hooks.
(cgraph_clone_node): Call node duplication hooks.
* cgraph.h (cgraph_edge): New field uid.
(cgraph_edge_hook): New type.
(cgraph_node_hook): New type.
(cgraph_2edge_hook): New type.
(cgraph_2node_hook): New type.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@137591 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cgraph.h')
-rw-r--r-- | gcc/cgraph.h | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/gcc/cgraph.h b/gcc/cgraph.h index dda2a1891f5..ee79c9200f1 100644 --- a/gcc/cgraph.h +++ b/gcc/cgraph.h @@ -209,6 +209,8 @@ struct cgraph_edge GTY((chain_next ("%h.next_caller"), chain_prev ("%h.prev_call int frequency; /* Depth of loop nest, 1 means no loop nest. */ int loop_nest; + /* Unique id of the edge. */ + int uid; }; #define CGRAPH_FREQ_BASE 1000 @@ -266,6 +268,7 @@ struct cgraph_asm_node GTY(()) extern GTY(()) struct cgraph_node *cgraph_nodes; extern GTY(()) int cgraph_n_nodes; extern GTY(()) int cgraph_max_uid; +extern GTY(()) int cgraph_edge_max_uid; extern GTY(()) int cgraph_max_pid; extern bool cgraph_global_info_ready; enum cgraph_state @@ -351,6 +354,26 @@ struct cgraph_node *save_inline_function_body (struct cgraph_node *); void record_references_in_initializer (tree); bool cgraph_process_new_functions (void); +typedef void (*cgraph_edge_hook)(struct cgraph_edge *, void *); +typedef void (*cgraph_node_hook)(struct cgraph_node *, void *); +typedef void (*cgraph_2edge_hook)(struct cgraph_edge *, struct cgraph_edge *, + void *); +typedef void (*cgraph_2node_hook)(struct cgraph_node *, struct cgraph_node *, + void *); +struct cgraph_edge_hook_list; +struct cgraph_node_hook_list; +struct cgraph_2edge_hook_list; +struct cgraph_2node_hook_list; +struct cgraph_edge_hook_list *cgraph_add_edge_removal_hook (cgraph_edge_hook, void *); +void cgraph_remove_edge_removal_hook (struct cgraph_edge_hook_list *); +struct cgraph_node_hook_list *cgraph_add_node_removal_hook (cgraph_node_hook, + void *); +void cgraph_remove_node_removal_hook (struct cgraph_node_hook_list *); +struct cgraph_2edge_hook_list *cgraph_add_edge_duplication_hook (cgraph_2edge_hook, void *); +void cgraph_remove_edge_duplication_hook (struct cgraph_2edge_hook_list *); +struct cgraph_2node_hook_list *cgraph_add_node_duplication_hook (cgraph_2node_hook, void *); +void cgraph_remove_node_duplication_hook (struct cgraph_2node_hook_list *); + /* In cgraphbuild.c */ unsigned int rebuild_cgraph_edges (void); |