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