| 1 |
/* Language hooks common to C and ObjC front ends. |
| 2 |
Copyright (C) 2004-2025 Free Software Foundation, Inc. |
| 3 |
Contributed by Ziemowit Laski <[email protected]> |
| 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_C_OBJC_COMMON |
| 22 |
#define GCC_C_OBJC_COMMON |
| 23 |
|
| 24 |
/* Implemented in c-objc-common.cc. */ |
| 25 |
extern void c_register_features (); |
| 26 |
|
| 27 |
/* Lang hooks that are shared between C and ObjC are defined here. Hooks |
| 28 |
specific to C or ObjC go in c-lang.cc and objc/objc-lang.cc, respectively. */ |
| 29 |
|
| 30 |
#undef LANG_HOOKS_IDENTIFIER_SIZE |
| 31 |
#define LANG_HOOKS_IDENTIFIER_SIZE C_SIZEOF_STRUCT_LANG_IDENTIFIER |
| 32 |
#undef LANG_HOOKS_TREE_SIZE |
| 33 |
#define LANG_HOOKS_TREE_SIZE c_tree_size |
| 34 |
#undef LANG_HOOKS_FINISH |
| 35 |
#define LANG_HOOKS_FINISH c_common_finish |
| 36 |
#undef LANG_HOOKS_OPTION_LANG_MASK |
| 37 |
#define LANG_HOOKS_OPTION_LANG_MASK c_common_option_lang_mask |
| 38 |
#undef LANG_HOOKS_COMPLAIN_WRONG_LANG_P |
| 39 |
#define LANG_HOOKS_COMPLAIN_WRONG_LANG_P c_common_complain_wrong_lang_p |
| 40 |
#undef LANG_HOOKS_INIT_OPTIONS_STRUCT |
| 41 |
#define LANG_HOOKS_INIT_OPTIONS_STRUCT c_common_init_options_struct |
| 42 |
#undef LANG_HOOKS_INIT_OPTIONS |
| 43 |
#define LANG_HOOKS_INIT_OPTIONS c_common_init_options |
| 44 |
#undef LANG_HOOKS_INITIALIZE_DIAGNOSTICS |
| 45 |
#define LANG_HOOKS_INITIALIZE_DIAGNOSTICS c_initialize_diagnostics |
| 46 |
#undef LANG_HOOKS_HANDLE_OPTION |
| 47 |
#define LANG_HOOKS_HANDLE_OPTION c_common_handle_option |
| 48 |
#undef LANG_HOOKS_POST_OPTIONS |
| 49 |
#define LANG_HOOKS_POST_OPTIONS c_common_post_options |
| 50 |
#undef LANG_HOOKS_GET_ALIAS_SET |
| 51 |
#define LANG_HOOKS_GET_ALIAS_SET c_get_alias_set |
| 52 |
#undef LANG_HOOKS_PARSE_FILE |
| 53 |
#define LANG_HOOKS_PARSE_FILE c_common_parse_file |
| 54 |
#undef LANG_HOOKS_FINISH_INCOMPLETE_DECL |
| 55 |
#define LANG_HOOKS_FINISH_INCOMPLETE_DECL c_finish_incomplete_decl |
| 56 |
#undef LANG_HOOKS_WARN_UNUSED_GLOBAL_DECL |
| 57 |
#define LANG_HOOKS_WARN_UNUSED_GLOBAL_DECL c_warn_unused_global_decl |
| 58 |
#undef LANG_HOOKS_PRINT_IDENTIFIER |
| 59 |
#define LANG_HOOKS_PRINT_IDENTIFIER c_print_identifier |
| 60 |
#undef LANG_HOOKS_TYPES_COMPATIBLE_P |
| 61 |
#define LANG_HOOKS_TYPES_COMPATIBLE_P c_types_compatible_p |
| 62 |
#undef LANG_HOOKS_MISSING_NORETURN_OK_P |
| 63 |
#define LANG_HOOKS_MISSING_NORETURN_OK_P c_missing_noreturn_ok_p |
| 64 |
#undef LANG_HOOKS_BLOCK_MAY_FALLTHRU |
| 65 |
#define LANG_HOOKS_BLOCK_MAY_FALLTHRU c_block_may_fallthru |
| 66 |
#undef LANG_HOOKS_BUILTIN_FUNCTION |
| 67 |
#define LANG_HOOKS_BUILTIN_FUNCTION c_builtin_function |
| 68 |
#undef LANG_HOOKS_BUILTIN_FUNCTION_EXT_SCOPE |
| 69 |
#define LANG_HOOKS_BUILTIN_FUNCTION_EXT_SCOPE c_builtin_function_ext_scope |
| 70 |
#undef LANG_HOOKS_SIMULATE_BUILTIN_FUNCTION_DECL |
| 71 |
#define LANG_HOOKS_SIMULATE_BUILTIN_FUNCTION_DECL \ |
| 72 |
c_simulate_builtin_function_decl |
| 73 |
#undef LANG_HOOKS_EMITS_BEGIN_STMT |
| 74 |
#define LANG_HOOKS_EMITS_BEGIN_STMT true |
| 75 |
#undef LANG_HOOKS_FINALIZE_EARLY_DEBUG |
| 76 |
#define LANG_HOOKS_FINALIZE_EARLY_DEBUG c_common_finalize_early_debug |
| 77 |
#undef LANG_HOOKS_RECONSTRUCT_COMPLEX_TYPE |
| 78 |
#define LANG_HOOKS_RECONSTRUCT_COMPLEX_TYPE c_reconstruct_complex_type |
| 79 |
|
| 80 |
static const scoped_attribute_specs *const c_objc_attribute_table[] = |
| 81 |
{ |
| 82 |
&std_attribute_table, |
| 83 |
&c_common_gnu_attribute_table, |
| 84 |
&c_common_clang_attribute_table, |
| 85 |
&c_common_format_attribute_table |
| 86 |
}; |
| 87 |
|
| 88 |
#undef LANG_HOOKS_ATTRIBUTE_TABLE |
| 89 |
#define LANG_HOOKS_ATTRIBUTE_TABLE c_objc_attribute_table |
| 90 |
|
| 91 |
#undef LANG_HOOKS_TREE_DUMP_DUMP_TREE_FN |
| 92 |
#define LANG_HOOKS_TREE_DUMP_DUMP_TREE_FN c_dump_tree |
| 93 |
|
| 94 |
#undef LANG_HOOKS_SIMULATE_ENUM_DECL |
| 95 |
#define LANG_HOOKS_SIMULATE_ENUM_DECL c_simulate_enum_decl |
| 96 |
#undef LANG_HOOKS_SIMULATE_RECORD_DECL |
| 97 |
#define LANG_HOOKS_SIMULATE_RECORD_DECL c_simulate_record_decl |
| 98 |
#undef LANG_HOOKS_TYPE_FOR_MODE |
| 99 |
#define LANG_HOOKS_TYPE_FOR_MODE c_common_type_for_mode |
| 100 |
#undef LANG_HOOKS_TYPE_FOR_SIZE |
| 101 |
#define LANG_HOOKS_TYPE_FOR_SIZE c_common_type_for_size |
| 102 |
#undef LANG_HOOKS_INCOMPLETE_TYPE_ERROR |
| 103 |
#define LANG_HOOKS_INCOMPLETE_TYPE_ERROR c_incomplete_type_error |
| 104 |
#undef LANG_HOOKS_TYPE_PROMOTES_TO |
| 105 |
#define LANG_HOOKS_TYPE_PROMOTES_TO c_type_promotes_to |
| 106 |
#undef LANG_HOOKS_REGISTER_BUILTIN_TYPE |
| 107 |
#define LANG_HOOKS_REGISTER_BUILTIN_TYPE c_register_builtin_type |
| 108 |
#undef LANG_HOOKS_TO_TARGET_CHARSET |
| 109 |
#define LANG_HOOKS_TO_TARGET_CHARSET c_common_to_target_charset |
| 110 |
#undef LANG_HOOKS_EXPR_TO_DECL |
| 111 |
#define LANG_HOOKS_EXPR_TO_DECL c_expr_to_decl |
| 112 |
|
| 113 |
/* The C front end's scoping structure is very different from |
| 114 |
that expected by the language-independent code; it is best |
| 115 |
to disable getdecls. |
| 116 |
This means it must also provide its own write_globals. */ |
| 117 |
|
| 118 |
#undef LANG_HOOKS_GETDECLS |
| 119 |
#define LANG_HOOKS_GETDECLS hook_tree_void_null |
| 120 |
|
| 121 |
/* Hooks for tree gimplification. */ |
| 122 |
#undef LANG_HOOKS_GIMPLIFY_EXPR |
| 123 |
#define LANG_HOOKS_GIMPLIFY_EXPR c_gimplify_expr |
| 124 |
|
| 125 |
#undef LANG_HOOKS_TYPE_DWARF_ATTRIBUTE |
| 126 |
#define LANG_HOOKS_TYPE_DWARF_ATTRIBUTE c_type_dwarf_attribute |
| 127 |
|
| 128 |
#undef LANG_HOOKS_OMP_PREDETERMINED_SHARING |
| 129 |
#define LANG_HOOKS_OMP_PREDETERMINED_SHARING c_omp_predetermined_sharing |
| 130 |
|
| 131 |
#undef LANG_HOOKS_OMP_PREDETERMINED_MAPPING |
| 132 |
#define LANG_HOOKS_OMP_PREDETERMINED_MAPPING c_omp_predetermined_mapping |
| 133 |
|
| 134 |
#undef LANG_HOOKS_OMP_CLAUSE_COPY_CTOR |
| 135 |
#define LANG_HOOKS_OMP_CLAUSE_COPY_CTOR c_omp_clause_copy_ctor |
| 136 |
|
| 137 |
#undef LANG_HOOKS_OMP_CLAUSE_ASSIGN_OP |
| 138 |
#define LANG_HOOKS_OMP_CLAUSE_ASSIGN_OP c_omp_clause_copy_ctor |
| 139 |
|
| 140 |
#undef LANG_HOOKS_TREE_INLINING_VAR_MOD_TYPE_P |
| 141 |
#define LANG_HOOKS_TREE_INLINING_VAR_MOD_TYPE_P c_var_mod_p |
| 142 |
#endif /* GCC_C_OBJC_COMMON */ |