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, 2007 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 3, 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 COPYING3. If not see
20 <http://www.gnu.org/licenses/>. */
24 #include "coretypes.h"
29 /* Handle machine specific pragmas to be semi-compatible with Renesas
32 /* Add ATTR to the attributes of the current function. If there is no
33 such function, save it to be added to the attributes of the next
36 sh_add_function_attribute (const char *attr)
38 tree id = get_identifier (attr);
40 if (current_function_decl)
41 decl_attributes (¤t_function_decl,
42 tree_cons (id, NULL_TREE, NULL_TREE), 0);
45 *sh_deferred_function_attributes_tail
46 = tree_cons (id, NULL_TREE, *sh_deferred_function_attributes_tail);
47 sh_deferred_function_attributes_tail
48 = &TREE_CHAIN (*sh_deferred_function_attributes_tail);
53 sh_pr_interrupt (struct cpp_reader *pfile ATTRIBUTE_UNUSED)
55 sh_add_function_attribute ("interrupt_handler");
59 sh_pr_trapa (struct cpp_reader *pfile ATTRIBUTE_UNUSED)
61 sh_add_function_attribute ("trapa_handler");
65 sh_pr_nosave_low_regs (struct cpp_reader *pfile ATTRIBUTE_UNUSED)
67 sh_add_function_attribute ("nosave_low_regs");