static unsigned int
gm2_langhook_option_lang_mask (void)
{
- /* We need to process some driver options and pass through some C
- ones to build our preprocessing lines. */
- return CL_ModulaX2 | CL_C | CL_DRIVER;
+ return CL_ModulaX2;
}
/* Initialize the options structure. */
For now skip all plugins to avoid fails with the m2 one. */
break;
- /* Preprocessor arguments with a following filename. */
+ /* Preprocessor arguments with a following filename, we add these
+ back to the main file preprocess line, but not to dependents
+ TODO Handle MF. */
case OPT_MD:
+ M2Options_SetMD (arg);
+ break;
case OPT_MMD:
- /* Save the filename associated with the MD/MMD which will also
- mark the option as used. FIXME: maybe we should diagnose a
- missing filename here, rather than assert. */
- gcc_checking_assert (i+1 < decoded_options_count);
- gcc_checking_assert (decoded_options[i+1].opt_index
- == OPT_SPECIAL_input_file);
- /* Pick up the following filename. */
- arg = decoded_options[i+1].arg;
- if (code == OPT_MD)
- M2Options_SetMD (arg);
- else
- M2Options_SetMMD (arg);
+ M2Options_SetMMD (arg);
+ break;
+
+ /* Modula 2 claimed options we pass to the preprocessor. */
+ case OPT_ansi:
+ case OPT_traditional_cpp:
+ if (building_cpp_command)
+ M2Options_CppArg (opt, arg, (option->flags & CL_JOINED)
+ && !(option->flags & CL_SEPARATE));
break;
/* Options we act on and also pass to the preprocessor. */
M2Options_CppArg (opt, arg, (option->flags & CL_JOINED)
&& !(option->flags & CL_SEPARATE));
break;
+ case OPT_quiet:
+ M2Options_SetQuiet (value);
+ if (building_cpp_command)
+ M2Options_CppArg (opt, arg, (option->flags & CL_JOINED)
+ && !(option->flags & CL_SEPARATE));
+ break;
case OPT_v:
M2Options_SetVerbose (value);
/* FALLTHROUGH */
/* Otherwise, ignored, at least for now. */
return 1;
break;
- case OPT_quiet:
- M2Options_SetQuiet (value);
- return 1;
case OPT_fm2_whole_program:
M2Options_SetWholeProgram (value);
return 1;
}
else
return 0;
- case OPT_o:
- /* Options we ignore, always. */
- return 1;
default:
if (insideCppArgs)
- /* Already handled. */
+ /* Handled in gm2_langhook_init_options (). */
return 1;
else if (option->flags & CL_DRIVER)
- /* Ignore driver options we do not specifically use. */
+ /* Driver options (unless specifically claimed above) should be handled
+ in gm2_langhook_init_options (). */
return 1;
else if (option->flags & CL_C)
- /* Ignore C options we do not specifically use. */
+ /* C options (unless specifically claimed above) should be handled
+ in gm2_langhook_init_options (). */
return 1;
- return 0;
+ break;
}
return 0;
}
"%{E|M|MM|fcpp: %{E} -fcpp-begin " \
" %{!E:-E} %(cpp_unique_options) -traditional-cpp -ansi " \
" -fcpp-end %{B*} %{save-temps*} ; \
- : %{v} %I } "
+ : %{v} %I %{B*} %{save-temps*} } "
/* We have three modes:
1. When the preprocessing step is explict and there is no following
cc1gm2 " M2CPP " %{!fcpp:-fcpp;:%{fcpp}} %{I*} %i } \
%{!E:%{!M:%{!MM:\
cc1gm2 " M2CPP " %(cc1_options) %{I*} %i %{c} \
- %{MF*:%eto generate dependencies you must specify either '-M' or '-MM'} \
+ %{!fcpp:%{MD|MMD|MF*: \
+ %eto generate dependencies you must specify '-fcpp' }} \
%{!fsyntax-only:%(invoke_as)} \
}}}", 0, 0, 0},
{".m2i", "@modula-2-cpp-output", 0, 0, 0},
; See the GCC internals manual for a description of this file's format.
+; There are two sections:
+; 1. Options specific to Modula-2
+; 2. Options shared with C or the Driver.
+; Please keep any new additions for either case in the relevant section.
; Please try to keep this file in ASCII collating order.
Language
Modula-2
-Wall
-Modula-2
-; Documented in c.opt
-
-Wpedantic
-Modula-2
-; Documented in common.opt
-
Wpedantic-param-names
Modula-2
compiler checks to force definition module procedure parameter names with their implementation module counterpart
Modula-2
extra compile time semantic checking, typically tries to catch poor programming style
-Wunused-variable
-Modula-2
-; Documented in c.opt
-
-Wunused-parameter
-Modula-2
-; Documented in c.opt
-
-c
-Modula-2
-; Documented in c.opt
-
fauto-init
Modula-2
automatically initializes all pointers to NIL
Modula-2
turns on runtime checking to check whether a CASE statement requires an ELSE clause when on was not specified
-fobjc-std=objc1
-Modula-2
-; Documented in c.opt
-
fcpp
Modula-2
use cpp to preprocess the module
Modula-2
display all inbuilt system items
-fexceptions
-Modula-2
-; Documented in common.opt
-
fextended-opaque
Modula-2
allows opaque types to be implemented as any type (a GNU Modula-2 extension)
Modula-2
force positive result from MOD and DIV result floor
-fpreprocessed
-Modula-2
-; Documented in c.opt
-
fpthread
Modula-2
link against the pthread library (default on)
Modula-2
turns on runtime checking to check whether a whole number is about to exceed range
-;fworking-directory
-;Modula-2
+static-libgm2
+Driver
+Link the standard Modula-2 libraries statically in the compilation.
+
+; Here are C options that we also recognise, either within the compiler
+; or to build the preprocessor command lines.
+
+Wall
+Modula-2
; Documented in c.opt
-lang-asm
+Wpedantic
+Modula-2
+; Documented in common.opt
+
+Wunused-variable
Modula-2
; Documented in c.opt
-static-libgm2
-Driver
-Link the standard Modula-2 libraries statically in the compilation.
+Wunused-parameter
+Modula-2
+; Documented in c.opt
+
+B
+Modula-2
+; Documented in c.opt
+
+D
+Modula-2
+; Documented in c.opt
+
+E
+Modula-2
+; Documented in c.opt
+
+I
+Modula-2 Joined Separate
+; Documented in c.opt
+
+L
+Modula-2 Joined Separate
+; Not documented
+
+M
+Modula-2
+; Documented in c.opt
+
+MD
+Modula-2
+; Documented in c.opt
+
+MF
+Modula-2
+; Documented in c.opt
+
+MG
+Modula-2
+; Documented in c.opt
+
+MM
+Modula-2
+; Documented in c.opt
+
+MMD
+Modula-2
+; Documented in c.opt
+
+Mmodules
+Modula-2
+; Documented in c.opt
+
+Mno-modules
+Modula-2
+; Documented in c.opt
+
+MP
+Modula-2
+; Documented in c.opt
+
+MQ
+Modula-2
+; Documented in c.opt
+
+MT
+Modula-2
+; Documented in c.opt
+
+P
+Modula-2
+; Documented in c.opt
+
+ansi
+Modula-2
+; Documented in c.opt
+
+c
+Modula-2
+; Documented in c.opt
+
+fexceptions
+Modula-2
+; Documented in common.opt
+
+fobjc-std=objc1
+Modula-2
+; Documented in c.opt
+
+fpreprocessed
+Modula-2
+; Documented in c.opt
+
+fworking-directory
+Modula-2
+; Documented in c.opt
+
+iprefix
+Modula-2
+; Documented in c.opt
+
+iquote
+Modula-2
+; Documented in c.opt
+
+isystem
+Modula-2
+; Documented in c.opt
+
+idirafter
+Modula-2
+; Documented in c.opt
+
+imultilib
+Modula-2
+
+-save-temps
+Modula-2 Alias(save-temps)
+
+save-temps
+Modula-2
+save temporary preprocessed files
+
+save-temps=
+Modula-2 Joined
+save temporary preprocessed files
+
+traditional-cpp
+Modula-2
+; Documented in c.opt
; This comment is to ensure we retain the blank line above.