* Makefile.in (rtlanal.o): Depend on $(TM_P_H).
[official-gcc.git] / gcc / config / nextstep.c
blobbbe0cd68fa49aa1a2f0d9bf9bde18ed3d32ca227
1 /* Functions for generic NeXT as target machine for GNU C compiler.
2 Copyright (C) 1989, 1990, 1991, 1992, 1993, 1996, 1997, 1998,
3 2000 Free Software Foundation, Inc.
5 This file is part of GNU CC.
7 GNU CC is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 2, or (at your option)
10 any later version.
12 GNU CC is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
17 You should have received a copy of the GNU General Public License
18 along with GNU CC; see the file COPYING. If not, write to
19 the Free Software Foundation, 59 Temple Place - Suite 330,
20 Boston, MA 02111-1307, USA. */
22 #include "config.h"
23 #include "system.h"
24 #include "flags.h"
25 #include "tree.h"
26 #include "toplev.h"
28 /* Make everything that used to go in the text section really go there. */
30 int flag_no_mach_text_sections = 0;
32 #define OPT_STRCMP(opt) (!strncmp (opt, p, sizeof (opt)-1))
34 /* 1 if handle_pragma has been called yet. */
36 static int pragma_initialized;
38 /* Initial setting of `optimize'. */
40 static int initial_optimize_flag;
42 /* Called from check_newline via the macro HANDLE_PRAGMA.
43 FINPUT is the source file input stream.
44 CH is the first character after `#pragma'.
45 The result is 1 if the pragma was handled. */
47 int
48 handle_pragma (p_getc, p_ungetc, pname)
49 int (* p_getc) PARAMS ((void)) ATTRIBUTE_UNUSED;
50 void (* p_ungetc) PARAMS ((int)) ATTRIBUTE_UNUSED;
51 const char *pname;
53 int retval = 0;
55 /* Record initial setting of optimize flag, so we can restore it. */
56 if (!pragma_initialized)
58 pragma_initialized = 1;
59 initial_optimize_flag = optimize;
62 if (strcmp (pname, "CC_OPT_ON") == 0)
64 optimize = 1;
65 warning ("optimization turned on");
66 retval = 1;
68 else if (strcmp (pname, "CC_OPT_OFF") == 0)
70 optimize = 0;
71 warning ("optimization turned off");
72 retval = 1;
74 else if (strcmp (pname, "CC_OPT_RESTORE") == 0)
76 extern int initial_optimize_flag;
78 if (optimize != initial_optimize_flag)
79 optimize = initial_optimize_flag;
80 warning ("optimization level restored");
81 retval = 1;
83 else if (strcmp (pname, "CC_WRITABLE_STRINGS") == 0)
84 flag_writable_strings = retval = 1;
85 else if (strcmp (pname, "CC_NON_WRITABLE_STRINGS") == 0)
86 flag_writable_strings = 0, retval = 1;
87 else if (strcmp (pname, "CC_NO_MACH_TEXT_SECTIONS") == 0)
88 flag_no_mach_text_sections = retval = 1;
90 return retval;
93 void
94 nextstep_asm_out_constructor (symbol, priority)
95 rtx symbol;
96 int priority ATTRIBUTE_UNUSED;
98 constructor_section ();
99 assemble_align (POINTER_SIZE);
100 assemble_integer (symbol, POINTER_SIZE / BITS_PER_UNIT, POINTER_SIZE, 1);
101 fprintf (asm_out_file, ".reference .constructors_used\n");
104 void
105 nextstep_asm_out_destructor (symbol, priority)
106 rtx symbol;
107 int priority ATTRIBUTE_UNUSED;
109 destructor_section ();
110 assemble_align (POINTER_SIZE);
111 assemble_integer (symbol, POINTER_SIZE / BITS_PER_UNIT, POINTER_SIZE, 1);
112 fprintf (asm_out_file, ".reference .destructors_used\n");