Patch to add new ASM_OUTPUT_DEF_FROM_DECLS macro

Nick Clifton nickc@cygnus.com
Wed Jun 16 10:24:00 GMT 1999


Hi Guys,

  I would like to submit the enclosed patch for consideration.  It
  adds a new macro to varasm.c called ASM_OUTPUT_DEF_FROM_DECLS.  This
  macro does the same thing as the current ASM_OUTPUT_DEF macro,
  except that the second and third parameters are the decls of the
  names involved rather than just the strings.

  The reason for adding this macro is so that the Thumb backend can
  detect when aliases are being made of function decls, and it can
  take appropriate action to ensure that the alias is marked as being
  an alias of a thumb function, not an arm function.

  There is a problem with this patch in that it will not cope with
  aliases derived via a #pragma, only with aliases derived from
  attributes.   I am not sure if this is a major issue.

Cheers
	Nick

Wed Jun 16 18:19:13 1999  Nick Clifton  <nickc@cygnus.com>

	* varasm.c (assemble_alias): Use ASM_OUTPUT_DEF_FROM_DECLS in
	preference to ASM_OUTPUT_DEF, if it is defined.

	* tm.texi: Document new, optional target macro
	ASM_OUTPUT_DEF_FROM_DECLS.

Index: varasm.c
===================================================================
RCS file: /egcs/carton/cvsfiles/egcs/gcc/varasm.c,v
retrieving revision 1.63
diff -p -r1.63 varasm.c
*** varasm.c	1999/06/09 12:12:17	1.63
- --- varasm.c	1999/06/16 17:14:36
*************** assemble_alias (decl, target)
*** 4423,4429 ****
- --- 4423,4433 ----
  	ASM_GLOBALIZE_LABEL (asm_out_file, name);
      }
  
+ #ifdef ASM_OUTPUT_DEF_FROM_DECLS
+   ASM_OUTPUT_DEF_FROM_DECLS (asm_out_file, decl, target);
+ #else
    ASM_OUTPUT_DEF (asm_out_file, name, IDENTIFIER_POINTER (target));
+ #endif
    TREE_ASM_WRITTEN (decl) = 1;
  #else
  #ifdef ASM_OUTPUT_WEAK_ALIAS

Index: tm.texi
===================================================================
RCS file: /egcs/carton/cvsfiles/egcs/gcc/tm.texi,v
retrieving revision 1.77
diff -p -r1.77 tm.texi
*** tm.texi	1999/05/31 02:56:40	1.77
- --- tm.texi	1999/06/16 17:14:39
*************** which defines (equates) the symbol @var{
*** 5763,5768 ****
- --- 5763,5776 ----
  If SET_ASM_OP is defined, a default definition is provided which is
  correct for most systems.
  
+ @findex ASM_OUTPUT_DEF_FROM_DECLS
+ @item ASM_OUTPUT_DEF (@var{stream}, @var{decl_of_name}, @var{decl_of_value})
+ A C statement to output to the stdio stream @var{stream} assembler code
+ which defines (equates) the symbol whoes tree node is @var{decl_of_name}
+ to have the value of the tree node @var{decl_of_value}.  This macro will
+ be used in preference to @samp{ASM_OUTPUT_DEF} if it is defined and if
+ the tree nodes are available.
+ 
  @findex ASM_OUTPUT_DEFINE_LABEL_DIFFERENCE_SYMBOL
  @item ASM_OUTPUT_DEFINE_LABEL_DIFFERENCE_SYMBOL (@var{stream}, @var{symbol}, @var{high}, @var{low})
  A C statement to output to the stdio stream @var{stream} assembler code



More information about the Gcc-patches mailing list