From 7260826dd33354c89105f1ebfc1a021dfbcbecbf Mon Sep 17 00:00:00 2001 From: bernds Date: Mon, 10 Nov 2014 16:12:21 +0000 Subject: Add a target hook for assembling undeclared decls. * target.def (assemble_undefined_decl): New hooks. * hooks.c (hook_void_FILEptr_constcharptr_const_tree): New function. * hooks.h (hook_void_FILEptr_constcharptr_const_tree): Declare. * doc/tm.texi.in (TARGET_ASM_ASSEMBLE_UNDEFINED_DECL): Add. * doc/tm.texi: Regenerate. * output.h (assemble_undefined_decl): Declare. (get_fnname_from_decl): Declare. * varasm.c (assemble_undefined_decl): New function. (get_fnname_from_decl): New function. * final.c (rest_of_handle_final): Use it. * varpool.c (varpool_output_variables): Call assemble_undefined_decl for nodes without a definition. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@217293 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/output.h | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'gcc/output.h') diff --git a/gcc/output.h b/gcc/output.h index f213b996429..e19fdd3f42b 100644 --- a/gcc/output.h +++ b/gcc/output.h @@ -178,6 +178,9 @@ extern void default_assemble_visibility (tree, int); for an `asm' keyword used between functions. */ extern void assemble_asm (tree); +/* Get the function's name from a decl, as described by its RTL. */ +extern const char *get_fnname_from_decl (tree); + /* Output assembler code for the constant pool of a function and associated with defining the name of the function. DECL describes the function. NAME is the function's name. For the constant pool, we use the current @@ -203,6 +206,10 @@ extern void assemble_variable (tree, int, int, int); into the preinit array. */ extern void assemble_vtv_preinit_initializer (tree); +/* Assemble everything that is needed for a variable declaration that has + no definition in the current translation unit. */ +extern void assemble_undefined_decl (tree); + /* Compute the alignment of variable specified by DECL. DONT_OUTPUT_DATA is from assemble_variable. */ extern void align_variable (tree decl, bool dont_output_data); -- cgit v1.2.1