1 /* Language hooks common to C++ and ObjC++ front ends.
2 Copyright (C) 2004 Free Software Foundation, Inc.
3 Contributed by Ziemowit Laski <zlaski@apple.com>
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 2, or (at your option) any later
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
17 You should have received a copy of the GNU General Public License
18 along with GCC; see the file COPYING. If not, write to the Free
19 Software Foundation, 59 Temple Place - Suite 330, Boston, MA
22 #ifndef GCC_CP_OBJCP_COMMON
23 #define GCC_CP_OBJCP_COMMON
25 /* In cp/cp-objcp-common.c. */
27 extern HOST_WIDE_INT
cxx_get_alias_set (tree
);
28 extern bool cxx_warn_unused_global_decl (tree
);
29 extern tree
cp_expr_size (tree
);
30 extern size_t cp_tree_size (enum tree_code
);
31 extern bool cp_var_mod_type_p (tree
, tree
);
32 extern void cxx_initialize_diagnostics (struct diagnostic_context
*);
33 extern int cxx_types_compatible_p (tree
, tree
);
35 /* In cp/cp-lang.c and objcp/objcp-lang.c. */
37 extern tree
objcp_tsubst_copy_and_build (tree
, tree
, tsubst_flags_t
,
40 /* Lang hooks that are shared between C++ and ObjC++ are defined here. Hooks
41 specific to C++ or ObjC++ go in cp/cp-lang.c and objcp/objcp-lang.c,
44 #undef LANG_HOOKS_TREE_SIZE
45 #define LANG_HOOKS_TREE_SIZE cp_tree_size
46 #undef LANG_HOOKS_FINISH
47 #define LANG_HOOKS_FINISH cxx_finish
48 #undef LANG_HOOKS_CLEAR_BINDING_STACK
49 #define LANG_HOOKS_CLEAR_BINDING_STACK pop_everything
50 #undef LANG_HOOKS_INIT_OPTIONS
51 #define LANG_HOOKS_INIT_OPTIONS c_common_init_options
52 #undef LANG_HOOKS_INITIALIZE_DIAGNOSTICS
53 #define LANG_HOOKS_INITIALIZE_DIAGNOSTICS cxx_initialize_diagnostics
54 #undef LANG_HOOKS_HANDLE_OPTION
55 #define LANG_HOOKS_HANDLE_OPTION c_common_handle_option
56 #undef LANG_HOOKS_HANDLE_FILENAME
57 #define LANG_HOOKS_HANDLE_FILENAME c_common_handle_filename
58 #undef LANG_HOOKS_MISSING_ARGUMENT
59 #define LANG_HOOKS_MISSING_ARGUMENT c_common_missing_argument
60 #undef LANG_HOOKS_POST_OPTIONS
61 #define LANG_HOOKS_POST_OPTIONS c_common_post_options
62 #undef LANG_HOOKS_GET_ALIAS_SET
63 #define LANG_HOOKS_GET_ALIAS_SET cxx_get_alias_set
64 #undef LANG_HOOKS_EXPAND_CONSTANT
65 #define LANG_HOOKS_EXPAND_CONSTANT cplus_expand_constant
66 #undef LANG_HOOKS_EXPAND_EXPR
67 #define LANG_HOOKS_EXPAND_EXPR cxx_expand_expr
68 #undef LANG_HOOKS_EXPAND_DECL
69 #define LANG_HOOKS_EXPAND_DECL c_expand_decl
70 #undef LANG_HOOKS_PARSE_FILE
71 #define LANG_HOOKS_PARSE_FILE c_common_parse_file
72 #undef LANG_HOOKS_DUP_LANG_SPECIFIC_DECL
73 #define LANG_HOOKS_DUP_LANG_SPECIFIC_DECL cxx_dup_lang_specific_decl
74 #undef LANG_HOOKS_TRUTHVALUE_CONVERSION
75 #define LANG_HOOKS_TRUTHVALUE_CONVERSION c_common_truthvalue_conversion
76 #undef LANG_HOOKS_SET_DECL_ASSEMBLER_NAME
77 #define LANG_HOOKS_SET_DECL_ASSEMBLER_NAME mangle_decl
78 #undef LANG_HOOKS_MARK_ADDRESSABLE
79 #define LANG_HOOKS_MARK_ADDRESSABLE cxx_mark_addressable
80 #undef LANG_HOOKS_PRINT_STATISTICS
81 #define LANG_HOOKS_PRINT_STATISTICS cxx_print_statistics
82 #undef LANG_HOOKS_PRINT_XNODE
83 #define LANG_HOOKS_PRINT_XNODE cxx_print_xnode
84 #undef LANG_HOOKS_PRINT_DECL
85 #define LANG_HOOKS_PRINT_DECL cxx_print_decl
86 #undef LANG_HOOKS_PRINT_TYPE
87 #define LANG_HOOKS_PRINT_TYPE cxx_print_type
88 #undef LANG_HOOKS_PRINT_IDENTIFIER
89 #define LANG_HOOKS_PRINT_IDENTIFIER cxx_print_identifier
90 #undef LANG_HOOKS_TYPES_COMPATIBLE_P
91 #define LANG_HOOKS_TYPES_COMPATIBLE_P cxx_types_compatible_p
92 #undef LANG_HOOKS_PRINT_ERROR_FUNCTION
93 #define LANG_HOOKS_PRINT_ERROR_FUNCTION cxx_print_error_function
94 #undef LANG_HOOKS_WARN_UNUSED_GLOBAL_DECL
95 #define LANG_HOOKS_WARN_UNUSED_GLOBAL_DECL cxx_warn_unused_global_decl
96 #undef LANG_HOOKS_WRITE_GLOBALS
97 #define LANG_HOOKS_WRITE_GLOBALS lhd_do_nothing
98 #undef LANG_HOOKS_COMDAT_GROUP
99 #define LANG_HOOKS_COMDAT_GROUP cxx_comdat_group
101 #undef LANG_HOOKS_FUNCTION_INIT
102 #define LANG_HOOKS_FUNCTION_INIT cxx_push_function_context
103 #undef LANG_HOOKS_FUNCTION_FINAL
104 #define LANG_HOOKS_FUNCTION_FINAL cxx_pop_function_context
105 #undef LANG_HOOKS_FUNCTION_MISSING_NORETURN_OK_P
106 #define LANG_HOOKS_FUNCTION_MISSING_NORETURN_OK_P cp_missing_noreturn_ok_p
108 /* Attribute hooks. */
109 #undef LANG_HOOKS_COMMON_ATTRIBUTE_TABLE
110 #define LANG_HOOKS_COMMON_ATTRIBUTE_TABLE c_common_attribute_table
111 #undef LANG_HOOKS_FORMAT_ATTRIBUTE_TABLE
112 #define LANG_HOOKS_FORMAT_ATTRIBUTE_TABLE c_common_format_attribute_table
113 #undef LANG_HOOKS_ATTRIBUTE_TABLE
114 #define LANG_HOOKS_ATTRIBUTE_TABLE cxx_attribute_table
116 #undef LANG_HOOKS_TREE_INLINING_WALK_SUBTREES
117 #define LANG_HOOKS_TREE_INLINING_WALK_SUBTREES \
119 #undef LANG_HOOKS_TREE_INLINING_CANNOT_INLINE_TREE_FN
120 #define LANG_HOOKS_TREE_INLINING_CANNOT_INLINE_TREE_FN \
121 cp_cannot_inline_tree_fn
122 #undef LANG_HOOKS_TREE_INLINING_ADD_PENDING_FN_DECLS
123 #define LANG_HOOKS_TREE_INLINING_ADD_PENDING_FN_DECLS \
124 cp_add_pending_fn_decls
125 #undef LANG_HOOKS_TREE_INLINING_AUTO_VAR_IN_FN_P
126 #define LANG_HOOKS_TREE_INLINING_AUTO_VAR_IN_FN_P \
128 #undef LANG_HOOKS_TREE_INLINING_ANON_AGGR_TYPE_P
129 #define LANG_HOOKS_TREE_INLINING_ANON_AGGR_TYPE_P anon_aggr_type_p
130 #undef LANG_HOOKS_TREE_INLINING_VAR_MOD_TYPE_P
131 #define LANG_HOOKS_TREE_INLINING_VAR_MOD_TYPE_P cp_var_mod_type_p
132 #undef LANG_HOOKS_TREE_DUMP_DUMP_TREE_FN
133 #define LANG_HOOKS_TREE_DUMP_DUMP_TREE_FN cp_dump_tree
134 #undef LANG_HOOKS_TREE_DUMP_TYPE_QUALS_FN
135 #define LANG_HOOKS_TREE_DUMP_TYPE_QUALS_FN cp_type_quals
136 #undef LANG_HOOKS_EXPR_SIZE
137 #define LANG_HOOKS_EXPR_SIZE cp_expr_size
139 #undef LANG_HOOKS_CALLGRAPH_ANALYZE_EXPR
140 #define LANG_HOOKS_CALLGRAPH_ANALYZE_EXPR cxx_callgraph_analyze_expr
141 #undef LANG_HOOKS_CALLGRAPH_EXPAND_FUNCTION
142 #define LANG_HOOKS_CALLGRAPH_EXPAND_FUNCTION expand_body
144 #undef LANG_HOOKS_MAKE_TYPE
145 #define LANG_HOOKS_MAKE_TYPE cxx_make_type
146 #undef LANG_HOOKS_TYPE_FOR_MODE
147 #define LANG_HOOKS_TYPE_FOR_MODE c_common_type_for_mode
148 #undef LANG_HOOKS_TYPE_FOR_SIZE
149 #define LANG_HOOKS_TYPE_FOR_SIZE c_common_type_for_size
150 #undef LANG_HOOKS_SIGNED_TYPE
151 #define LANG_HOOKS_SIGNED_TYPE c_common_signed_type
152 #undef LANG_HOOKS_UNSIGNED_TYPE
153 #define LANG_HOOKS_UNSIGNED_TYPE c_common_unsigned_type
154 #undef LANG_HOOKS_SIGNED_OR_UNSIGNED_TYPE
155 #define LANG_HOOKS_SIGNED_OR_UNSIGNED_TYPE c_common_signed_or_unsigned_type
156 #undef LANG_HOOKS_INCOMPLETE_TYPE_ERROR
157 #define LANG_HOOKS_INCOMPLETE_TYPE_ERROR cxx_incomplete_type_error
158 #undef LANG_HOOKS_TYPE_PROMOTES_TO
159 #define LANG_HOOKS_TYPE_PROMOTES_TO cxx_type_promotes_to
160 #undef LANG_HOOKS_REGISTER_BUILTIN_TYPE
161 #define LANG_HOOKS_REGISTER_BUILTIN_TYPE c_register_builtin_type
162 #undef LANG_HOOKS_TO_TARGET_CHARSET
163 #define LANG_HOOKS_TO_TARGET_CHARSET c_common_to_target_charset
164 #undef LANG_HOOKS_GIMPLIFY_EXPR
165 #define LANG_HOOKS_GIMPLIFY_EXPR cp_gimplify_expr
167 #endif /* GCC_CP_OBJCP_COMMON */