diff options
Diffstat (limited to 'gcc/cp/decl2.c')
-rw-r--r-- | gcc/cp/decl2.c | 318 |
1 files changed, 0 insertions, 318 deletions
diff --git a/gcc/cp/decl2.c b/gcc/cp/decl2.c index 3f2fa1e..2644206 100644 --- a/gcc/cp/decl2.c +++ b/gcc/cp/decl2.c @@ -89,7 +89,6 @@ static tree prune_vars_needing_no_initialization PARAMS ((tree)); static void write_out_vars PARAMS ((tree)); static void import_export_class PARAMS ((tree)); static tree key_method PARAMS ((tree)); -static int compare_options PARAMS ((const PTR, const PTR)); static tree get_guard_bits PARAMS ((tree)); /* A list of static class variables. This is needed, because a @@ -122,323 +121,6 @@ tree static_dtors; tree global_namespace; -/* Table of language-dependent -f options. - STRING is the option name. VARIABLE is the address of the variable. - ON_VALUE is the value to store in VARIABLE - if `-fSTRING' is seen as an option. - (If `-fno-STRING' is seen as an option, the opposite value is stored.) */ - -static const struct { const char *const string; int *const variable; const int on_value;} -lang_f_options[] = -{ - /* C/C++ options. */ - {"signed-char", &flag_signed_char, 1}, - {"unsigned-char", &flag_signed_char, 0}, - {"signed-bitfields", &flag_signed_bitfields, 1}, - {"unsigned-bitfields", &flag_signed_bitfields, 0}, - {"short-enums", &flag_short_enums, 1}, - {"short-double", &flag_short_double, 1}, - {"short-wchar", &flag_short_wchar, 1}, - {"asm", &flag_no_asm, 0}, - {"builtin", &flag_no_builtin, 0}, - - /* C++-only options. */ - {"access-control", &flag_access_control, 1}, - {"check-new", &flag_check_new, 1}, - {"conserve-space", &flag_conserve_space, 1}, - {"const-strings", &flag_const_strings, 1}, - {"default-inline", &flag_default_inline, 1}, - {"dollars-in-identifiers", &dollars_in_ident, 1}, - {"elide-constructors", &flag_elide_constructors, 1}, - {"enforce-eh-specs", &flag_enforce_eh_specs, 1}, - {"external-templates", &flag_external_templates, 1}, - {"for-scope", &flag_new_for_scope, 2}, - {"gnu-keywords", &flag_no_gnu_keywords, 0}, - {"handle-exceptions", &flag_exceptions, 1}, - {"implement-inlines", &flag_implement_inlines, 1}, - {"implicit-inline-templates", &flag_implicit_inline_templates, 1}, - {"implicit-templates", &flag_implicit_templates, 1}, - {"ms-extensions", &flag_ms_extensions, 1}, - {"nonansi-builtins", &flag_no_nonansi_builtin, 0}, - {"optional-diags", &flag_optional_diags, 1}, - {"permissive", &flag_permissive, 1}, - {"repo", &flag_use_repository, 1}, - {"rtti", &flag_rtti, 1}, - {"stats", &flag_detailed_statistics, 1}, - {"vtable-gc", &flag_vtable_gc, 1}, - {"use-cxa-atexit", &flag_use_cxa_atexit, 1}, - {"weak", &flag_weak, 1} -}; - -/* The list of `-f' options that we no longer support. The `-f' - prefix is not given in this table. The `-fno-' variants are not - listed here. This table must be kept in alphabetical order. */ -static const char * const unsupported_options[] = { - "all-virtual", - "cond-mismatch", - "enum-int-equiv", - "guiding-decls", - "honor-std", - "huge-objects", - "labels-ok", - "new-abi", - "nonnull-objects", - "squangle", - "strict-prototype", - "this-is-variable", - "vtable-thunks", - "xref" -}; - -/* Compare two option strings, pointed two by P1 and P2, for use with - bsearch. */ - -static int -compare_options (p1, p2) - const PTR p1; - const PTR p2; -{ - return strcmp (*((const char *const *) p1), *((const char *const *) p2)); -} - -/* Decode the string P as a language-specific option. - Return the number of strings consumed for a valid option. - Otherwise return 0. Should not complain if it does not - recognise the option. */ - -int -cxx_decode_option (argc, argv) - int argc; - char **argv; -{ - int strings_processed; - const char *p = argv[0]; - - strings_processed = cpp_handle_option (parse_in, argc, argv); - - if (p[0] == '-' && p[1] == 'f') - { - /* Some kind of -f option. - P's value is the option sans `-f'. - Search for it in the table of options. */ - const char *option_value = NULL; - const char *positive_option; - size_t j; - - p += 2; - /* Try special -f options. */ - - /* See if this is one of the options no longer supported. We - used to support these options, so we continue to accept them, - with a warning. */ - if (strncmp (p, "no-", strlen ("no-")) == 0) - positive_option = p + strlen ("no-"); - else - positive_option = p; - - /* If the option is present, issue a warning. Indicate to our - caller that the option was processed successfully. */ - if (bsearch (&positive_option, - unsupported_options, - ARRAY_SIZE (unsupported_options), - sizeof (unsupported_options[0]), - compare_options)) - { - warning ("-f%s is no longer supported", p); - return 1; - } - - if (!strcmp (positive_option, "handle-exceptions")) - warning ("-fhandle-exceptions has been renamed to -fexceptions (and is now on by default)"); - else if (!strcmp (p, "alt-external-templates")) - { - flag_external_templates = 1; - flag_alt_external_templates = 1; - cp_deprecated ("-falt-external-templates"); - } - else if (!strcmp (p, "no-alt-external-templates")) - flag_alt_external_templates = 0; - else if (!strcmp (p, "repo")) - { - flag_use_repository = 1; - flag_implicit_templates = 0; - } - else if (!strcmp (p, "external-templates")) - { - flag_external_templates = 1; - cp_deprecated ("-fexternal-templates"); - } - else if ((option_value - = skip_leading_substring (p, "template-depth-"))) - max_tinst_depth - = read_integral_parameter (option_value, p - 2, max_tinst_depth); - else if ((option_value - = skip_leading_substring (p, "name-mangling-version-"))) - { - warning ("-fname-mangling-version is no longer supported"); - return 1; - } - else if ((option_value = skip_leading_substring (p, "no-builtin-"))) - disable_builtin_function (option_value); - else if (dump_switch_p (p)) - ; - else - { - int found = 0; - - for (j = 0; !found && j < ARRAY_SIZE (lang_f_options); j++) - { - if (!strcmp (p, lang_f_options[j].string)) - { - *lang_f_options[j].variable = lang_f_options[j].on_value; - /* A goto here would be cleaner, - but breaks the VAX pcc. */ - found = 1; - } - else if (p[0] == 'n' && p[1] == 'o' && p[2] == '-' - && ! strcmp (p+3, lang_f_options[j].string)) - { - *lang_f_options[j].variable = ! lang_f_options[j].on_value; - found = 1; - } - } - - return found; - } - } - else if (p[0] == '-' && p[1] == 'W') - { - int setting = 1; - - /* The -W options control the warning behavior of the compiler. */ - p += 2; - - if (p[0] == 'n' && p[1] == 'o' && p[2] == '-') - setting = 0, p += 3; - - if (!strcmp (p, "implicit")) - warn_implicit = setting; - else if (!strcmp (p, "long-long")) - warn_long_long = setting; - else if (!strcmp (p, "return-type")) - warn_return_type = setting; - else if (!strcmp (p, "ctor-dtor-privacy")) - warn_ctor_dtor_privacy = setting; - else if (!strcmp (p, "write-strings")) - warn_write_strings = setting; - else if (!strcmp (p, "cast-qual")) - warn_cast_qual = setting; - else if (!strcmp (p, "char-subscripts")) - warn_char_subscripts = setting; - else if (!strcmp (p, "pointer-arith")) - warn_pointer_arith = setting; - else if (!strcmp (p, "missing-prototypes")) - warn_missing_prototypes = setting; - else if (!strcmp (p, "strict-prototypes")) - { - if (setting == 0) - warning ("-Wno-strict-prototypes is not supported in C++"); - } - else if (!strcmp (p, "redundant-decls")) - warn_redundant_decls = setting; - else if (!strcmp (p, "missing-braces")) - warn_missing_braces = setting; - else if (!strcmp (p, "sign-compare")) - warn_sign_compare = setting; - else if (!strcmp (p, "float-equal")) - warn_float_equal = setting; - else if (!strcmp (p, "format")) - set_Wformat (setting); - else if (!strcmp (p, "format=2")) - set_Wformat (2); - else if (!strcmp (p, "format-y2k")) - warn_format_y2k = setting; - else if (!strcmp (p, "format-extra-args")) - warn_format_extra_args = setting; - else if (!strcmp (p, "format-nonliteral")) - warn_format_nonliteral = setting; - else if (!strcmp (p, "format-security")) - warn_format_security = setting; - else if (!strcmp (p, "missing-format-attribute")) - warn_missing_format_attribute = setting; - else if (!strcmp (p, "conversion")) - warn_conversion = setting; - else if (!strcmp (p, "parentheses")) - warn_parentheses = setting; - else if (!strcmp (p, "non-virtual-dtor")) - warn_nonvdtor = setting; - else if (!strcmp (p, "reorder")) - warn_reorder = setting; - else if (!strcmp (p, "synth")) - warn_synth = setting; - else if (!strcmp (p, "pmf-conversions")) - warn_pmf2ptr = setting; - else if (!strcmp (p, "effc++")) - warn_ecpp = setting; - else if (!strcmp (p, "sign-promo")) - warn_sign_promo = setting; - else if (!strcmp (p, "old-style-cast")) - warn_old_style_cast = setting; - else if (!strcmp (p, "overloaded-virtual")) - warn_overloaded_virtual = setting; - else if (!strcmp (p, "multichar")) - warn_multichar = setting; - else if (!strcmp (p, "unknown-pragmas")) - /* Set to greater than 1, so that even unknown pragmas in - system headers will be warned about. */ - warn_unknown_pragmas = setting * 2; - else if (!strcmp (p, "non-template-friend")) - warn_nontemplate_friend = setting; - else if (!strcmp (p, "deprecated")) - warn_deprecated = setting; - else if (!strcmp (p, "all")) - { - warn_return_type = setting; - set_Wunused (setting); - warn_implicit = setting; - warn_switch = setting; - set_Wformat (setting); - warn_parentheses = setting; - warn_missing_braces = setting; - warn_sign_compare = setting; - warn_multichar = setting; - /* We save the value of warn_uninitialized, since if they put - -Wuninitialized on the command line, we need to generate a - warning about not using it without also specifying -O. */ - if (warn_uninitialized != 1) - warn_uninitialized = (setting ? 2 : 0); - /* Only warn about unknown pragmas that are not in system - headers. */ - warn_unknown_pragmas = 1; - - /* C++-specific warnings. */ - warn_ctor_dtor_privacy = setting; - warn_nonvdtor = setting; - warn_reorder = setting; - warn_nontemplate_friend = setting; - } - else return strings_processed; - } - else if (!strcmp (p, "-E")) - flag_preprocess_only = 1; - else if (!strcmp (p, "-undef")) - flag_undef = 1; - else if (!strcmp (p, "-ansi")) - flag_no_nonansi_builtin = 1, flag_iso = 1, - flag_noniso_default_format_attributes = 0, flag_no_gnu_keywords = 1; -#ifdef SPEW_DEBUG - /* Undocumented, only ever used when you're invoking cc1plus by hand, since - it's probably safe to assume no sane person would ever want to use this - under normal circumstances. */ - else if (!strcmp (p, "-spew-debug")) - spew_debug = 1; -#endif - else - return strings_processed; - - return 1; -} - /* Incorporate `const' and `volatile' qualifiers for member functions. FUNCTION is a TYPE_DECL or a FUNCTION_DECL. QUALS is a list of qualifiers. Returns any explicit |