]>
gcc.gnu.org Git - gcc.git/blob - gcc/defaults.h
1 /* Definitions of various defaults for how to do assembler output
2 (most of which are designed to be appropriate for GAS or for
5 Written by Ron Guilmette (rfg@netcom.com)
7 Copyright (C) 1992 Free Software Foundation, Inc.
9 This file is part of GNU CC.
11 GNU CC is free software; you can redistribute it and/or modify
12 it under the terms of the GNU General Public License as published by
13 the Free Software Foundation; either version 2, or (at your option)
16 GNU CC is distributed in the hope that it will be useful,
17 but WITHOUT ANY WARRANTY; without even the implied warranty of
18 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 GNU General Public License for more details.
21 You should have received a copy of the GNU General Public License
22 along with GNU CC; see the file COPYING. If not, write to
23 the Free Software Foundation, 59 Temple Place - Suite 330,
24 Boston, MA 02111-1307, USA. */
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. */
30 #ifndef ASM_FORMAT_PRIVATE_NAME
31 #define ASM_FORMAT_PRIVATE_NAME(OUTPUT, NAME, LABELNO) \
33 int len = strlen (NAME); \
34 char *temp = (char *) alloca (len + 3); \
36 strcpy (&temp[1], (NAME)); \
37 temp[len + 1] = '.'; \
39 (OUTPUT) = (char *) alloca (strlen (NAME) + 11); \
40 ASM_GENERATE_INTERNAL_LABEL (OUTPUT, temp, LABELNO); \
45 #define ASM_STABD_OP ".stabd"
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. */
51 #ifndef ASM_OUTPUT_ADDR_VEC_ELT
52 #define ASM_OUTPUT_ADDR_VEC_ELT(FILE, VALUE) \
53 do { fprintf (FILE, "\t%s\t", ASM_LONG); \
54 ASM_OUTPUT_INTERNAL_LABEL (FILE, "L", (VALUE)); \
59 /* This is how to output an element of a case-vector that is relative.
60 Some targets don't use this, but we have to define it anyway. */
62 #ifndef ASM_OUTPUT_ADDR_DIFF_ELT
63 #define ASM_OUTPUT_ADDR_DIFF_ELT(FILE, VALUE, REL) \
64 do { fprintf (FILE, "\t%s\t", ASM_SHORT); \
65 ASM_OUTPUT_INTERNAL_LABEL (FILE, "L", (VALUE)); \
67 ASM_OUTPUT_INTERNAL_LABEL (FILE, "L", (REL)); \
72 /* choose a reasonable default for ASM_OUTPUT_ASCII. */
74 #ifndef ASM_OUTPUT_ASCII
75 #define ASM_OUTPUT_ASCII(MYFILE, MYSTRING, MYLENGTH) \
77 FILE *_hide_asm_out_file = (MYFILE); \
78 unsigned char *_hide_p = (unsigned char *) (MYSTRING); \
79 int _hide_thissize = (MYLENGTH); \
81 FILE *asm_out_file = _hide_asm_out_file; \
82 unsigned char *p = _hide_p; \
83 int thissize = _hide_thissize; \
85 fprintf (asm_out_file, "\t.ascii \""); \
87 for (i = 0; i < thissize; i++) \
89 register int c = p[i]; \
90 if (c == '\"' || c == '\\') \
91 putc ('\\', asm_out_file); \
92 if (c >= ' ' && c < 0177) \
93 putc (c, asm_out_file); \
96 fprintf (asm_out_file, "\\%o", c); \
97 /* After an octal-escape, if a digit follows, \
98 terminate one string constant and start another. \
99 The Vax assembler fails to stop reading the escape \
100 after three digits, so this is the only way we \
101 can get it to parse the data properly. */ \
102 if (i < thissize - 1 \
103 && p[i + 1] >= '0' && p[i + 1] <= '9') \
104 fprintf (asm_out_file, "\"\n\t.ascii \""); \
107 fprintf (asm_out_file, "\"\n"); \
113 #ifndef ASM_IDENTIFY_GCC
114 /* Default the definition, only if ASM_IDENTIFY_GCC is not set,
115 because if it is set, we might not want ASM_IDENTIFY_LANGUAGE
116 outputting labels, if we do want it to, then it must be defined
118 #ifndef ASM_IDENTIFY_LANGUAGE
119 #define ASM_IDENTIFY_LANGUAGE(FILE) output_lang_identify (FILE);
123 /* This is how we tell the assembler to equate two values. */
125 #ifndef ASM_OUTPUT_DEF
126 #define ASM_OUTPUT_DEF(FILE,LABEL1,LABEL2) \
127 do { fprintf ((FILE), "\t%s\t", SET_ASM_OP); \
128 assemble_name (FILE, LABEL1); \
129 fprintf (FILE, ","); \
130 assemble_name (FILE, LABEL2); \
131 fprintf (FILE, "\n"); \
136 /* This determines whether or not we support weak symbols. */
137 #ifndef SUPPORTS_WEAK
138 #ifdef ASM_WEAKEN_LABEL
139 #define SUPPORTS_WEAK 1
141 #define SUPPORTS_WEAK 0
This page took 0.042162 seconds and 5 git commands to generate.