#include "config.h"#include "system.h"#include "tree.h"#include "c-common.h"#include "c-pragma.h"#include "flags.h"#include "toplev.h"#include "langhooks.h"#include "tree-inline.h"#include "diagnostic.h"#include "intl.h"

Go to the source code of this file.
Data Types | |
| type | cl_option |
| type | deferred_opt |
Defines | |
| #define | STDC_0_IN_SYSTEM_HEADERS 0 |
| #define | CL_C_ONLY (1 << 0) |
| #define | CL_OBJC_ONLY (1 << 1) |
| #define | CL_CXX_ONLY (1 << 2) |
| #define | CL_OBJCXX_ONLY (1 << 3) |
| #define | CL_JOINED (1 << 4) |
| #define | CL_SEPARATE (1 << 5) |
| #define | CL_ARG (CL_JOINED | CL_SEPARATE) |
| #define | CL_C (CL_C_ONLY | CL_OBJC_ONLY) |
| #define | CL_OBJC (CL_OBJC_ONLY | CL_OBJCXX_ONLY) |
| #define | CL_CXX (CL_CXX_ONLY | CL_OBJCXX_ONLY) |
| #define | CL_ALL (CL_C | CL_CXX) |
| #define | COMMAND_LINE_OPTIONS |
| #define | OPT(text, flags, code) code, |
| #define | OPT(text, flags, code) { text, sizeof(text) - 1, flags, code }, |
Enumerations | |
| enum | opt_code { N_OPTS, N_OPTS } |
Functions/Subroutines | |
| static void missing_arg | PARAMS ((size_t)) |
| static size_t find_opt | PARAMS ((const char *, int)) |
| static void set_Wimplicit | PARAMS ((int)) |
| static void complain_wrong_lang | PARAMS ((size_t, int)) |
| static void write_langs | PARAMS ((char *, int)) |
| static void print_help | PARAMS ((void)) |
| static void handle_OPT_d | PARAMS ((const char *)) |
| static void set_std_c89 | PARAMS ((int, int)) |
| static void defer_opt | PARAMS ((enum opt_code, const char *)) |
| static void | missing_arg (size_t opt_index) |
| static size_t | find_opt (char *input, int lang_flag) const |
| static void | defer_opt (enum opt_code code, const char *arg) |
| void | c_common_init_options (enum c_language_kind lang) |
| int | c_common_decode_option (int argc, char **argv) |
| bool | c_common_post_options () |
| static void | preprocess_file () |
| const char * | c_common_init (char *filename) const |
| void | c_common_finish () |
| static void | check_deps_environment_vars () |
| static void | handle_deferred_opts () |
| static void | sanitize_cpp_opts () |
| static void | set_std_c89 (int c94, int iso) |
| static void | set_std_c99 (int iso) |
| static void | set_std_cxx98 (int iso) |
| static void | set_Wimplicit (int on) |
| static void | handle_OPT_d (char *arg) const |
| static void | write_langs (char *buf, int flags) |
| static void | complain_wrong_lang (size_t opt_index, int on) |
| static void | print_help () |
Variables | |
| static cpp_options * | cpp_opts |
| static const char * | in_fname |
| static const char * | out_fname |
| static FILE * | out_stream |
| static bool | deps_append |
| static bool | deps_seen |
| static const char * | deps_file |
| static size_t | deferred_count |
| static size_t | deferred_size |
| static struct cl_option | cl_options [] |
| static struct deferred_opt * | deferred_opts |
| #define CL_ARG (CL_JOINED | CL_SEPARATE) |
| #define CL_C (CL_C_ONLY | CL_OBJC_ONLY) |
Definition at line 83 of file c-opts.c.
Referenced by c_common_decode_option(), c_common_handle_option(), and c_common_init_options().
| #define CL_C_ONLY (1 << 0) |
| #define CL_CXX (CL_CXX_ONLY | CL_OBJCXX_ONLY) |
Definition at line 85 of file c-opts.c.
Referenced by c_common_decode_option(), c_common_handle_option(), and c_common_init_options().
| #define CL_CXX_ONLY (1 << 2) |
| #define CL_JOINED (1 << 4) |
Definition at line 79 of file c-opts.c.
Referenced by c_common_decode_option(), find_opt(), handle_option(), and prune_options().
| #define CL_OBJC_ONLY (1 << 1) |
| #define CL_SEPARATE (1 << 5) |
Definition at line 80 of file c-opts.c.
Referenced by c_common_decode_option(), and handle_option().
| #define STDC_0_IN_SYSTEM_HEADERS 0 |
| int c_common_decode_option | ( | int | argc, | |
| char ** | argv | |||
| ) |
Definition at line 528 of file c-opts.c.
References atoi(), c_language, CL_ARG, CL_C, CL_C_ONLY, CL_CXX, CL_CXX_ONLY, CL_JOINED, cl_options, CL_SEPARATE, CLK_ASM, clk_c, clk_cplusplus, complain_wrong_lang(), constant_string_class_name, cp_deprecated, cpp_set_lang(), defer_opt(), cpp_options::deps, deps_file, deps_seen, DEPS_SYSTEM, DEPS_USER, disable_builtin_function(), cpp_options::discard_comments, cpp_options::discard_comments_in_macro_exp, dollars_in_ident, dump_switch_p(), dup(), error(), explicit_flag_signed_bitfields, find_opt(), flag_abi_version, flag_access_control, flag_alt_external_templates, flag_check_new, flag_cond_mismatch, flag_conserve_space, flag_const_strings, flag_default_inline, flag_detailed_statistics, flag_elide_constructors, flag_enforce_eh_specs, flag_exceptions, flag_external_templates, flag_gen_declaration, flag_hosted, flag_implement_inlines, flag_implicit_inline_templates, flag_implicit_templates, flag_ms_extensions, flag_new_for_scope, flag_next_runtime, flag_no_asm, flag_no_builtin, flag_no_gnu_keywords, flag_no_nonansi_builtin, flag_objc, flag_optional_diags, flag_permissive, flag_preprocess_only, flag_rtti, flag_short_double, flag_short_enums, flag_short_wchar, flag_signed_bitfields, flag_signed_char, flag_undef, flag_use_cxa_atexit, flag_use_repository, flag_vtable_gc, flag_weak, cl_option::flags, free(), handle_OPT_d(), in_fname, cpp_options::inhibit_warnings, len, max_tinst_depth, memcpy, mesg_implicit_function_declaration, missing_arg(), cpp_options::missing_files, N_OPTS, cpp_options::no_line_commands, cpp_options::no_output, cpp_options::no_standard_cplusplus_includes, cpp_options::no_standard_includes, cpp_options::objc, cpp_options::operator_names, opt, cl_option::opt_len, OPT_M, OPT_MD, OPT_MG, OPT_MM, OPT_MMD, out_fname, parse_in, cpp_options::pedantic, cpp_options::pedantic_errors, cpp_options::phony_targets, cpp_options::preprocessed, print_help, cpp_options::print_include_names, print_struct_values, progname, read_integral_parameter(), cpp_options::remap, result, set_std_c89(), set_std_c99(), set_std_cxx98(), set_Wformat(), set_Wimplicit(), set_Wunused(), cpp_options::show_column, strlen(), strtol(), cpp_options::style, cpp_options::tabstop, cpp_options::traditional, cpp_options::trigraphs, cpp_options::verbose, warn_abi, warn_bad_function_cast, warn_cast_qual, warn_char_subscripts, cpp_options::warn_comments, warn_conversion, warn_ctor_dtor_privacy, warn_declaration_after_statement, cpp_options::warn_deprecated, warn_deprecated, warn_div_by_zero, warn_ecpp, cpp_options::warn_endif_labels, warn_float_equal, warn_format_extra_args, warn_format_nonliteral, warn_format_security, warn_format_y2k, warn_format_zero_length, warn_implicit_int, cpp_options::warn_import, warn_long_long, warn_main, warn_missing_braces, warn_missing_declarations, warn_missing_format_attribute, warn_missing_prototypes, cpp_options::warn_multichar, warn_nested_externs, warn_nonnull, warn_nontemplate_friend, warn_nonvdtor, cpp_options::warn_num_sign_change, warn_old_style_cast, warn_overloaded_virtual, warn_parentheses, warn_pmf2ptr, warn_pointer_arith, warn_protocol, warn_redundant_decls, warn_reorder, warn_return_type, warn_selector, warn_sequence_point, warn_sign_compare, warn_sign_promo, warn_strict_aliasing, warn_strict_prototypes, warn_switch, warn_synth, cpp_options::warn_system_headers, warn_traditional, cpp_options::warn_traditional, cpp_options::warn_trigraphs, warn_undeclared_selector, cpp_options::warn_undef, warn_uninitialized, warn_unknown_pragmas, cpp_options::warn_unused_macros, warn_write_strings, warning, cpp_options::warnings_are_errors, and xmalloc().
| const char* c_common_init | ( | char * | filename | ) | const |
Definition at line 1433 of file c-opts.c.
References cb_register_builtins(), cpp_options::char_precision, char_type_node, cpp_get_callbacks(), flag_preprocess_only, in_fname, init_c_lex(), init_pragma(), cpp_options::int_precision, integer_type_node, intmax_type_node, NULL, parse_in, cpp_options::precision, preprocess_file(), TREE_UNSIGNED, TYPE_PRECISION, cpp_options::unsigned_wchar, cpp_options::wchar_precision, and wchar_type_node.
Referenced by c_objc_common_init(), and cxx_init().
| void c_common_init_options | ( | enum c_language_kind | lang | ) |
Definition at line 493 of file c-opts.c.
References c_language, cl_options, clk_c, clk_cplusplus, CLK_GNUC89, CLK_GNUCXX, cpp_create_reader(), cpp_get_options(), error(), flag_const_strings, flag_objc, i, N_OPTS, cpp_options::objc, cl_option::opt_text, parse_in, qsort(), strcmp(), warn_pointer_arith, and warn_sign_compare.
Referenced by c_init_options(), cxx_init_options(), and objc_init_options().
| bool c_common_post_options | ( | ) |
Definition at line 1360 of file c-opts.c.
References check_deps_environment_vars(), cpp_errors(), cpp_options::deps, DEPS_NONE, errorcount, flag_inline_functions, flag_inline_trees, flag_instrument_function_entry_exit, flag_no_inline, flag_preprocess_only, handle_deferred_opts(), in_fname, NULL, out_fname, parse_in, sanitize_cpp_opts(), strcmp(), cpp_options::style, warn_format, warn_format_extra_args, warn_format_nonliteral, warn_format_security, warn_format_y2k, warn_format_zero_length, warn_missing_format_attribute, and warning.
Definition at line 1505 of file c-opts.c.
References defer_opt(), cpp_options::deps, deps_append, deps_file, DEPS_SYSTEM, DEPS_USER, GET_ENVIRONMENT, cpp_options::ignore_main_file, s, strchr, and cpp_options::style.
Referenced by c_common_post_options().
Definition at line 1713 of file c-opts.c.
References cl_options, cl_option::flags, cl_option::opt_text, warning, and write_langs().
Referenced by c_common_decode_option(), and handle_option().
Definition at line 469 of file c-opts.c.
References abort, deferred_opt::arg, deferred_opt::code, deferred_count, deferred_opts, deferred_size, save_argc, and xmalloc().
Referenced by c_common_decode_option(), c_common_handle_option(), and check_deps_environment_vars().
| static size_t find_opt | ( | char * | input, | |
| int | lang_flag | |||
| ) | const [static] |
Definition at line 390 of file c-opts.c.
References CL_JOINED, cl_options, comp, cl_option::flags, N_OPTS, cl_option::opt_len, cl_option::opt_text, result, size_t, and strncmp().
Referenced by c_common_decode_option(), common_handle_option(), handle_option(), and prune_options().
Definition at line 1543 of file c-opts.c.
References abort, deferred_opt::arg, deferred_opt::code, deferred_count, deferred_opts, free(), i, opt, and parse_in.
Referenced by c_common_post_options().
| static void handle_OPT_d | ( | char * | arg | ) | const [static] |
Definition at line 1662 of file c-opts.c.
References c, dump_definitions, cpp_options::dump_includes, cpp_options::dump_macros, dump_names, and dump_only.
Referenced by c_common_decode_option(), and c_common_handle_option().
Definition at line 341 of file c-opts.c.
References cl_options, error(), OPT_MD, OPT_MMD, and cl_option::opt_text.
Referenced by c_common_decode_option().
| static void set_std_c89 PARAMS | ( | (int, int) | ) | [static] |
| static void handle_OPT_d PARAMS | ( | (const char *) | ) | [static] |
Definition at line 635 of file mips-tfile.c.
Definition at line 77 of file cplus-dem.c.
| static void write_langs PARAMS | ( | (char *, int) | ) | [static] |
| static void set_Wimplicit PARAMS | ( | (int) | ) | [static] |
| static size_t find_opt PARAMS | ( | (const char *, int) | ) | [static] |
| static void preprocess_file | ( | ) | [static] |
Definition at line 1415 of file c-opts.c.
References cpp_preprocess_file(), fopen, in_fname, NULL, out_fname, out_stream, and parse_in.
Referenced by c_common_init().
Definition at line 1569 of file c-opts.c.
References cpp_options::deps, DEPS_NONE, deps_seen, cpp_options::dump_includes, cpp_options::dump_macros, dump_none, dump_only, error(), flag_isoc99, flag_signed_char, cpp_options::no_output, pedantic, STDC_0_IN_SYSTEM_HEADERS, cpp_options::stdc_0_in_system_headers, cpp_options::style, cpp_options::unsigned_char, warn_long_long, cpp_options::warn_long_long, and warn_traditional.
Referenced by c_common_post_options().
| static void set_std_c89 | ( | int | c94, | |
| int | iso | |||
| ) | [static] |
Definition at line 1602 of file c-opts.c.
References CLK_GNUC89, CLK_STDC89, CLK_STDC94, cpp_set_lang(), flag_iso, flag_isoc94, flag_isoc99, flag_no_asm, flag_no_gnu_keywords, flag_no_nonansi_builtin, flag_noniso_default_format_attributes, flag_writable_strings, and parse_in.
Referenced by c_common_decode_option(), and c_common_handle_option().
| static void set_std_c99 | ( | int | iso | ) | [static] |
Definition at line 1618 of file c-opts.c.
References CLK_GNUC99, CLK_STDC99, cpp_set_lang(), flag_iso, flag_isoc94, flag_isoc99, flag_no_asm, flag_no_nonansi_builtin, flag_noniso_default_format_attributes, flag_writable_strings, and parse_in.
Referenced by c_common_decode_option(), and c_common_handle_option().
| static void set_std_cxx98 | ( | int | iso | ) | [static] |
Definition at line 1633 of file c-opts.c.
References CLK_CXX98, CLK_GNUCXX, cpp_set_lang(), flag_iso, flag_no_gnu_keywords, flag_no_nonansi_builtin, flag_noniso_default_format_attributes, and parse_in.
Referenced by c_common_decode_option(), and c_common_handle_option().
| static void set_Wimplicit | ( | int | on | ) | [static] |
Definition at line 1645 of file c-opts.c.
References mesg_implicit_function_declaration, warn_implicit, and warn_implicit_int.
Referenced by c_common_decode_option(), and c_common_handle_option().
| static void write_langs | ( | char * | buf, | |
| int | flags | |||
| ) | [static] |
Definition at line 1690 of file c-opts.c.
References CL_C_ONLY, CL_CXX_ONLY, CL_OBJC_ONLY, and strcat().
Referenced by complain_wrong_lang().
struct cl_option cl_options[] [static] |
Initial value:
Definition at line 307 of file c-opts.c.
Referenced by c_common_decode_option(), c_common_handle_option(), c_common_init_options(), cancel_option(), common_handle_option(), complain_wrong_lang(), default_pch_valid_p(), diagnostic_report_diagnostic(), find_opt(), get_option_state(), handle_option(), handle_pragma_diagnostic(), missing_arg(), option_affects_pch_p(), option_enabled(), print_filtered_help(), print_switch_values(), print_target_help(), and prune_options().
cpp_options* cpp_opts [static] |
size_t deferred_count [static] |
Definition at line 54 of file c-opts.c.
Referenced by defer_opt(), finish_options(), handle_deferred_opts(), and push_command_line_include().
struct deferred_opt * deferred_opts [static] |
Referenced by c_common_init_options(), defer_opt(), finish_options(), handle_deferred_opts(), and push_command_line_include().
size_t deferred_size [static] |
bool deps_append [static] |
Definition at line 45 of file c-opts.c.
Referenced by c_common_finish(), check_deps_environment_vars(), init_dependency_output(), and output_deps().
const char* deps_file [static] |
Definition at line 51 of file c-opts.c.
Referenced by c_common_decode_option(), c_common_finish(), c_common_handle_option(), check_deps_environment_vars(), init_dependency_output(), main(), and output_deps().
Definition at line 48 of file c-opts.c.
Referenced by c_common_decode_option(), c_common_handle_option(), check_deps_environment_vars(), handle_deferred_opts(), and sanitize_cpp_opts().
const char* in_fname [static] |
Definition at line 38 of file c-opts.c.
Referenced by c_common_decode_option(), c_common_init(), c_common_post_options(), init_md_reader_args(), init_md_reader_args_cb(), main(), preprocess_file(), write_insn_preds_c(), write_tm_constrs_h(), and write_tm_preds_h().
const char* out_fname [static] |
Definition at line 41 of file c-opts.c.
Referenced by c_common_decode_option(), c_common_finish(), c_common_handle_option(), c_common_post_options(), main(), and preprocess_file().
FILE* out_stream [static] |
Definition at line 42 of file c-opts.c.
Referenced by c_common_finish(), c_common_post_options(), and preprocess_file().
1.5.6