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]

Patch to add SET_DEFAULT_DECL_ATTRIBUTES to start_function().


Hi,

  I would like to submit the following patch.  It adds an evaluation
of the target macro SET_DEFAULT_DECL_ATTRIBUTES to start_function(),
(in both the C and C++ fron tnends) so that function decls can have
their attributes initialised as well. 

This is needed by the v850 port in order to support multiple .text
sections.  It should not affect any other ports.

May I apply the patch ?

Cheers
	Nick

-------------------patches in gcc directory------------------------

Fri Sep 25 14:11:57 1998  Nick Clifton  <nickc@cygnus.com>

	* c-decl.c (start_function): Add invocation of
	SET_DEFAULT_DECL_ATTRIBUTES, if defined.

	* tm.texi: Remove description of non-existant macro
	SET_DEFAULT_SECTION_NAME.


Index: c-decl.c
===================================================================
RCS file: /egcs/carton/cvsfiles/egcs/gcc/c-decl.c,v
retrieving revision 1.45
diff -p -r1.45 c-decl.c
*** c-decl.c	1998/09/15 19:18:47	1.45
--- c-decl.c	1998/09/25 21:22:58
*************** start_function (declspecs, declarator, p
*** 6423,6428 ****
--- 6423,6432 ----
       except for defining how to inline.  So set DECL_EXTERNAL in that case.  */
    DECL_EXTERNAL (decl1) = current_extern_inline;
  
+ #ifdef SET_DEFAULT_DECL_ATTRIBUTES
+   SET_DEFAULT_DECL_ATTRIBUTES (decl1, attributes);
+ #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.50
diff -p -r1.50 tm.texi
*** tm.texi	1998/09/15 19:19:00	1.50
--- tm.texi	1998/09/25 20:44:28
*************** declaration, but before the declaration 
*** 7407,7417 ****
  @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
--- 7407,7412 ----


---------------patches in gcc/cp directory---------------------------

Fri Sep 25 14:11:57 1998  Nick Clifton  <nickc@cygnus.com>

	* decl.c (start_decl): Add invocation of
	SET_DEFAULT_DECL_ATTRIBUTES, if defined.
	(start_function): Add invocation of
	SET_DEFAULT_DECL_ATTRIBUTES, if defined.


Index: cp/decl.c
===================================================================
RCS file: /egcs/carton/cvsfiles/egcs/gcc/cp/decl.c,v
retrieving revision 1.216
diff -p -w -r1.216 decl.c
*** decl.c	1998/09/25 11:07:29	1.216
--- decl.c	1998/09/25 21:23:40
*************** start_decl (declarator, declspecs, initi
*** 6618,6623 ****
--- 6618,6627 ----
        pushclass (context, 2);
      }
  
+ #ifdef SET_DEFAULT_DECL_ATTRIBUTES
+   SET_DEFAULT_DECL_ATTRIBUTES (decl, attributes);
+ #endif
+   
    /* Set attributes here so if duplicate decl, will have proper attributes.  */
    cplus_decl_attributes (decl, attributes, prefix_attributes);
  
*************** start_function (declspecs, declarator, a
*** 12390,12395 ****
--- 12394,12403 ----
       error_mark_node is replaced below (in poplevel) with the BLOCK.  */
    DECL_INITIAL (decl1) = error_mark_node;
  
+ #ifdef SET_DEFAULT_DECL_ATTRIBUTES
+   SET_DEFAULT_DECL_ATTRIBUTES (decl1, attributes);
+ #endif
+   
    /* This function exists in static storage.
       (This does not mean `static' in the C sense!)  */
    TREE_STATIC (decl1) = 1;


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