1 /* Pragma handling for GCC for Renesas / SuperH SH.
2 Copyright (C) 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
3 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
4 Contributed by Joern Rennecke <joern.rennecke@st.com>.
6 This file is part of GCC.
8 GCC is free software; you can redistribute it and/or modify
9 it under the terms of the GNU General Public License as published by
10 the Free Software Foundation; either version 2, or (at your option)
13 GCC is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
18 You should have received a copy of the GNU General Public License
19 along with GCC; see the file COPYING. If not, write to
20 the Free Software Foundation, 51 Franklin Street, Fifth Floor,
21 Boston, MA 02110-1301, USA. */
25 #include "coretypes.h"
30 /* Handle machine specific pragmas to be semi-compatible with Renesas
33 /* Add ATTR to the attributes of the current function. If there is no
34 such function, save it to be added to the attributes of the next
37 sh_add_function_attribute (const char *attr
)
39 tree id
= get_identifier (attr
);
41 if (current_function_decl
)
42 decl_attributes (¤t_function_decl
,
43 tree_cons (id
, NULL_TREE
, NULL_TREE
), 0);
46 *sh_deferred_function_attributes_tail
47 = tree_cons (id
, NULL_TREE
, *sh_deferred_function_attributes_tail
);
48 sh_deferred_function_attributes_tail
49 = &TREE_CHAIN (*sh_deferred_function_attributes_tail
);
54 sh_pr_interrupt (struct cpp_reader
*pfile ATTRIBUTE_UNUSED
)
56 sh_add_function_attribute ("interrupt_handler");
60 sh_pr_trapa (struct cpp_reader
*pfile ATTRIBUTE_UNUSED
)
62 sh_add_function_attribute ("trapa_handler");
66 sh_pr_nosave_low_regs (struct cpp_reader
*pfile ATTRIBUTE_UNUSED
)
68 sh_add_function_attribute ("nosave_low_regs");