by this function and re-examine whether the decl is actually used
after rtl has been generated. */
if (TREE_STATIC (t))
- cgraph_varpool_mark_needed_node (cgraph_varpool_node (t));
+ {
+ cgraph_varpool_mark_needed_node (cgraph_varpool_node (t));
+ if (lang_hooks.callgraph.analyze_expr)
+ return lang_hooks.callgraph.analyze_expr (tp, walk_subtrees,
+ data);
+ }
break;
case ADDR_EXPR:
if (flag_unit_at_a_time)
announce_function (decl);
- /* Generate RTL for the body of DECL. Nested functions are expanded
- via lang_expand_decl_stmt. */
+ /* Generate RTL for the body of DECL. */
lang_hooks.callgraph.expand_function (decl);
/* Make sure that BE didn't give up on compiling. */
GENERIC statements. */
void
-cgraph_build_static_cdtor (char which, tree body)
+cgraph_build_static_cdtor (char which, tree body, int priority)
{
static int counter = 0;
char which_buf[16];
- tree decl, name;
+ tree decl, name, resdecl;
sprintf (which_buf, "%c_%d", which, counter++);
name = get_file_function_name_long (which_buf);
build_function_type (void_type_node, void_list_node));
current_function_decl = decl;
- DECL_RESULT (decl) = build_decl (RESULT_DECL, NULL_TREE, void_type_node);
+ resdecl = build_decl (RESULT_DECL, NULL_TREE, void_type_node);
+ DECL_ARTIFICIAL (resdecl) = 1;
+ DECL_IGNORED_P (resdecl) = 1;
+ DECL_RESULT (decl) = resdecl;
+
allocate_struct_function (decl);
TREE_STATIC (decl) = 1;
fn = targetm.asm_out.constructor;
else
fn = targetm.asm_out.destructor;
- fn (XEXP (DECL_RTL (decl), 0), DEFAULT_INIT_PRIORITY);
+ fn (XEXP (DECL_RTL (decl), 0), priority);
}
}