]> git.ipfire.org Git - thirdparty/gcc.git/blob - gcc/cp/cp-objcp-common.h
Update copyright years.
[thirdparty/gcc.git] / gcc / cp / cp-objcp-common.h
1 /* Language hooks common to C++ and ObjC++ front ends.
2 Copyright (C) 2004-2024 Free Software Foundation, Inc.
3 Contributed by Ziemowit Laski <zlaski@apple.com>
4
5 This file is part of GCC.
6
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 3, or (at your option) any later
10 version.
11
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
15 for more details.
16
17 You should have received a copy of the GNU General Public License
18 along with GCC; see the file COPYING3. If not see
19 <http://www.gnu.org/licenses/>. */
20
21 #ifndef GCC_CP_OBJCP_COMMON
22 #define GCC_CP_OBJCP_COMMON
23
24 /* In cp/objcp-common.c, cp/cp-lang.cc and objcp/objcp-lang.cc. */
25
26 extern tree cp_get_debug_type (const_tree);
27 extern tree objcp_tsubst_expr (tree, tree, tsubst_flags_t, tree);
28
29 extern int cp_decl_dwarf_attribute (const_tree, int);
30 extern int cp_type_dwarf_attribute (const_tree, int);
31 extern void cp_common_init_ts (void);
32 extern tree cp_unit_size_without_reusable_padding (tree);
33 extern tree cp_classtype_as_base (const_tree);
34 extern tree cp_get_global_decls ();
35 extern tree cp_pushdecl (tree);
36 extern void cp_register_dumps (gcc::dump_manager *);
37 extern void cp_register_features ();
38 extern bool cp_handle_option (size_t, const char *, HOST_WIDE_INT, int,
39 location_t, const struct cl_option_handlers *);
40 extern tree cxx_make_type_hook (tree_code);
41 extern tree cxx_simulate_enum_decl (location_t, const char *,
42 vec<string_int_pair> *);
43 extern tree cxx_simulate_record_decl (location_t, const char *,
44 array_slice<const tree>);
45
46 /* Lang hooks that are shared between C++ and ObjC++ are defined here. Hooks
47 specific to C++ or ObjC++ go in cp/cp-lang.cc and objcp/objcp-lang.cc,
48 respectively. */
49
50 #undef LANG_HOOKS_FREE_LANG_DATA
51 #define LANG_HOOKS_FREE_LANG_DATA cp_free_lang_data
52 #undef LANG_HOOKS_TREE_SIZE
53 #define LANG_HOOKS_TREE_SIZE cp_tree_size
54 #undef LANG_HOOKS_FINISH
55 #define LANG_HOOKS_FINISH cxx_finish
56 #undef LANG_HOOKS_CLEAR_BINDING_STACK
57 #define LANG_HOOKS_CLEAR_BINDING_STACK pop_everything
58 #undef LANG_HOOKS_OPTION_LANG_MASK
59 #define LANG_HOOKS_OPTION_LANG_MASK c_common_option_lang_mask
60 #undef LANG_HOOKS_COMPLAIN_WRONG_LANG_P
61 #define LANG_HOOKS_COMPLAIN_WRONG_LANG_P c_common_complain_wrong_lang_p
62 #undef LANG_HOOKS_INIT_OPTIONS_STRUCT
63 #define LANG_HOOKS_INIT_OPTIONS_STRUCT c_common_init_options_struct
64 #undef LANG_HOOKS_INIT_OPTIONS
65 #define LANG_HOOKS_INIT_OPTIONS c_common_init_options
66 #undef LANG_HOOKS_INITIALIZE_DIAGNOSTICS
67 #define LANG_HOOKS_INITIALIZE_DIAGNOSTICS cxx_initialize_diagnostics
68 #undef LANG_HOOKS_REGISTER_DUMPS
69 #define LANG_HOOKS_REGISTER_DUMPS cp_register_dumps
70 #undef LANG_HOOKS_HANDLE_OPTION
71 #define LANG_HOOKS_HANDLE_OPTION cp_handle_option
72 #undef LANG_HOOKS_HANDLE_FILENAME
73 #define LANG_HOOKS_HANDLE_FILENAME c_common_handle_filename
74 #undef LANG_HOOKS_POST_OPTIONS
75 #define LANG_HOOKS_POST_OPTIONS c_common_post_options
76 #undef LANG_HOOKS_GET_ALIAS_SET
77 #define LANG_HOOKS_GET_ALIAS_SET cxx_get_alias_set
78 #undef LANG_HOOKS_PARSE_FILE
79 #define LANG_HOOKS_PARSE_FILE c_common_parse_file
80 #undef LANG_HOOKS_DUP_LANG_SPECIFIC_DECL
81 #define LANG_HOOKS_DUP_LANG_SPECIFIC_DECL cxx_dup_lang_specific_decl
82 #undef LANG_HOOKS_SET_DECL_ASSEMBLER_NAME
83 #define LANG_HOOKS_SET_DECL_ASSEMBLER_NAME mangle_decl
84 #undef LANG_HOOKS_OVERWRITE_DECL_ASSEMBLER_NAME
85 #define LANG_HOOKS_OVERWRITE_DECL_ASSEMBLER_NAME overwrite_mangling
86 #undef LANG_HOOKS_PRINT_STATISTICS
87 #define LANG_HOOKS_PRINT_STATISTICS cxx_print_statistics
88 #undef LANG_HOOKS_PRINT_XNODE
89 #define LANG_HOOKS_PRINT_XNODE cxx_print_xnode
90 #undef LANG_HOOKS_DECL_PRINTABLE_NAME
91 #define LANG_HOOKS_DECL_PRINTABLE_NAME cxx_printable_name
92 #undef LANG_HOOKS_PRINT_DECL
93 #define LANG_HOOKS_PRINT_DECL cxx_print_decl
94 #undef LANG_HOOKS_PRINT_TYPE
95 #define LANG_HOOKS_PRINT_TYPE cxx_print_type
96 #undef LANG_HOOKS_PRINT_IDENTIFIER
97 #define LANG_HOOKS_PRINT_IDENTIFIER cxx_print_identifier
98 #undef LANG_HOOKS_TYPES_COMPATIBLE_P
99 #define LANG_HOOKS_TYPES_COMPATIBLE_P cxx_types_compatible_p
100 #undef LANG_HOOKS_PRINT_ERROR_FUNCTION
101 #define LANG_HOOKS_PRINT_ERROR_FUNCTION cxx_print_error_function
102 #undef LANG_HOOKS_WARN_UNUSED_GLOBAL_DECL
103 #define LANG_HOOKS_WARN_UNUSED_GLOBAL_DECL cxx_warn_unused_global_decl
104 #undef LANG_HOOKS_POST_COMPILATION_PARSING_CLEANUPS
105 #define LANG_HOOKS_POST_COMPILATION_PARSING_CLEANUPS cxx_post_compilation_parsing_cleanups
106 #undef LANG_HOOKS_BUILTIN_FUNCTION
107 #define LANG_HOOKS_BUILTIN_FUNCTION cxx_builtin_function
108 #undef LANG_HOOKS_BUILTIN_FUNCTION_EXT_SCOPE
109 #define LANG_HOOKS_BUILTIN_FUNCTION_EXT_SCOPE cxx_builtin_function_ext_scope
110 #undef LANG_HOOKS_SIMULATE_BUILTIN_FUNCTION_DECL
111 #define LANG_HOOKS_SIMULATE_BUILTIN_FUNCTION_DECL \
112 cxx_simulate_builtin_function_decl
113 #undef LANG_HOOKS_TYPE_HASH_EQ
114 #define LANG_HOOKS_TYPE_HASH_EQ cxx_type_hash_eq
115 #undef LANG_HOOKS_COPY_LANG_QUALIFIERS
116 #define LANG_HOOKS_COPY_LANG_QUALIFIERS cxx_copy_lang_qualifiers
117 #undef LANG_HOOKS_MISSING_NORETURN_OK_P
118 #define LANG_HOOKS_MISSING_NORETURN_OK_P cp_missing_noreturn_ok_p
119 #undef LANG_HOOKS_BLOCK_MAY_FALLTHRU
120 #define LANG_HOOKS_BLOCK_MAY_FALLTHRU cxx_block_may_fallthru
121 #undef LANG_HOOKS_EMITS_BEGIN_STMT
122 #define LANG_HOOKS_EMITS_BEGIN_STMT true
123 #undef LANG_HOOKS_FINALIZE_EARLY_DEBUG
124 #define LANG_HOOKS_FINALIZE_EARLY_DEBUG c_common_finalize_early_debug
125
126 static const scoped_attribute_specs *const cp_objcp_attribute_table[] =
127 {
128 &std_attribute_table,
129 &cxx_gnu_attribute_table,
130 &c_common_gnu_attribute_table,
131 &c_common_format_attribute_table
132 };
133
134 #undef LANG_HOOKS_ATTRIBUTE_TABLE
135 #define LANG_HOOKS_ATTRIBUTE_TABLE cp_objcp_attribute_table
136
137 #undef LANG_HOOKS_TREE_INLINING_VAR_MOD_TYPE_P
138 #define LANG_HOOKS_TREE_INLINING_VAR_MOD_TYPE_P cp_var_mod_type_p
139 #undef LANG_HOOKS_TREE_DUMP_DUMP_TREE_FN
140 #define LANG_HOOKS_TREE_DUMP_DUMP_TREE_FN cp_dump_tree
141 #undef LANG_HOOKS_TREE_DUMP_TYPE_QUALS_FN
142 #define LANG_HOOKS_TREE_DUMP_TYPE_QUALS_FN cp_type_quals
143
144 #undef LANG_HOOKS_MAKE_TYPE
145 #define LANG_HOOKS_MAKE_TYPE cxx_make_type_hook
146 #undef LANG_HOOKS_SIMULATE_ENUM_DECL
147 #define LANG_HOOKS_SIMULATE_ENUM_DECL cxx_simulate_enum_decl
148 #undef LANG_HOOKS_SIMULATE_RECORD_DECL
149 #define LANG_HOOKS_SIMULATE_RECORD_DECL cxx_simulate_record_decl
150 #undef LANG_HOOKS_TYPE_FOR_MODE
151 #define LANG_HOOKS_TYPE_FOR_MODE c_common_type_for_mode
152 #undef LANG_HOOKS_TYPE_FOR_SIZE
153 #define LANG_HOOKS_TYPE_FOR_SIZE c_common_type_for_size
154 #undef LANG_HOOKS_INCOMPLETE_TYPE_ERROR
155 #define LANG_HOOKS_INCOMPLETE_TYPE_ERROR cxx_incomplete_type_error
156 #undef LANG_HOOKS_TYPE_PROMOTES_TO
157 #define LANG_HOOKS_TYPE_PROMOTES_TO cxx_type_promotes_to
158 #undef LANG_HOOKS_REGISTER_BUILTIN_TYPE
159 #define LANG_HOOKS_REGISTER_BUILTIN_TYPE c_register_builtin_type
160 #undef LANG_HOOKS_RECONSTRUCT_COMPLEX_TYPE
161 #define LANG_HOOKS_RECONSTRUCT_COMPLEX_TYPE cp_reconstruct_complex_type
162 #undef LANG_HOOKS_GET_DEBUG_TYPE
163 #define LANG_HOOKS_GET_DEBUG_TYPE cp_get_debug_type
164 #undef LANG_HOOKS_TO_TARGET_CHARSET
165 #define LANG_HOOKS_TO_TARGET_CHARSET c_common_to_target_charset
166 #undef LANG_HOOKS_GIMPLIFY_EXPR
167 #define LANG_HOOKS_GIMPLIFY_EXPR cp_gimplify_expr
168 #undef LANG_HOOKS_DECL_DWARF_ATTRIBUTE
169 #define LANG_HOOKS_DECL_DWARF_ATTRIBUTE cp_decl_dwarf_attribute
170 #undef LANG_HOOKS_TYPE_DWARF_ATTRIBUTE
171 #define LANG_HOOKS_TYPE_DWARF_ATTRIBUTE cp_type_dwarf_attribute
172 #undef LANG_HOOKS_UNIT_SIZE_WITHOUT_REUSABLE_PADDING
173 #define LANG_HOOKS_UNIT_SIZE_WITHOUT_REUSABLE_PADDING cp_unit_size_without_reusable_padding
174 #undef LANG_HOOKS_CLASSTYPE_AS_BASE
175 #define LANG_HOOKS_CLASSTYPE_AS_BASE cp_classtype_as_base
176
177 #undef LANG_HOOKS_OMP_PREDETERMINED_SHARING
178 #define LANG_HOOKS_OMP_PREDETERMINED_SHARING cxx_omp_predetermined_sharing
179 #undef LANG_HOOKS_OMP_PREDETERMINED_MAPPING
180 #define LANG_HOOKS_OMP_PREDETERMINED_MAPPING cxx_omp_predetermined_mapping
181 #undef LANG_HOOKS_OMP_CLAUSE_DEFAULT_CTOR
182 #define LANG_HOOKS_OMP_CLAUSE_DEFAULT_CTOR cxx_omp_clause_default_ctor
183 #undef LANG_HOOKS_OMP_CLAUSE_COPY_CTOR
184 #define LANG_HOOKS_OMP_CLAUSE_COPY_CTOR cxx_omp_clause_copy_ctor
185 #undef LANG_HOOKS_OMP_CLAUSE_ASSIGN_OP
186 #define LANG_HOOKS_OMP_CLAUSE_ASSIGN_OP cxx_omp_clause_assign_op
187 #undef LANG_HOOKS_OMP_CLAUSE_DTOR
188 #define LANG_HOOKS_OMP_CLAUSE_DTOR cxx_omp_clause_dtor
189 #undef LANG_HOOKS_OMP_FINISH_CLAUSE
190 #define LANG_HOOKS_OMP_FINISH_CLAUSE cxx_omp_finish_clause
191 #undef LANG_HOOKS_OMP_PRIVATIZE_BY_REFERENCE
192 #define LANG_HOOKS_OMP_PRIVATIZE_BY_REFERENCE cxx_omp_privatize_by_reference
193 #undef LANG_HOOKS_OMP_DISREGARD_VALUE_EXPR
194 #define LANG_HOOKS_OMP_DISREGARD_VALUE_EXPR cxx_omp_disregard_value_expr
195
196 #undef LANG_HOOKS_EH_USE_CXA_END_CLEANUP
197 #define LANG_HOOKS_EH_USE_CXA_END_CLEANUP true
198
199 #undef LANG_HOOKS_EH_PROTECT_CLEANUP_ACTIONS
200 #define LANG_HOOKS_EH_PROTECT_CLEANUP_ACTIONS cp_protect_cleanup_actions
201
202 #undef LANG_HOOKS_GETDECLS
203 #define LANG_HOOKS_GETDECLS cp_get_global_decls
204 #undef LANG_HOOKS_PUSHDECL
205 #define LANG_HOOKS_PUSHDECL cp_pushdecl
206 #endif /* GCC_CP_OBJCP_COMMON */