This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Patcht to allow backends to chose the default section of a decl


Hi,

  I would like to submit the following patch.  This patch creates a
new macro definable in the target specific header file called
SET_DEFAULT_SECTION_NAME.  If defined the macro contains a C
expression which can be used to set the 'section_name' field of
the provided decl.  This would prove useful for the v850 port.

Cheers
	Nick


Fri Aug  7 17:25:29 1998  Nick Clifton  <nickc@cygnus.com>

	* c-decl.c (start_decl): Add use of SET_DEFAULT_SECTION_NAME, if
	defined. 
	(start_function): Add use of SET_DEFAULT_SECTION_NAME, if defined.

	* tm.texi (SET_DEFAULT_SECTION_NAME): New macro.  Allows backend
	to setup the section name of a decl when it is created.


Index: c-decl.c
===================================================================
RCS file: /egcs/carton/cvsfiles/egcs/gcc/c-decl.c,v
retrieving revision 1.40
diff -w -p -r1.40 c-decl.c
*** c-decl.c	1998/07/30 10:38:08	1.40
--- c-decl.c	1998/08/11 00:12:31
*************** start_decl (declarator, declspecs, initi
*** 3820,3825 ****
--- 3820,3829 ----
  #ifdef SET_DEFAULT_DECL_ATTRIBUTES
    SET_DEFAULT_DECL_ATTRIBUTES (decl, attributes);
  #endif
+ #ifdef SET_DEFAULT_SECTION_NAME
+   SET_DEFAULT_SECTION_NAME (decl);
+ #endif
+ 
  
    /* Set attributes here so if duplicate decl, will have proper attributes.  */
    decl_attributes (decl, attributes, prefix_attributes);
*************** start_function (declspecs, declarator, p
*** 6430,6435 ****
--- 6434,6443 ----
       except for defining how to inline.  So set DECL_EXTERNAL in that case.  */
    DECL_EXTERNAL (decl1) = current_extern_inline;
  
+ #ifdef SET_DEFAULT_SECTION_NAME
+   SET_DEFAULT_SECTION_NAME (decl1);
+ #endif
+   
    /* This function exists in static storage.
       (This does not mean `static' in the C sense!)  */
    TREE_STATIC (decl1) = 1;


Index: tm.texi
===================================================================
RCS file: /egcs/carton/cvsfiles/egcs/gcc/tm.texi,v
retrieving revision 1.43
diff -w -p -r1.43 tm.texi
*** tm.texi	1998/07/13 17:20:29	1.43
--- tm.texi	1998/08/11 00:13:19
*************** definition.
*** 7367,7372 ****
--- 7367,7377 ----
  @item SET_DEFAULT_DECL_ATTRIBUTES (@var{decl}, @var{attributes})
  If defined, a C statement that assigns default attributes to
  newly defined @var{decl}.
+ 
+ @findex SET_DEFAULT_SECTION_NAME
+ @item SET_DEFAULT_SECTION_NAME (@var[decl})
+ If defined, a C statement that assigns a section name to the newly
+ created @var{decl}.
  
  @findex DOLLARS_IN_IDENTIFIERS
  @item DOLLARS_IN_IDENTIFIERS


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]