On 10/20/14 14:30, Bernd Schmidt wrote:
ptx assembly requires that declarations are written for undefined
variables. This adds that functionality.


Bernd


008-undefdecl.diff


        gcc/
        * 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.
Does this need to happen at the use site, or can it be deferred?

THe PA had to do something similar. We built up a vector of every external object in ASM_OUTPUT_EXTERNAL, but did not emit anything.

Then in ASM_FILE_END, we walked that vector and anything that was actually referenced (as opposed to just just declared) we would emit the magic .IMPORT lines.

Jeff

Reply via email to