diff options
author | Ian Lance Taylor <ian@gcc.gnu.org> | 2006-01-17 07:04:20 +0000 |
---|---|---|
committer | Ian Lance Taylor <ian@gcc.gnu.org> | 2006-01-17 07:04:20 +0000 |
commit | 474eccc60315960b14fb0af4b7da9c6795ac4f0e (patch) | |
tree | 11320048997fd124915d16755d4d699f94cce278 /gcc/cgraph.h | |
parent | 2fbdae3614e1e34d29ca5ce2af89739e39e305bd (diff) | |
download | gcc-474eccc60315960b14fb0af4b7da9c6795ac4f0e.zip gcc-474eccc60315960b14fb0af4b7da9c6795ac4f0e.tar.gz gcc-474eccc60315960b14fb0af4b7da9c6795ac4f0e.tar.bz2 |
common.opt (ftoplevel-reorder): New option.
./: * common.opt (ftoplevel-reorder): New option.
* cgraph.c (cgraph_asm_nodes): New global variable.
(cgraph_asm_last_node): New static variable.
(cgraph_order): New global variable.
(cgraph_create_node): Set new order field.
(cgraph_varpool_node): Likewise.
(decide_is_variable_needed): Return true if not
flag_toplevel_reorder.
(cgraph_add_asm_node): New function.
* cgraph.h (struct cgraph_node): Add order field.
(struct cgraph_varpool_node): Add order field.
(struct cgraph_asm_node): Define.
(cgraph_asm_nodes, cgraph_order): Declare.
(cgraph_add_asm_node): Declare.
* cgraphunit.c (cgraph_varpool_assemble_decl): New static
function.
(cgraph_varpool_assemble_pending_decls): Call it.
(cgraph_output_pending_asms): New static function.
(cgraph_finalize_compilation_unit): Call it.
(struct cgraph_order_sort): Define.
(cgraph_output_in_order): New static function.
(cgraph_optimize): Call cgraph_output_pending_asms. Add code for
!flag_toplevel_reorder case.
* c-parser.c: Include "cgraph.h".
(c_parser_asm_definition): Call cgraph_add_asm_node rather than
assemble_asm.
* Makefile.in (CRTSTUFF_CFLAGS): Use -fno-toplevel-reorder rather
than -fno-unit-at-a-time.
* doc/invoke.texi (Option Summary): Mention
-fno-toplevel-reorder.
(Optimize Options): Document -fno-toplevel-reorder. Mention it in
-funit-at-a-time documentation.
cp/:
* parser.c: Include "cgraph.h".
(cp_parser_asm_definition): Call cgraph_add_asm_node rather than
assemble_asm.
From-SVN: r109811
Diffstat (limited to 'gcc/cgraph.h')
-rw-r--r-- | gcc/cgraph.h | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/gcc/cgraph.h b/gcc/cgraph.h index 78b0fad..82cf2d9 100644 --- a/gcc/cgraph.h +++ b/gcc/cgraph.h @@ -144,6 +144,8 @@ struct cgraph_node GTY((chain_next ("%h.next"), chain_prev ("%h.previous"))) gcov_type count; /* Unique id of the node. */ int uid; + /* Ordering of all cgraph nodes. */ + int order; /* Set when function must be output - it is externally visible or its address is taken. */ bool needed; @@ -197,6 +199,8 @@ struct cgraph_varpool_node GTY(()) struct cgraph_varpool_node *next; /* Pointer to the next function in cgraph_varpool_nodes_queue. */ struct cgraph_varpool_node *next_needed; + /* Ordering of all cgraph nodes. */ + int order; /* Set when function must be output - it is externally visible or its address is taken. */ @@ -217,6 +221,18 @@ struct cgraph_varpool_node GTY(()) bool alias; }; +/* Every top level asm statement is put into a cgraph_asm_node. */ + +struct cgraph_asm_node GTY(()) +{ + /* Next asm node. */ + struct cgraph_asm_node *next; + /* String for this asm node. */ + tree asm_str; + /* Ordering of all cgraph nodes. */ + int order; +}; + extern GTY(()) struct cgraph_node *cgraph_nodes; extern GTY(()) int cgraph_n_nodes; extern GTY(()) int cgraph_max_uid; @@ -226,6 +242,8 @@ extern GTY(()) struct cgraph_node *cgraph_nodes_queue; extern GTY(()) struct cgraph_varpool_node *cgraph_varpool_first_unanalyzed_node; extern GTY(()) struct cgraph_varpool_node *cgraph_varpool_nodes_queue; +extern GTY(()) struct cgraph_asm_node *cgraph_asm_nodes; +extern GTY(()) int cgraph_order; /* In cgraph.c */ void dump_cgraph (FILE *); @@ -258,6 +276,8 @@ void cgraph_varpool_mark_needed_node (struct cgraph_varpool_node *); void cgraph_varpool_finalize_decl (tree); void cgraph_redirect_edge_callee (struct cgraph_edge *, struct cgraph_node *); +struct cgraph_asm_node *cgraph_add_asm_node (tree); + bool cgraph_function_possibly_inlined_p (tree); void cgraph_unnest_node (struct cgraph_node *); void cgraph_varpool_enqueue_needed_node (struct cgraph_varpool_node *); |