OSDN Git Service

* Makefile.in (integrate.o): Update.
[pf3gnuchains/gcc-fork.git] / gcc / cp / cp-lang.c
1 /* Language-dependent hooks for C++.
2    Copyright 2001 Free Software Foundation, Inc.
3    Contributed by Alexandre Oliva  <aoliva@redhat.com>
4
5 This file is part of GNU CC.
6
7 GNU CC is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 2, or (at your option)
10 any later version.
11
12 GNU CC is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15 GNU General Public License for more details.
16
17 You should have received a copy of the GNU General Public License
18 along with GNU CC; see the file COPYING.  If not, write to
19 the Free Software Foundation, 59 Temple Place - Suite 330,
20 Boston, MA 02111-1307, USA.  */
21
22 #include "config.h"
23 #include "system.h"
24 #include "tree.h"
25 #include "cp-tree.h"
26 #include "c-common.h"
27 #include "toplev.h"
28 #include "langhooks.h"
29 #include "langhooks-def.h"
30
31 static HOST_WIDE_INT cxx_get_alias_set PARAMS ((tree));
32
33 #undef LANG_HOOKS_NAME
34 #define LANG_HOOKS_NAME "GNU C++"
35 #undef LANG_HOOKS_INIT
36 #define LANG_HOOKS_INIT cxx_init
37 #undef LANG_HOOKS_FINISH
38 #define LANG_HOOKS_FINISH cxx_finish
39 #undef LANG_HOOKS_CLEAR_BINDING_STACK
40 #define LANG_HOOKS_CLEAR_BINDING_STACK pop_everything
41 #undef LANG_HOOKS_INIT_OPTIONS
42 #define LANG_HOOKS_INIT_OPTIONS cxx_init_options
43 #undef LANG_HOOKS_DECODE_OPTION
44 #define LANG_HOOKS_DECODE_OPTION cxx_decode_option
45 #undef LANG_HOOKS_POST_OPTIONS
46 #define LANG_HOOKS_POST_OPTIONS cxx_post_options
47 #undef LANG_HOOKS_GET_ALIAS_SET
48 #define LANG_HOOKS_GET_ALIAS_SET cxx_get_alias_set
49 #undef LANG_HOOKS_EXPAND_CONSTANT
50 #define LANG_HOOKS_EXPAND_CONSTANT cplus_expand_constant
51 #undef LANG_HOOKS_SAFE_FROM_P
52 #define LANG_HOOKS_SAFE_FROM_P c_safe_from_p
53 #undef LANG_HOOKS_DUP_LANG_SPECIFIC_DECL
54 #define LANG_HOOKS_DUP_LANG_SPECIFIC_DECL cxx_dup_lang_specific_decl
55 #undef LANG_HOOKS_PRINT_STATISTICS
56 #define LANG_HOOKS_PRINT_STATISTICS cxx_print_statistics
57 #undef LANG_HOOKS_PRINT_XNODE
58 #define LANG_HOOKS_PRINT_XNODE cxx_print_xnode
59 #undef LANG_HOOKS_PRINT_DECL
60 #define LANG_HOOKS_PRINT_DECL cxx_print_decl
61 #undef LANG_HOOKS_PRINT_TYPE
62 #define LANG_HOOKS_PRINT_TYPE cxx_print_type
63 #undef LANG_HOOKS_PRINT_IDENTIFIER
64 #define LANG_HOOKS_PRINT_IDENTIFIER cxx_print_identifier
65 #undef LANG_HOOKS_SET_YYDEBUG
66 #define LANG_HOOKS_SET_YYDEBUG cxx_set_yydebug
67
68 #undef LANG_HOOKS_TREE_INLINING_WALK_SUBTREES
69 #define LANG_HOOKS_TREE_INLINING_WALK_SUBTREES \
70   cp_walk_subtrees
71 #undef LANG_HOOKS_TREE_INLINING_CANNOT_INLINE_TREE_FN
72 #define LANG_HOOKS_TREE_INLINING_CANNOT_INLINE_TREE_FN \
73   cp_cannot_inline_tree_fn
74 #undef LANG_HOOKS_TREE_INLINING_ADD_PENDING_FN_DECLS
75 #define LANG_HOOKS_TREE_INLINING_ADD_PENDING_FN_DECLS \
76   cp_add_pending_fn_decls
77 #undef LANG_HOOKS_TREE_INLINING_TREE_CHAIN_MATTERS_P
78 #define LANG_HOOKS_TREE_INLINING_TREE_CHAIN_MATTERS_P \
79   cp_is_overload_p
80 #undef LANG_HOOKS_TREE_INLINING_AUTO_VAR_IN_FN_P
81 #define LANG_HOOKS_TREE_INLINING_AUTO_VAR_IN_FN_P \
82   cp_auto_var_in_fn_p
83 #undef LANG_HOOKS_TREE_INLINING_COPY_RES_DECL_FOR_INLINING
84 #define LANG_HOOKS_TREE_INLINING_COPY_RES_DECL_FOR_INLINING \
85   cp_copy_res_decl_for_inlining
86 #undef LANG_HOOKS_TREE_INLINING_ANON_AGGR_TYPE_P
87 #define LANG_HOOKS_TREE_INLINING_ANON_AGGR_TYPE_P anon_aggr_type_p
88 #undef LANG_HOOKS_TREE_INLINING_START_INLINING
89 #define LANG_HOOKS_TREE_INLINING_START_INLINING cp_start_inlining
90 #undef LANG_HOOKS_TREE_INLINING_END_INLINING
91 #define LANG_HOOKS_TREE_INLINING_END_INLINING cp_end_inlining
92 #undef LANG_HOOKS_TREE_DUMP_DUMP_TREE_FN
93 #define LANG_HOOKS_TREE_DUMP_DUMP_TREE_FN cp_dump_tree
94 #undef LANG_HOOKS_TREE_DUMP_TYPE_QUALS_FN
95 #define LANG_HOOKS_TREE_DUMP_TYPE_QUALS_FN cp_type_quals
96
97 /* Each front end provides its own hooks, for toplev.c.  */
98 const struct lang_hooks lang_hooks = LANG_HOOKS_INITIALIZER;
99
100 /* Special routine to get the alias set for C++.  */
101
102 static HOST_WIDE_INT
103 cxx_get_alias_set (t)
104      tree t;
105 {
106   /* It's not yet safe to use alias sets for classes in C++ because
107      the TYPE_FIELDs list for a class doesn't mention base classes.  */
108   if (AGGREGATE_TYPE_P (t))
109     return 0;
110
111   return c_common_get_alias_set (t);
112 }