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