1*e4b17023SJohn Marino /* Default common target hook functions.
2*e4b17023SJohn Marino Copyright (C) 2003, 2004, 2005, 2007, 2008, 2009, 2010, 2011
3*e4b17023SJohn Marino Free Software Foundation, Inc.
4*e4b17023SJohn Marino
5*e4b17023SJohn Marino This file is part of GCC.
6*e4b17023SJohn Marino
7*e4b17023SJohn Marino GCC is free software; you can redistribute it and/or modify it under
8*e4b17023SJohn Marino the terms of the GNU General Public License as published by the Free
9*e4b17023SJohn Marino Software Foundation; either version 3, or (at your option) any later
10*e4b17023SJohn Marino version.
11*e4b17023SJohn Marino
12*e4b17023SJohn Marino GCC is distributed in the hope that it will be useful, but WITHOUT ANY
13*e4b17023SJohn Marino WARRANTY; without even the implied warranty of MERCHANTABILITY or
14*e4b17023SJohn Marino FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
15*e4b17023SJohn Marino for more details.
16*e4b17023SJohn Marino
17*e4b17023SJohn Marino You should have received a copy of the GNU General Public License
18*e4b17023SJohn Marino along with GCC; see the file COPYING3. If not see
19*e4b17023SJohn Marino <http://www.gnu.org/licenses/>. */
20*e4b17023SJohn Marino
21*e4b17023SJohn Marino #include "config.h"
22*e4b17023SJohn Marino #include "system.h"
23*e4b17023SJohn Marino #include "coretypes.h"
24*e4b17023SJohn Marino #include "input.h"
25*e4b17023SJohn Marino #include "tm.h"
26*e4b17023SJohn Marino #include "common/common-target.h"
27*e4b17023SJohn Marino #include "common/common-targhooks.h"
28*e4b17023SJohn Marino
29*e4b17023SJohn Marino /* Determine the exception handling mechanism for the target. */
30*e4b17023SJohn Marino
31*e4b17023SJohn Marino enum unwind_info_type
default_except_unwind_info(struct gcc_options * opts ATTRIBUTE_UNUSED)32*e4b17023SJohn Marino default_except_unwind_info (struct gcc_options *opts ATTRIBUTE_UNUSED)
33*e4b17023SJohn Marino {
34*e4b17023SJohn Marino /* Obey the configure switch to turn on sjlj exceptions. */
35*e4b17023SJohn Marino #ifdef CONFIG_SJLJ_EXCEPTIONS
36*e4b17023SJohn Marino if (CONFIG_SJLJ_EXCEPTIONS)
37*e4b17023SJohn Marino return UI_SJLJ;
38*e4b17023SJohn Marino #endif
39*e4b17023SJohn Marino
40*e4b17023SJohn Marino /* ??? Change all users to the hook, then poison this. */
41*e4b17023SJohn Marino #ifdef DWARF2_UNWIND_INFO
42*e4b17023SJohn Marino if (DWARF2_UNWIND_INFO)
43*e4b17023SJohn Marino return UI_DWARF2;
44*e4b17023SJohn Marino #endif
45*e4b17023SJohn Marino
46*e4b17023SJohn Marino return UI_SJLJ;
47*e4b17023SJohn Marino }
48*e4b17023SJohn Marino
49*e4b17023SJohn Marino /* To be used by targets that force dwarf2 unwind enabled. */
50*e4b17023SJohn Marino
51*e4b17023SJohn Marino enum unwind_info_type
dwarf2_except_unwind_info(struct gcc_options * opts ATTRIBUTE_UNUSED)52*e4b17023SJohn Marino dwarf2_except_unwind_info (struct gcc_options *opts ATTRIBUTE_UNUSED)
53*e4b17023SJohn Marino {
54*e4b17023SJohn Marino /* Obey the configure switch to turn on sjlj exceptions. */
55*e4b17023SJohn Marino #ifdef CONFIG_SJLJ_EXCEPTIONS
56*e4b17023SJohn Marino if (CONFIG_SJLJ_EXCEPTIONS)
57*e4b17023SJohn Marino return UI_SJLJ;
58*e4b17023SJohn Marino #endif
59*e4b17023SJohn Marino
60*e4b17023SJohn Marino return UI_DWARF2;
61*e4b17023SJohn Marino }
62*e4b17023SJohn Marino
63*e4b17023SJohn Marino /* To be used by targets that force sjlj unwind enabled. */
64*e4b17023SJohn Marino
65*e4b17023SJohn Marino enum unwind_info_type
sjlj_except_unwind_info(struct gcc_options * opts ATTRIBUTE_UNUSED)66*e4b17023SJohn Marino sjlj_except_unwind_info (struct gcc_options *opts ATTRIBUTE_UNUSED)
67*e4b17023SJohn Marino {
68*e4b17023SJohn Marino return UI_SJLJ;
69*e4b17023SJohn Marino }
70*e4b17023SJohn Marino
71*e4b17023SJohn Marino /* Default version of TARGET_HANDLE_OPTION. */
72*e4b17023SJohn Marino
73*e4b17023SJohn Marino bool
default_target_handle_option(struct gcc_options * opts ATTRIBUTE_UNUSED,struct gcc_options * opts_set ATTRIBUTE_UNUSED,const struct cl_decoded_option * decoded ATTRIBUTE_UNUSED,location_t loc ATTRIBUTE_UNUSED)74*e4b17023SJohn Marino default_target_handle_option (struct gcc_options *opts ATTRIBUTE_UNUSED,
75*e4b17023SJohn Marino struct gcc_options *opts_set ATTRIBUTE_UNUSED,
76*e4b17023SJohn Marino const struct cl_decoded_option *decoded ATTRIBUTE_UNUSED,
77*e4b17023SJohn Marino location_t loc ATTRIBUTE_UNUSED)
78*e4b17023SJohn Marino {
79*e4b17023SJohn Marino return true;
80*e4b17023SJohn Marino }
81*e4b17023SJohn Marino
82*e4b17023SJohn Marino const struct default_options empty_optimization_table[] =
83*e4b17023SJohn Marino {
84*e4b17023SJohn Marino { OPT_LEVELS_NONE, 0, NULL, 0 }
85*e4b17023SJohn Marino };
86