]> git.ipfire.org Git - thirdparty/gcc.git/blame - gcc/common/common-targhooks.c
target-def.h (TARGET_HAVE_NAMED_SECTIONS): Move to common/common-target-def.h.
[thirdparty/gcc.git] / gcc / common / common-targhooks.c
CommitLineData
677f3fa8
JM
1/* Default common target hook functions.
2 Copyright (C) 2003, 2004, 2005, 2007, 2008, 2009, 2010, 2011
3 Free Software Foundation, Inc.
4
5This file is part of GCC.
6
7GCC is free software; you can redistribute it and/or modify it under
8the terms of the GNU General Public License as published by the Free
9Software Foundation; either version 3, or (at your option) any later
10version.
11
12GCC is distributed in the hope that it will be useful, but WITHOUT ANY
13WARRANTY; without even the implied warranty of MERCHANTABILITY or
14FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
15for more details.
16
17You should have received a copy of the GNU General Public License
18along with GCC; see the file COPYING3. If not see
19<http://www.gnu.org/licenses/>. */
20
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"
28
29/* Determine the exception handling mechanism for the target. */
30
31enum unwind_info_type
32default_except_unwind_info (struct gcc_options *opts ATTRIBUTE_UNUSED)
33{
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
39
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
45
46 return UI_SJLJ;
47}
48
49/* To be used by targets that force dwarf2 unwind enabled. */
50
51enum unwind_info_type
52dwarf2_except_unwind_info (struct gcc_options *opts ATTRIBUTE_UNUSED)
53{
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
59
60 return UI_DWARF2;
61}
62
63/* To be used by targets that force sjlj unwind enabled. */
64
65enum unwind_info_type
66sjlj_except_unwind_info (struct gcc_options *opts ATTRIBUTE_UNUSED)
67{
68 return UI_SJLJ;
69}
70
71/* Default version of TARGET_HANDLE_OPTION. */
72
73bool
74default_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)
78{
79 return true;
80}
81
82const struct default_options empty_optimization_table[] =
83 {
84 { OPT_LEVELS_NONE, 0, NULL, 0 }
85 };