xref: /dflybsd-src/contrib/gcc-4.7/gcc/objc/objc-lang.c (revision 04febcfb30580676d3e95f58a16c5137ee478b32)
1*e4b17023SJohn Marino /* Language-dependent hooks for Objective-C.
2*e4b17023SJohn Marino    Copyright 2001, 2002, 2003, 2004, 2005, 2007, 2008, 2010, 2011
3*e4b17023SJohn Marino    Free Software Foundation, Inc.
4*e4b17023SJohn Marino    Contributed by Ziemowit Laski  <zlaski@apple.com>
5*e4b17023SJohn Marino 
6*e4b17023SJohn Marino This file is part of GCC.
7*e4b17023SJohn Marino 
8*e4b17023SJohn Marino GCC is free software; you can redistribute it and/or modify
9*e4b17023SJohn Marino it under the terms of the GNU General Public License as published by
10*e4b17023SJohn Marino the Free Software Foundation; either version 3, or (at your option)
11*e4b17023SJohn Marino any later version.
12*e4b17023SJohn Marino 
13*e4b17023SJohn Marino GCC is distributed in the hope that it will be useful,
14*e4b17023SJohn Marino but WITHOUT ANY WARRANTY; without even the implied warranty of
15*e4b17023SJohn Marino MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16*e4b17023SJohn Marino GNU General Public License for more details.
17*e4b17023SJohn Marino 
18*e4b17023SJohn Marino You should have received a copy of the GNU General Public License
19*e4b17023SJohn Marino along with GCC; see the file COPYING3.  If not see
20*e4b17023SJohn Marino <http://www.gnu.org/licenses/>.  */
21*e4b17023SJohn Marino 
22*e4b17023SJohn Marino 
23*e4b17023SJohn Marino #include "config.h"
24*e4b17023SJohn Marino #include "system.h"
25*e4b17023SJohn Marino #include "coretypes.h"
26*e4b17023SJohn Marino #include "tm.h"
27*e4b17023SJohn Marino #include "tree.h"
28*e4b17023SJohn Marino #include "c-tree.h"
29*e4b17023SJohn Marino #include "c-family/c-common.h"
30*e4b17023SJohn Marino #include "c-family/c-objc.h"
31*e4b17023SJohn Marino #include "ggc.h"
32*e4b17023SJohn Marino #include "objc-act.h"
33*e4b17023SJohn Marino #include "langhooks.h"
34*e4b17023SJohn Marino #include "langhooks-def.h"
35*e4b17023SJohn Marino #include "c-objc-common.h"
36*e4b17023SJohn Marino #include "c-lang.h"
37*e4b17023SJohn Marino 
38*e4b17023SJohn Marino enum c_language_kind c_language = clk_objc;
39*e4b17023SJohn Marino 
40*e4b17023SJohn Marino /* Lang hooks common to C and ObjC are declared in c-objc-common.h;
41*e4b17023SJohn Marino    consequently, there should be very few hooks below.  */
42*e4b17023SJohn Marino 
43*e4b17023SJohn Marino #undef LANG_HOOKS_NAME
44*e4b17023SJohn Marino #define LANG_HOOKS_NAME "GNU Objective-C"
45*e4b17023SJohn Marino #undef LANG_HOOKS_INIT
46*e4b17023SJohn Marino #define LANG_HOOKS_INIT objc_init
47*e4b17023SJohn Marino #undef LANG_HOOKS_DECL_PRINTABLE_NAME
48*e4b17023SJohn Marino #define LANG_HOOKS_DECL_PRINTABLE_NAME objc_printable_name
49*e4b17023SJohn Marino #undef LANG_HOOKS_GIMPLIFY_EXPR
50*e4b17023SJohn Marino #define LANG_HOOKS_GIMPLIFY_EXPR objc_gimplify_expr
51*e4b17023SJohn Marino #undef LANG_HOOKS_INIT_TS
52*e4b17023SJohn Marino #define LANG_HOOKS_INIT_TS objc_common_init_ts
53*e4b17023SJohn Marino 
54*e4b17023SJohn Marino /* Each front end provides its own lang hook initializer.  */
55*e4b17023SJohn Marino struct lang_hooks lang_hooks = LANG_HOOKS_INITIALIZER;
56*e4b17023SJohn Marino 
57*e4b17023SJohn Marino /* Lang hook routines common to C and ObjC appear in c-objc-common.c;
58*e4b17023SJohn Marino    there should be very few (if any) routines below.  */
59*e4b17023SJohn Marino 
60*e4b17023SJohn Marino #include "gtype-objc.h"
61