[gcc]
[official-gcc.git] / gcc / c / c-lang.c
blob510b7e7de4786efa73c24c8fdccff3ce8347e7da
1 /* Language-specific hook definitions for C front end.
2 Copyright (C) 1991-2017 Free Software Foundation, Inc.
4 This file is part of GCC.
6 GCC is free software; you can redistribute it and/or modify it under
7 the terms of the GNU General Public License as published by the Free
8 Software Foundation; either version 3, or (at your option) any later
9 version.
11 GCC is distributed in the hope that it will be useful, but WITHOUT ANY
12 WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 for more details.
16 You should have received a copy of the GNU General Public License
17 along with GCC; see the file COPYING3. If not see
18 <http://www.gnu.org/licenses/>. */
21 #include "config.h"
22 #include "system.h"
23 #include "coretypes.h"
24 #include "c-tree.h"
25 #include "langhooks.h"
26 #include "langhooks-def.h"
27 #include "c-objc-common.h"
29 enum c_language_kind c_language = clk_c;
31 /* Lang hooks common to C and ObjC are declared in c-objc-common.h;
32 consequently, there should be very few hooks below. */
34 #undef LANG_HOOKS_NAME
35 #define LANG_HOOKS_NAME "GNU C"
36 #undef LANG_HOOKS_INIT
37 #define LANG_HOOKS_INIT c_objc_common_init
38 #undef LANG_HOOKS_INIT_TS
39 #define LANG_HOOKS_INIT_TS c_common_init_ts
41 #if CHECKING_P
42 #undef LANG_HOOKS_RUN_LANG_SELFTESTS
43 #define LANG_HOOKS_RUN_LANG_SELFTESTS selftest::run_c_tests
44 #endif /* #if CHECKING_P */
46 #undef LANG_HOOKS_GET_SUBSTRING_LOCATION
47 #define LANG_HOOKS_GET_SUBSTRING_LOCATION c_get_substring_location
49 /* Each front end provides its own lang hook initializer. */
50 struct lang_hooks lang_hooks = LANG_HOOKS_INITIALIZER;
52 #if CHECKING_P
54 namespace selftest {
56 /* Implementation of LANG_HOOKS_RUN_LANG_SELFTESTS for the C frontend. */
58 void
59 run_c_tests (void)
61 c_format_c_tests ();
64 } // namespace selftest
66 #endif /* #if CHECKING_P */
69 #include "gtype-c.h"