#include "system.h"
#include "intl.h"
#include "coretypes.h"
-#include "tm.h" /* Needed by rtl.h and used for STACK_CHECK_BUILTIN,
+#include "tm.h" /* For STACK_CHECK_BUILTIN,
STACK_CHECK_STATIC_BUILTIN, DEFAULT_GDB_EXTENSIONS,
DWARF2_DEBUGGING_INFO and DBX_DEBUGGING_INFO. */
-#include "rtl.h" /* Needed by insn-attr.h. */
#include "opts.h"
#include "options.h"
#include "flags.h"
#include "params.h"
#include "diagnostic.h"
#include "opts-diagnostic.h"
-#include "insn-attr.h" /* For INSN_SCHEDULING and DELAY_SLOTS. */
-#include "target.h"
+#include "insn-attr-common.h"
+#include "common/common-target.h"
+
+/* Indexed by enum debug_info_type. */
+const char *const debug_type_names[] =
+{
+ "none", "stabs", "coff", "dwarf-2", "xcoff", "vms"
+};
/* Parse the -femit-struct-debug-detailed option value
and set the flag variables. */
{
gcc_assert (dc == global_dc);
gcc_assert (kind == DK_UNSPECIFIED);
- return targetm.handle_option (opts, opts_set, decoded, loc);
+ return targetm_common.handle_option (opts, opts_set, decoded, loc);
}
/* Add comma-separated strings to a char_p vector. */
is set after target options have been processed. */
opts->x_flag_short_enums = 2;
- /* Initialize target_flags before targetm.target_option.optimization
+ /* Initialize target_flags before default_options_optimization
so the latter can modify it. */
- opts->x_target_flags = targetm.default_target_flags;
+ opts->x_target_flags = targetm_common.default_target_flags;
/* Some targets have ABI-specified unwind tables. */
- opts->x_flag_unwind_tables = targetm.unwind_tables_default;
+ opts->x_flag_unwind_tables = targetm_common.unwind_tables_default;
/* Some targets have other target-specific initialization. */
- targetm.target_option.init_struct (opts);
+ targetm_common.option_init_struct (opts);
}
/* If indicated by the optimization level LEVEL (-Os if SIZE is set,
{ OPT_LEVELS_1_PLUS, OPT_fipa_reference, NULL, 1 },
{ OPT_LEVELS_1_PLUS, OPT_fipa_profile, NULL, 1 },
{ OPT_LEVELS_1_PLUS, OPT_fmerge_constants, NULL, 1 },
+ { OPT_LEVELS_1_PLUS, OPT_fshrink_wrap, NULL, 1 },
{ OPT_LEVELS_1_PLUS, OPT_fsplit_wide_types, NULL, 1 },
{ OPT_LEVELS_1_PLUS, OPT_ftree_ccp, NULL, 1 },
{ OPT_LEVELS_1_PLUS, OPT_ftree_bit_ccp, NULL, 1 },
{ OPT_LEVELS_2_PLUS, OPT_falign_jumps, NULL, 1 },
{ OPT_LEVELS_2_PLUS, OPT_falign_labels, NULL, 1 },
{ OPT_LEVELS_2_PLUS, OPT_falign_functions, NULL, 1 },
+ { OPT_LEVELS_2_PLUS, OPT_ftree_tail_merge, NULL, 1 },
+ { OPT_LEVELS_2_PLUS_SPEED_ONLY, OPT_foptimize_strlen, NULL, 1 },
/* -O3 optimizations. */
{ OPT_LEVELS_3_PLUS, OPT_ftree_loop_distribute_patterns, NULL, 1 },
/* Allow default optimizations to be specified on a per-machine basis. */
maybe_default_options (opts, opts_set,
- targetm.target_option.optimization_table,
+ targetm_common.option_optimization_table,
opts->x_optimize, opts->x_optimize_size,
opts->x_optimize_fast, lang_mask, handlers, loc, dc);
}
generating unwind info. If opts->x_flag_exceptions is turned on
we need to turn off the partitioning optimization. */
- ui_except = targetm.except_unwind_info (opts);
+ ui_except = targetm_common.except_unwind_info (opts);
if (opts->x_flag_exceptions
&& opts->x_flag_reorder_blocks_and_partition
optimization. */
if (opts->x_flag_unwind_tables
- && !targetm.unwind_tables_default
+ && !targetm_common.unwind_tables_default
&& opts->x_flag_reorder_blocks_and_partition
&& (ui_except == UI_SJLJ || ui_except == UI_TARGET))
{
support named sections. */
if (opts->x_flag_reorder_blocks_and_partition
- && (!targetm.have_named_sections
+ && (!targetm_common.have_named_sections
|| (opts->x_flag_unwind_tables
- && targetm.unwind_tables_default
+ && targetm_common.unwind_tables_default
&& (ui_except == UI_SJLJ || ui_except == UI_TARGET))))
{
inform (loc,
maybe_set_param_value (PARAM_STACK_FRAME_GROWTH, 40,
opts->x_param_values, opts_set->x_param_values);
}
- if (opts->x_flag_wpa || opts->x_flag_ltrans)
- {
- /* These passes are not WHOPR compatible yet. */
- opts->x_flag_ipa_pta = 0;
- }
if (opts->x_flag_lto)
{
#else
error_at (loc, "LTO support has not been enabled in this configuration");
#endif
- }
+ if (!opts->x_flag_fat_lto_objects && !HAVE_LTO_PLUGIN)
+ error_at (loc, "-fno-fat-lto-objects are supported only with linker plugin.");
+}
if ((opts->x_flag_lto_partition_balanced != 0) + (opts->x_flag_lto_partition_1to1 != 0)
+ (opts->x_flag_lto_partition_none != 0) >= 1)
{
opts->x_flag_split_stack = 0;
else if (opts->x_flag_split_stack)
{
- if (!targetm.supports_split_stack (true, opts))
+ if (!targetm_common.supports_split_stack (true, opts))
{
error_at (loc, "%<-fsplit-stack%> is not supported by "
"this compiler configuration");
/* With the -Q option enabled we change the descriptive text associated
with an option to be an indication of its current setting. */
- if (!quiet_flag)
+ if (!opts->x_quiet_flag)
{
void *flag_var = option_flag_var (i, opts);
/* Sanity check: Make sure that we do not have more
languages than we have bits available to enumerate them. */
- gcc_assert ((1U << cl_lang_count) < CL_MIN_OPTION_CLASS);
+ gcc_assert ((1U << cl_lang_count) <= CL_MIN_OPTION_CLASS);
/* If we have not done so already, obtain
the desired maximum width of the output. */
unsigned int undoc_mask;
unsigned int i;
+ if (lang_mask == CL_DRIVER)
+ break;;
+
undoc_mask = ((opts->x_verbose_flag | opts->x_extra_warnings)
? 0
: CL_UNDOCUMENTED);
}
case OPT__target_help:
+ if (lang_mask == CL_DRIVER)
+ break;
+
print_specific_help (CL_TARGET, CL_UNDOCUMENTED, 0, opts, lang_mask);
opts->x_exit_after_options = true;
-
- /* Allow the target a chance to give the user some additional information. */
- if (targetm.help)
- targetm.help ();
break;
case OPT__help_:
--help=target,^undocumented */
unsigned int exclude_flags = 0;
+ if (lang_mask == CL_DRIVER)
+ break;
+
/* Walk along the argument string, parsing each word in turn.
The format is:
arg = [^]{word}[,{arg}]
}
case OPT__version:
+ if (lang_mask == CL_DRIVER)
+ break;
+
opts->x_exit_after_options = true;
break;
break;
case OPT_Werror_:
+ if (lang_mask == CL_DRIVER)
+ break;
+
enable_warning_as_error (arg, value, lang_mask, handlers,
opts, opts_set, loc, dc);
break;
/* FIXME: Instrumentation we insert makes ipa-reference bitmaps
quadratic. Disable the pass until better memory representation
is done. */
- if (!opts_set->x_flag_ipa_reference && in_lto_p)
+ if (!opts_set->x_flag_ipa_reference && opts->x_in_lto_p)
opts->x_flag_ipa_reference = false;
break;
if (value < 2 || value > 4)
error_at (loc, "dwarf version %d is not supported", value);
else
- dwarf_version = value;
+ opts->x_dwarf_version = value;
set_debug_level (DWARF2_DEBUG, false, "", opts, opts_set, loc);
break;
case OPT_Wuninitialized:
/* Also turn on maybe uninitialized warning. */
- warn_maybe_uninitialized = value;
+ opts->x_warn_maybe_uninitialized = value;
break;
default: