warn_format_zero_length = value;
break;
+ case OPT_Winit_self:
+ warn_init_self = value;
+ break;
+
case OPT_Wimplicit:
set_Wimplicit (value);
break;
warn_nonnull = value;
break;
+ case OPT_Wold_style_definition:
+ warn_old_style_definition = value;
+ break;
+
case OPT_Wold_style_cast:
warn_old_style_cast = value;
break;
flag_next_runtime = value;
break;
+ case OPT_fnil_receivers:
+ flag_nil_receivers = value;
+ break;
+
case OPT_fnonansi_builtins:
flag_no_nonansi_builtin = !value;
break;
+ case OPT_fobjc_exceptions:
+ flag_objc_exceptions = value;
+ break;
+
case OPT_foperator_names:
cpp_opts->operator_names = value;
break;
cpp_opts->preprocessed = value;
break;
+ case OPT_freplace_objc_classes:
+ flag_replace_objc_classes = value;
+ break;
+
case OPT_frepo:
flag_use_repository = value;
if (value)
flag_weak = value;
break;
+ case OPT_fzero_link:
+ flag_zero_link = value;
+ break;
+
case OPT_gen_decls:
flag_gen_declaration = 1;
break;
/* Post-switch processing. */
bool
-c_common_post_options (const char **pfilename)
+c_common_post_options (const char **pfilename ATTRIBUTE_UNUSED)
{
/* Canonicalize the input and output filenames. */
if (in_fnames == NULL)
}
cpp_get_callbacks (parse_in)->file_change = cb_file_change;
-
- /* NOTE: we use in_fname here, not the one supplied. */
- *pfilename = cpp_read_main_file (parse_in, in_fnames[0]);
+ cpp_post_options (parse_in);
saved_lineno = input_line;
input_line = 0;
/* Reset cpplib's macros and start a new file. */
cpp_undef_all (parse_in);
- cpp_stack_file (parse_in, in_fnames[file_index]);
}
finish_options(in_fnames[file_index]);
{
size_t i;
- cpp_change_file (parse_in, LC_RENAME, _("<built-in>"));
+ cpp_change_file (parse_in, LC_ENTER, _("<built-in>"));
cpp_init_builtins (parse_in, flag_hosted);
c_cpp_builtins (parse_in);
include_cursor = 0;
this_input_filename = tif;
+ cpp_find_main_file (parse_in, this_input_filename);
push_command_line_include ();
}
static void
push_command_line_include (void)
{
- if (cpp_opts->preprocessed)
- return;
-
while (include_cursor < deferred_count)
{
struct deferred_opt *opt = &deferred_opts[include_cursor++];
- if (opt->code == OPT_include && cpp_push_include (parse_in, opt->arg))
+ if (! cpp_opts->preprocessed && opt->code == OPT_include
+ && cpp_push_include (parse_in, opt->arg))
return;
}
if (include_cursor == deferred_count)
{
+ include_cursor++;
/* Restore the line map from <command line>. */
- cpp_change_file (parse_in, LC_RENAME, this_input_filename);
+ if (! cpp_opts->preprocessed)
+ cpp_change_file (parse_in, LC_LEAVE, NULL);
/* -Wunused-macros should only warn about macros defined hereafter. */
cpp_opts->warn_unused_macros = warn_unused_macros;
- include_cursor++;
+ cpp_push_main_file (parse_in);
}
}
else
fe_file_change (new_map);
- if (new_map->reason == LC_LEAVE && MAIN_FILE_P (new_map))
+ if (new_map == 0 || (new_map->reason == LC_LEAVE && MAIN_FILE_P (new_map)))
push_command_line_include ();
}