]> git.ipfire.org Git - thirdparty/gcc.git/blame - gcc/defaults.h
> * config/pj/lib1funcs.S: Fix broken comment.
[thirdparty/gcc.git] / gcc / defaults.h
CommitLineData
eff01bb6 1/* Definitions of various defaults for tm.h macros.
ea4f1fce 2 Copyright (C) 1992, 1996, 1997, 1998, 1999, 2000, 2001
d8ea8f28 3 Free Software Foundation, Inc.
b33c316c 4 Contributed by Ron Guilmette (rfg@monkeys.com)
c53a8ab6 5
c53a8ab6
RS
6This file is part of GNU CC.
7
8GNU CC is free software; you can redistribute it and/or modify
9it under the terms of the GNU General Public License as published by
10the Free Software Foundation; either version 2, or (at your option)
11any later version.
12
13GNU CC is distributed in the hope that it will be useful,
14but WITHOUT ANY WARRANTY; without even the implied warranty of
15MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16GNU General Public License for more details.
17
18You should have received a copy of the GNU General Public License
19along with GNU CC; see the file COPYING. If not, write to
940d9d63
RK
20the Free Software Foundation, 59 Temple Place - Suite 330,
21Boston, MA 02111-1307, USA. */
c53a8ab6 22
d8ea8f28
ZW
23#ifndef GCC_DEFAULTS_H
24#define GCC_DEFAULTS_H
25
7b73db04
CH
26/* Store in OUTPUT a string (made with alloca) containing
27 an assembler-name for a local static variable or function named NAME.
28 LABELNO is an integer which is different for each call. */
29
30#ifndef ASM_FORMAT_PRIVATE_NAME
31#define ASM_FORMAT_PRIVATE_NAME(OUTPUT, NAME, LABELNO) \
32 do { \
33 int len = strlen (NAME); \
34 char *temp = (char *) alloca (len + 3); \
35 temp[0] = 'L'; \
36 strcpy (&temp[1], (NAME)); \
37 temp[len + 1] = '.'; \
38 temp[len + 2] = 0; \
39 (OUTPUT) = (char *) alloca (strlen (NAME) + 11); \
40 ASM_GENERATE_INTERNAL_LABEL (OUTPUT, temp, LABELNO); \
41 } while (0)
42#endif
43
44#ifndef ASM_STABD_OP
0a3e1f45 45#define ASM_STABD_OP "\t.stabd\t"
7b73db04
CH
46#endif
47
48/* This is how to output an element of a case-vector that is absolute.
49 Some targets don't use this, but we have to define it anyway. */
50
51#ifndef ASM_OUTPUT_ADDR_VEC_ELT
52#define ASM_OUTPUT_ADDR_VEC_ELT(FILE, VALUE) \
53do { fprintf (FILE, "\t%s\t", ASM_LONG); \
54 ASM_OUTPUT_INTERNAL_LABEL (FILE, "L", (VALUE)); \
55 fputc ('\n', FILE); \
56 } while (0)
57#endif
58
8cd0faaf
CM
59/* Provide default for ASM_OUTPUT_ALTERNATE_LABEL_NAME. */
60#ifndef ASM_OUTPUT_ALTERNATE_LABEL_NAME
61#define ASM_OUTPUT_ALTERNATE_LABEL_NAME(FILE,INSN) \
a991240f 62do { ASM_OUTPUT_LABEL(FILE,LABEL_ALTERNATE_NAME (INSN)); } while (0)
8cd0faaf
CM
63#endif
64
c53a8ab6
RS
65/* choose a reasonable default for ASM_OUTPUT_ASCII. */
66
67#ifndef ASM_OUTPUT_ASCII
68#define ASM_OUTPUT_ASCII(MYFILE, MYSTRING, MYLENGTH) \
69 do { \
70 FILE *_hide_asm_out_file = (MYFILE); \
47ee9bcb 71 const unsigned char *_hide_p = (const unsigned char *) (MYSTRING); \
c53a8ab6
RS
72 int _hide_thissize = (MYLENGTH); \
73 { \
74 FILE *asm_out_file = _hide_asm_out_file; \
47ee9bcb 75 const unsigned char *p = _hide_p; \
c53a8ab6
RS
76 int thissize = _hide_thissize; \
77 int i; \
78 fprintf (asm_out_file, "\t.ascii \""); \
79 \
80 for (i = 0; i < thissize; i++) \
81 { \
82 register int c = p[i]; \
83 if (c == '\"' || c == '\\') \
84 putc ('\\', asm_out_file); \
5f6d3823 85 if (ISPRINT(c)) \
c53a8ab6
RS
86 putc (c, asm_out_file); \
87 else \
88 { \
89 fprintf (asm_out_file, "\\%o", c); \
90 /* After an octal-escape, if a digit follows, \
91 terminate one string constant and start another. \
92 The Vax assembler fails to stop reading the escape \
93 after three digits, so this is the only way we \
94 can get it to parse the data properly. */ \
d07ecc3b 95 if (i < thissize - 1 && ISDIGIT(p[i + 1])) \
c53a8ab6
RS
96 fprintf (asm_out_file, "\"\n\t.ascii \""); \
97 } \
98 } \
99 fprintf (asm_out_file, "\"\n"); \
100 } \
101 } \
102 while (0)
103#endif
d0d4af87
MS
104
105#ifndef ASM_IDENTIFY_GCC
106 /* Default the definition, only if ASM_IDENTIFY_GCC is not set,
107 because if it is set, we might not want ASM_IDENTIFY_LANGUAGE
108 outputting labels, if we do want it to, then it must be defined
109 in the tm.h file. */
110#ifndef ASM_IDENTIFY_LANGUAGE
111#define ASM_IDENTIFY_LANGUAGE(FILE) output_lang_identify (FILE);
112#endif
113#endif
650f773a
JW
114
115/* This is how we tell the assembler to equate two values. */
116#ifdef SET_ASM_OP
117#ifndef ASM_OUTPUT_DEF
118#define ASM_OUTPUT_DEF(FILE,LABEL1,LABEL2) \
e8638df0 119 do { fprintf ((FILE), "%s", SET_ASM_OP); \
650f773a
JW
120 assemble_name (FILE, LABEL1); \
121 fprintf (FILE, ","); \
122 assemble_name (FILE, LABEL2); \
123 fprintf (FILE, "\n"); \
124 } while (0)
125#endif
126#endif
daefd78b 127
81d77cda
RK
128/* This is how to output a reference to a user-level label named NAME. */
129
130#ifndef ASM_OUTPUT_LABELREF
19283265 131#define ASM_OUTPUT_LABELREF(FILE,NAME) asm_fprintf ((FILE), "%U%s", (NAME))
81d77cda
RK
132#endif
133
8215347e
JW
134/* Allow target to print debug info labels specially. This is useful for
135 VLIW targets, since debug info labels should go into the middle of
136 instruction bundles instead of breaking them. */
137
138#ifndef ASM_OUTPUT_DEBUG_LABEL
139#define ASM_OUTPUT_DEBUG_LABEL(FILE, PREFIX, NUM) \
140 ASM_OUTPUT_INTERNAL_LABEL (FILE, PREFIX, NUM)
141#endif
142
daefd78b
JM
143/* This determines whether or not we support weak symbols. */
144#ifndef SUPPORTS_WEAK
145#ifdef ASM_WEAKEN_LABEL
146#define SUPPORTS_WEAK 1
147#else
148#define SUPPORTS_WEAK 0
149#endif
150#endif
a6ab3aad 151
1ca894a0
MM
152/* This determines whether or not we support link-once semantics. */
153#ifndef SUPPORTS_ONE_ONLY
154#ifdef MAKE_DECL_ONE_ONLY
155#define SUPPORTS_ONE_ONLY 1
156#else
157#define SUPPORTS_ONE_ONLY 0
158#endif
159#endif
160
8f08ea1e
L
161/* If the target supports weak symbols, define TARGET_ATTRIBUTE_WEAK to
162 provide a weak attribute. Else define it to nothing.
163
164 This would normally belong in gansidecl.h, but SUPPORTS_WEAK is
165 not available at that time.
166
167 Note, this is only for use by target files which we know are to be
168 compiled by GCC. */
169#ifndef TARGET_ATTRIBUTE_WEAK
170# if SUPPORTS_WEAK
171# define TARGET_ATTRIBUTE_WEAK __attribute__ ((weak))
172# else
173# define TARGET_ATTRIBUTE_WEAK
174# endif
175#endif
176
ea4f1fce
JO
177/* If the target supports init_priority C++ attribute, give
178 SUPPORTS_INIT_PRIORITY a nonzero value. */
179#ifndef SUPPORTS_INIT_PRIORITY
180#define SUPPORTS_INIT_PRIORITY 1
181#endif /* SUPPORTS_INIT_PRIORITY */
182
a6ab3aad
JM
183/* If we have a definition of INCOMING_RETURN_ADDR_RTX, assume that
184 the rest of the DWARF 2 frame unwind support is also provided. */
0021b564
JM
185#if !defined (DWARF2_UNWIND_INFO) && defined (INCOMING_RETURN_ADDR_RTX)
186#define DWARF2_UNWIND_INFO 1
a6ab3aad 187#endif
b366352b 188
31cf0144
JM
189#if defined (DWARF2_UNWIND_INFO) && !defined (EH_FRAME_SECTION)
190# if defined (EH_FRAME_SECTION_ASM_OP)
5074c1fe 191# define EH_FRAME_SECTION() eh_frame_section ()
31cf0144
JM
192# else
193 /* If we aren't using crtstuff to run ctors, don't use it for EH. */
194# if defined (ASM_OUTPUT_SECTION_NAME) && defined (ASM_OUTPUT_CONSTRUCTOR)
0a3e1f45 195# define EH_FRAME_SECTION_ASM_OP "\t.section\t.eh_frame,\"aw\""
31cf0144
JM
196# define EH_FRAME_SECTION() \
197 do { named_section (NULL_TREE, ".eh_frame", 0); } while (0)
198# endif
199# endif
200#endif
201
eff01bb6
RH
202/* If we have no definition for UNIQUE_SECTION, but do have the
203 ability to generate arbitrary sections, construct something
204 reasonable. */
205#ifdef ASM_OUTPUT_SECTION_NAME
206#ifndef UNIQUE_SECTION
207#define UNIQUE_SECTION(DECL,RELOC) \
208do { \
209 int len; \
210 const char *name; \
211 char *string; \
212 \
213 name = IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (DECL)); \
214 /* Strip off any encoding in name. */ \
215 STRIP_NAME_ENCODING (name, name); \
216 \
217 len = strlen (name) + 1; \
218 string = alloca (len + 1); \
219 sprintf (string, ".%s", name); \
220 \
221 DECL_SECTION_NAME (DECL) = build_string (len, string); \
222} while (0)
223#endif
224#ifndef UNIQUE_SECTION_P
225#define UNIQUE_SECTION_P(DECL) 0
226#endif
227#endif
228
b366352b
MM
229/* By default, we generate a label at the beginning and end of the
230 text section, and compute the size of the text section by
231 subtracting the two. However, on some platforms that doesn't
232 work, and we use the section itself, rather than a label at the
233 beginning of it, to indicate the start of the section. On such
234 platforms, define this to zero. */
235#ifndef DWARF2_GENERATE_TEXT_SECTION_LABEL
236#define DWARF2_GENERATE_TEXT_SECTION_LABEL 1
237#endif
246833ac
RH
238
239/* Supply a default definition for PROMOTE_PROTOTYPES. */
240#ifndef PROMOTE_PROTOTYPES
241#define PROMOTE_PROTOTYPES 0
242#endif
c478efd1
GDR
243
244/* Number of hardware registers that go into the DWARF-2 unwind info.
245 If not defined, equals FIRST_PSEUDO_REGISTER */
246
247#ifndef DWARF_FRAME_REGISTERS
248#define DWARF_FRAME_REGISTERS FIRST_PSEUDO_REGISTER
249#endif
d8ea8f28
ZW
250
251/* Default sizes for base C types. If the sizes are different for
252 your target, you should override these values by defining the
253 appropriate symbols in your tm.h file. */
254
255#ifndef CHAR_TYPE_SIZE
256#define CHAR_TYPE_SIZE BITS_PER_UNIT
257#endif
258
259#ifndef SHORT_TYPE_SIZE
260#define SHORT_TYPE_SIZE (BITS_PER_UNIT * MIN ((UNITS_PER_WORD + 1) / 2, 2))
261#endif
262
263#ifndef INT_TYPE_SIZE
264#define INT_TYPE_SIZE BITS_PER_WORD
265#endif
266
267#ifndef LONG_TYPE_SIZE
268#define LONG_TYPE_SIZE BITS_PER_WORD
269#endif
270
271#ifndef LONG_LONG_TYPE_SIZE
272#define LONG_LONG_TYPE_SIZE (BITS_PER_WORD * 2)
273#endif
274
275#ifndef WCHAR_TYPE_SIZE
276#define WCHAR_TYPE_SIZE INT_TYPE_SIZE
277#endif
278
279#ifndef WCHAR_UNSIGNED
280#define WCHAR_UNSIGNED 0
281#endif
282
283#ifndef FLOAT_TYPE_SIZE
284#define FLOAT_TYPE_SIZE BITS_PER_WORD
285#endif
286
287#ifndef DOUBLE_TYPE_SIZE
288#define DOUBLE_TYPE_SIZE (BITS_PER_WORD * 2)
289#endif
290
291#ifndef LONG_DOUBLE_TYPE_SIZE
292#define LONG_DOUBLE_TYPE_SIZE (BITS_PER_WORD * 2)
293#endif
294
2df88e9f
JO
295#ifndef BUILD_VA_LIST_TYPE
296#define BUILD_VA_LIST_TYPE(X) ((X) = ptr_type_node)
297#endif
298
848e0190
JH
299#ifndef PIC_OFFSET_TABLE_REGNUM
300#define PIC_OFFSET_TABLE_REGNUM INVALID_REGNUM
301#endif
302
a9374841
MM
303/* By default, the preprocessor should be invoked the same way in C++
304 as in C. */
305#ifndef CPLUSPLUS_CPP_SPEC
306#ifdef CPP_SPEC
307#define CPLUSPLUS_CPP_SPEC CPP_SPEC
308#endif
309#endif
310
d8ea8f28
ZW
311#endif /* GCC_DEFAULTS_H */
312