1 | /* Functions for generic NeXT as target machine for GNU C compiler. |
---|
2 | Copyright (C) 1989, 1990, 1991, 1992, 1993 Free Software Foundation, Inc. |
---|
3 | |
---|
4 | This file is part of GNU CC. |
---|
5 | |
---|
6 | GNU CC is free software; you can redistribute it and/or modify |
---|
7 | it under the terms of the GNU General Public License as published by |
---|
8 | the Free Software Foundation; either version 2, or (at your option) |
---|
9 | any later version. |
---|
10 | |
---|
11 | GNU CC is distributed in the hope that it will be useful, |
---|
12 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
---|
14 | GNU General Public License for more details. |
---|
15 | |
---|
16 | You should have received a copy of the GNU General Public License |
---|
17 | along with GNU CC; see the file COPYING. If not, write to |
---|
18 | the Free Software Foundation, 59 Temple Place - Suite 330, |
---|
19 | Boston, MA 02111-1307, USA. */ |
---|
20 | |
---|
21 | /* Make everything that used to go in the text section really go there. */ |
---|
22 | |
---|
23 | int flag_no_mach_text_sections = 0; |
---|
24 | |
---|
25 | #define OPT_STRCMP(opt) (!strncmp (opt, p, sizeof (opt)-1)) |
---|
26 | |
---|
27 | /* 1 if handle_pragma has been called yet. */ |
---|
28 | |
---|
29 | static int pragma_initialized; |
---|
30 | |
---|
31 | /* Initial setting of `optimize'. */ |
---|
32 | |
---|
33 | static int initial_optimize_flag; |
---|
34 | |
---|
35 | extern char *get_directive_line (); |
---|
36 | |
---|
37 | /* Called from check_newline via the macro HANDLE_PRAGMA. |
---|
38 | FINPUT is the source file input stream. */ |
---|
39 | |
---|
40 | void |
---|
41 | handle_pragma (finput, get_line_function) |
---|
42 | FILE *finput; |
---|
43 | char *(*get_line_function) (); |
---|
44 | { |
---|
45 | register char *p = (*get_line_function) (finput); |
---|
46 | |
---|
47 | /* Record initial setting of optimize flag, so we can restore it. */ |
---|
48 | if (!pragma_initialized) |
---|
49 | { |
---|
50 | pragma_initialized = 1; |
---|
51 | initial_optimize_flag = optimize; |
---|
52 | } |
---|
53 | |
---|
54 | if (OPT_STRCMP ("CC_OPT_ON")) |
---|
55 | { |
---|
56 | optimize = 1, obey_regdecls = 0; |
---|
57 | warning ("optimization turned on"); |
---|
58 | } |
---|
59 | else if (OPT_STRCMP ("CC_OPT_OFF")) |
---|
60 | { |
---|
61 | optimize = 0, obey_regdecls = 1; |
---|
62 | warning ("optimization turned off"); |
---|
63 | } |
---|
64 | else if (OPT_STRCMP ("CC_OPT_RESTORE")) |
---|
65 | { |
---|
66 | extern int initial_optimize_flag; |
---|
67 | |
---|
68 | if (optimize != initial_optimize_flag) |
---|
69 | { |
---|
70 | if (initial_optimize_flag) |
---|
71 | obey_regdecls = 0; |
---|
72 | else |
---|
73 | obey_regdecls = 1; |
---|
74 | optimize = initial_optimize_flag; |
---|
75 | } |
---|
76 | warning ("optimization level restored"); |
---|
77 | } |
---|
78 | else if (OPT_STRCMP ("CC_WRITABLE_STRINGS")) |
---|
79 | flag_writable_strings = 1; |
---|
80 | else if (OPT_STRCMP ("CC_NON_WRITABLE_STRINGS")) |
---|
81 | flag_writable_strings = 0; |
---|
82 | else if (OPT_STRCMP ("CC_NO_MACH_TEXT_SECTIONS")) |
---|
83 | flag_no_mach_text_sections = 1; |
---|
84 | } |
---|