OSDN Git Service

* attribs.c (c_common_attribute_table): Move table and handlers
[pf3gnuchains/gcc-fork.git] / gcc / target-def.h
1 /* Default initializers for a generic GCC target.
2    Copyright (C) 2001, 2002 Free Software Foundation, Inc.
3
4 This program is free software; you can redistribute it and/or modify it
5 under the terms of the GNU General Public License as published by the
6 Free Software Foundation; either version 2, or (at your option) any
7 later version.
8
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12 GNU General Public License for more details.
13
14 You should have received a copy of the GNU General Public License
15 along with this program; if not, write to the Free Software
16 Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17
18  In other words, you are welcome to use, share and improve this program.
19  You are forbidden to forbid anyone else to use, share and improve
20  what you give them.   Help stamp out software-hoarding!  */
21
22 /* See target.h for a description of what this file contains and how to
23    use it.
24
25    We want to have non-NULL default definitions of all hook functions,
26    even if they do nothing.  */
27
28 /* Note that if one of these macros must be defined in an OS .h file
29    rather than the .c file, then we need to wrap the default
30    definition in a #ifndef, since files include tm.h before this one.  */
31
32 /* Assembler output.  */
33 #define TARGET_ASM_OPEN_PAREN "("
34 #define TARGET_ASM_CLOSE_PAREN ")"
35 #define TARGET_ASM_BYTE_OP "\t.byte\t"
36
37 #define TARGET_ASM_ALIGNED_HI_OP "\t.short\t"
38 #define TARGET_ASM_ALIGNED_SI_OP "\t.long\t"
39 #define TARGET_ASM_ALIGNED_DI_OP NULL
40 #define TARGET_ASM_ALIGNED_TI_OP NULL
41
42 /* GAS and SYSV4 assemblers accept these.  */
43 #if defined (OBJECT_FORMAT_ELF) || defined (OBJECT_FORMAT_ROSE)
44 #define TARGET_ASM_UNALIGNED_HI_OP "\t.2byte\t"
45 #define TARGET_ASM_UNALIGNED_SI_OP "\t.4byte\t"
46 #define TARGET_ASM_UNALIGNED_DI_OP "\t.8byte\t"
47 #define TARGET_ASM_UNALIGNED_TI_OP NULL
48 #else
49 #define TARGET_ASM_UNALIGNED_HI_OP NULL
50 #define TARGET_ASM_UNALIGNED_SI_OP NULL
51 #define TARGET_ASM_UNALIGNED_DI_OP NULL
52 #define TARGET_ASM_UNALIGNED_TI_OP NULL
53 #endif /* OBJECT_FORMAT_ELF || OBJECT_FORMAT_ROSE */
54
55 #define TARGET_ASM_INTEGER default_assemble_integer
56
57 #define TARGET_ASM_FUNCTION_PROLOGUE default_function_pro_epilogue
58 #define TARGET_ASM_FUNCTION_EPILOGUE default_function_pro_epilogue
59 #define TARGET_ASM_FUNCTION_END_PROLOGUE no_asm_to_stream
60 #define TARGET_ASM_FUNCTION_BEGIN_EPILOGUE no_asm_to_stream
61
62 #if !defined(TARGET_ASM_CONSTRUCTOR) && !defined(USE_COLLECT2)
63 # ifdef CTORS_SECTION_ASM_OP
64 #  define TARGET_ASM_CONSTRUCTOR default_ctor_section_asm_out_constructor
65 # else
66 #  ifdef TARGET_ASM_NAMED_SECTION
67 #   define TARGET_ASM_CONSTRUCTOR default_named_section_asm_out_constructor
68 #  else
69 #   define TARGET_ASM_CONSTRUCTOR default_stabs_asm_out_constructor
70 #  endif
71 # endif
72 #endif
73
74 #if !defined(TARGET_ASM_DESTRUCTOR) && !defined(USE_COLLECT2)
75 # ifdef DTORS_SECTION_ASM_OP
76 #  define TARGET_ASM_DESTRUCTOR default_dtor_section_asm_out_destructor
77 # else
78 #  ifdef TARGET_ASM_NAMED_SECTION
79 #   define TARGET_ASM_DESTRUCTOR default_named_section_asm_out_destructor
80 #  else
81 #   define TARGET_ASM_DESTRUCTOR default_stabs_asm_out_destructor
82 #  endif
83 # endif
84 #endif
85
86 #if defined(TARGET_ASM_CONSTRUCTOR) && defined(TARGET_ASM_DESTRUCTOR)
87 #define TARGET_HAVE_CTORS_DTORS true
88 #else
89 #define TARGET_HAVE_CTORS_DTORS false
90 #define TARGET_ASM_CONSTRUCTOR NULL
91 #define TARGET_ASM_DESTRUCTOR NULL
92 #endif
93
94 #ifdef TARGET_ASM_NAMED_SECTION
95 #define TARGET_HAVE_NAMED_SECTIONS true
96 #else
97 #define TARGET_ASM_NAMED_SECTION default_no_named_section
98 #define TARGET_HAVE_NAMED_SECTIONS false
99 #endif
100
101 #ifndef TARGET_ASM_EXCEPTION_SECTION
102 #define TARGET_ASM_EXCEPTION_SECTION default_exception_section
103 #endif
104
105 #ifndef TARGET_ASM_EH_FRAME_SECTION
106 #define TARGET_ASM_EH_FRAME_SECTION default_eh_frame_section
107 #endif
108
109 #define TARGET_ASM_ALIGNED_INT_OP                               \
110                        {TARGET_ASM_ALIGNED_HI_OP,               \
111                         TARGET_ASM_ALIGNED_SI_OP,               \
112                         TARGET_ASM_ALIGNED_DI_OP,               \
113                         TARGET_ASM_ALIGNED_TI_OP}
114
115 #define TARGET_ASM_UNALIGNED_INT_OP                             \
116                        {TARGET_ASM_UNALIGNED_HI_OP,             \
117                         TARGET_ASM_UNALIGNED_SI_OP,             \
118                         TARGET_ASM_UNALIGNED_DI_OP,             \
119                         TARGET_ASM_UNALIGNED_TI_OP}
120
121 #define TARGET_ASM_OUT {TARGET_ASM_OPEN_PAREN,                  \
122                         TARGET_ASM_CLOSE_PAREN,                 \
123                         TARGET_ASM_BYTE_OP,                     \
124                         TARGET_ASM_ALIGNED_INT_OP,              \
125                         TARGET_ASM_UNALIGNED_INT_OP,            \
126                         TARGET_ASM_INTEGER,                     \
127                         TARGET_ASM_FUNCTION_PROLOGUE,           \
128                         TARGET_ASM_FUNCTION_END_PROLOGUE,       \
129                         TARGET_ASM_FUNCTION_BEGIN_EPILOGUE,     \
130                         TARGET_ASM_FUNCTION_EPILOGUE,           \
131                         TARGET_ASM_NAMED_SECTION,               \
132                         TARGET_ASM_EXCEPTION_SECTION,           \
133                         TARGET_ASM_EH_FRAME_SECTION,            \
134                         TARGET_ASM_CONSTRUCTOR,                 \
135                         TARGET_ASM_DESTRUCTOR}
136
137 /* Scheduler hooks.  All of these default to null pointers, which
138    haifa-sched.c looks for and handles.  */
139 #define TARGET_SCHED_ADJUST_COST 0
140 #define TARGET_SCHED_ADJUST_PRIORITY 0
141 #define TARGET_SCHED_ISSUE_RATE 0
142 #define TARGET_SCHED_VARIABLE_ISSUE 0
143 #define TARGET_SCHED_INIT 0
144 #define TARGET_SCHED_FINISH 0
145 #define TARGET_SCHED_REORDER 0
146 #define TARGET_SCHED_REORDER2 0
147 #define TARGET_SCHED_CYCLE_DISPLAY 0
148
149 #define TARGET_SCHED    {TARGET_SCHED_ADJUST_COST,      \
150                          TARGET_SCHED_ADJUST_PRIORITY,  \
151                          TARGET_SCHED_ISSUE_RATE,       \
152                          TARGET_SCHED_VARIABLE_ISSUE,   \
153                          TARGET_SCHED_INIT,             \
154                          TARGET_SCHED_FINISH,           \
155                          TARGET_SCHED_REORDER,          \
156                          TARGET_SCHED_REORDER2,         \
157                          TARGET_SCHED_CYCLE_DISPLAY}
158
159 /* All in tree.c.  */
160 #define TARGET_MERGE_DECL_ATTRIBUTES merge_decl_attributes
161 #define TARGET_MERGE_TYPE_ATTRIBUTES merge_type_attributes
162 #define TARGET_ATTRIBUTE_TABLE NULL
163 #define TARGET_COMP_TYPE_ATTRIBUTES default_comp_type_attributes
164 #define TARGET_SET_DEFAULT_TYPE_ATTRIBUTES default_set_default_type_attributes
165 #define TARGET_INSERT_ATTRIBUTES default_insert_attributes
166 #define TARGET_FUNCTION_ATTRIBUTE_INLINABLE_P default_function_attribute_inlinable_p
167 #define TARGET_MS_BITFIELD_LAYOUT_P default_ms_bitfield_layout_p
168
169 /* In builtins.c.  */
170 #define TARGET_INIT_BUILTINS default_init_builtins
171 #define TARGET_EXPAND_BUILTIN default_expand_builtin
172
173 /* In varasm.c.  */
174 #ifndef TARGET_SECTION_TYPE_FLAGS
175 #define TARGET_SECTION_TYPE_FLAGS default_section_type_flags
176 #endif
177
178 /* In hook.c.  */
179 #define TARGET_CANNOT_MODIFY_JUMPS_P hook_void_bool_false
180
181 /* The whole shebang.  */
182 #define TARGET_INITIALIZER                      \
183 {                                               \
184   TARGET_ASM_OUT,                               \
185   TARGET_SCHED,                                 \
186   TARGET_MERGE_DECL_ATTRIBUTES,                 \
187   TARGET_MERGE_TYPE_ATTRIBUTES,                 \
188   TARGET_ATTRIBUTE_TABLE,                       \
189   TARGET_COMP_TYPE_ATTRIBUTES,                  \
190   TARGET_SET_DEFAULT_TYPE_ATTRIBUTES,           \
191   TARGET_INSERT_ATTRIBUTES,                     \
192   TARGET_FUNCTION_ATTRIBUTE_INLINABLE_P,        \
193   TARGET_MS_BITFIELD_LAYOUT_P,                  \
194   TARGET_INIT_BUILTINS,                         \
195   TARGET_EXPAND_BUILTIN,                        \
196   TARGET_SECTION_TYPE_FLAGS,                    \
197   TARGET_HAVE_NAMED_SECTIONS,                   \
198   TARGET_HAVE_CTORS_DTORS,                      \
199   TARGET_CANNOT_MODIFY_JUMPS_P                  \
200 }
201
202 #include "hooks.h"