xref: /netbsd-src/external/gpl3/gcc.old/dist/gcc/common/common-target.def (revision 8feb0f0b7eaff0608f8350bbfa3098827b4bb91b)
136ac495dSmrg/* Target hook definitions for common hooks.
2*8feb0f0bSmrg   Copyright (C) 2011-2020 Free Software Foundation, Inc.
336ac495dSmrg
436ac495dSmrg   This program is free software; you can redistribute it and/or modify it
536ac495dSmrg   under the terms of the GNU General Public License as published by the
636ac495dSmrg   Free Software Foundation; either version 3, or (at your option) any
736ac495dSmrg   later version.
836ac495dSmrg
936ac495dSmrg   This program is distributed in the hope that it will be useful,
1036ac495dSmrg   but WITHOUT ANY WARRANTY; without even the implied warranty of
1136ac495dSmrg   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
1236ac495dSmrg   GNU General Public License for more details.
1336ac495dSmrg
1436ac495dSmrg   You should have received a copy of the GNU General Public License
1536ac495dSmrg   along with this program; see the file COPYING3.  If not see
1636ac495dSmrg   <http://www.gnu.org/licenses/>.  */
1736ac495dSmrg
1836ac495dSmrg/* See target-hooks-macros.h for details of macros that should be
1936ac495dSmrg   provided by the including file, and how to use them here.  */
2036ac495dSmrg#include "target-hooks-macros.h"
2136ac495dSmrg
2236ac495dSmrg#undef HOOK_TYPE
2336ac495dSmrg#define HOOK_TYPE "Common Target Hook"
2436ac495dSmrg
2536ac495dSmrgHOOK_VECTOR (TARGETM_COMMON_INITIALIZER, gcc_targetm_common)
2636ac495dSmrg
2736ac495dSmrg#undef HOOK_PREFIX
2836ac495dSmrg#define HOOK_PREFIX "TARGET_"
2936ac495dSmrg
3036ac495dSmrg/* Handle target switch DECODED for options structures OPTS and
3136ac495dSmrg   OPTS_SET, at location LOC.  Return true if the switch was valid.  */
3236ac495dSmrgDEFHOOK
3336ac495dSmrg(handle_option,
3436ac495dSmrg "",
3536ac495dSmrg bool, (struct gcc_options *opts, struct gcc_options *opts_set,
3636ac495dSmrg	const struct cl_decoded_option *decoded,
3736ac495dSmrg	location_t loc),
3836ac495dSmrg default_target_handle_option)
3936ac495dSmrg
4036ac495dSmrgDEFHOOK
4136ac495dSmrg(option_init_struct,
4236ac495dSmrg"Set target-dependent initial values of fields in @var{opts}.",
4336ac495dSmrg void, (struct gcc_options *opts),
4436ac495dSmrg hook_void_gcc_optionsp)
4536ac495dSmrg
4636ac495dSmrg/* Set default optimizations for the target.  */
4736ac495dSmrgDEFHOOKPOD
4836ac495dSmrg(option_optimization_table,
4936ac495dSmrg "",
5036ac495dSmrg const struct default_options *, empty_optimization_table)
5136ac495dSmrg
5236ac495dSmrg/* The initial value of target_flags.  */
5336ac495dSmrgDEFHOOKPOD
5436ac495dSmrg(default_target_flags,
5536ac495dSmrg "",
5636ac495dSmrg int, 0)
5736ac495dSmrg
5836ac495dSmrg/* Determine the type of unwind info to emit for exceptions.  */
5936ac495dSmrgDEFHOOK
6036ac495dSmrg(except_unwind_info,
6136ac495dSmrg "",
6236ac495dSmrg enum unwind_info_type, (struct gcc_options *opts),
6336ac495dSmrg default_except_unwind_info)
6436ac495dSmrg
6536ac495dSmrgDEFHOOK
6636ac495dSmrg(supports_split_stack,
6736ac495dSmrg "Whether this target supports splitting the stack when the options\
6836ac495dSmrg described in @var{opts} have been passed.  This is called\
6936ac495dSmrg after options have been parsed, so the target may reject splitting\
7036ac495dSmrg the stack in some configurations.  The default version of this hook\
7136ac495dSmrg returns false.  If @var{report} is true, this function may issue a warning\
7236ac495dSmrg or error; if @var{report} is false, it must simply return a value",
7336ac495dSmrg bool, (bool report, struct gcc_options *opts),
7436ac495dSmrg hook_bool_bool_gcc_optionsp_false)
7536ac495dSmrg
76c0a68be4SmrgDEFHOOK
77c0a68be4Smrg(get_valid_option_values,
78c0a68be4Smrg"The hook is used for options that have a non-trivial list of\
79c0a68be4Smrg possible option values.  OPTION_CODE is option code of opt_code\
80c0a68be4Smrg enum type.  PREFIX is used for bash completion and allows an implementation\
81c0a68be4Smrg to return more specific completion based on the prefix.  All string values\
82c0a68be4Smrg should be allocated from heap memory and consumers should release them. \
83c0a68be4Smrg The result will be pruned to cases with PREFIX if not NULL.",
84c0a68be4Smrg vec<const char *>, (int option_code, const char *prefix),
85c0a68be4Smrg default_get_valid_option_values)
86c0a68be4Smrg
8736ac495dSmrg/* Leave the boolean fields at the end.  */
8836ac495dSmrg
8936ac495dSmrg/* True if unwinding tables should be generated by default.  */
9036ac495dSmrgDEFHOOKPOD
9136ac495dSmrg(unwind_tables_default,
9236ac495dSmrg "",
9336ac495dSmrg bool, false)
9436ac495dSmrg
9536ac495dSmrg/* True if arbitrary sections are supported.  */
9636ac495dSmrgDEFHOOKPOD
9736ac495dSmrg(have_named_sections,
9836ac495dSmrg "",
9936ac495dSmrg bool, true)
10036ac495dSmrg
10136ac495dSmrgDEFHOOKPOD
10236ac495dSmrg(always_strip_dotdot,
10336ac495dSmrg "True if @file{..} components should always be removed from directory names\
10436ac495dSmrg computed relative to GCC's internal directories, false (default) if such\
10536ac495dSmrg components should be preserved and directory names containing them passed\
10636ac495dSmrg to other tools such as the linker.",
10736ac495dSmrg bool, false)
10836ac495dSmrg
10936ac495dSmrgHOOK_VECTOR_END (C90_EMPTY_HACK)
11036ac495dSmrg
11136ac495dSmrg#undef HOOK_PREFIX
112