GCC Middle and Back End API Reference
|
#include "hooks.h"
Go to the source code of this file.
#define LANG_HOOKS_APPEND_DATA lhd_append_data |
#define LANG_HOOKS_ATTRIBUTE_TABLE |
Attribute hooks.
#define LANG_HOOKS_BEGIN_SECTION lhd_begin_section |
#define LANG_HOOKS_BLOCK_MAY_FALLTHRU hook_bool_const_tree_true |
#define LANG_HOOKS_BUILTIN_FUNCTION lhd_builtin_function |
#define LANG_HOOKS_BUILTIN_FUNCTION_EXT_SCOPE LANG_HOOKS_BUILTIN_FUNCTION |
#define LANG_HOOKS_CLASSIFY_RECORD NULL |
#define LANG_HOOKS_CLASSTYPE_AS_BASE hook_tree_const_tree_null |
#define LANG_HOOKS_COMPLAIN_WRONG_LANG_P lhd_complain_wrong_lang_p |
#define LANG_HOOKS_COPY_LANG_QUALIFIERS NULL |
#define LANG_HOOKS_CUSTOM_FUNCTION_DESCRIPTORS false |
#define LANG_HOOKS_DECL_DWARF_ATTRIBUTE lhd_decl_dwarf_attribute |
#define LANG_HOOKS_DECL_OK_FOR_SIBCALL lhd_decl_ok_for_sibcall |
#define LANG_HOOKS_DECL_PRINTABLE_NAME lhd_decl_printable_name |
#define LANG_HOOKS_DECLS |
#define LANG_HOOKS_DEEP_UNSHARING false |
#define LANG_HOOKS_DESCRIPTIVE_TYPE NULL |
#define LANG_HOOKS_DUP_LANG_SPECIFIC_DECL lhd_do_nothing_t |
#define LANG_HOOKS_DWARF_NAME lhd_dwarf_name |
#define LANG_HOOKS_EH_PERSONALITY lhd_gcc_personality |
#define LANG_HOOKS_EH_PROTECT_CLEANUP_ACTIONS NULL |
#define LANG_HOOKS_EH_RUNTIME_TYPE lhd_pass_through_t |
#define LANG_HOOKS_EH_USE_CXA_END_CLEANUP false |
#define LANG_HOOKS_EMITS_BEGIN_STMT false |
#define LANG_HOOKS_END_SECTION lhd_end_section |
#define LANG_HOOKS_ENUM_UNDERLYING_BASE_TYPE lhd_enum_underlying_base_type |
#define LANG_HOOKS_EXPR_TO_DECL lhd_expr_to_decl |
#define LANG_HOOKS_FINALIZE_EARLY_DEBUG lhd_finalize_early_debug |
#define LANG_HOOKS_FINISH lhd_do_nothing |
#define LANG_HOOKS_FINISH_INCOMPLETE_DECL lhd_do_nothing_t |
#define LANG_HOOKS_FOR_TYPES_INITIALIZER |
#define LANG_HOOKS_FREE_LANG_DATA lhd_do_nothing_t |
#define LANG_HOOKS_FUNCTION_PARAMETER_PACK_P hook_bool_const_tree_false |
#define LANG_HOOKS_FUNCTION_PARM_EXPANDED_FROM_PACK_P hook_bool_tree_tree_false |
#define LANG_HOOKS_GENERIC_GENERIC_PARAMETER_DECL_P hook_bool_const_tree_false |
#define LANG_HOOKS_GENERIC_TYPE_P hook_bool_const_tree_false |
#define LANG_HOOKS_GET_ALIAS_SET lhd_get_alias_set |
#define LANG_HOOKS_GET_ARGUMENT_PACK_ELEMS hook_tree_const_tree_null |
#define LANG_HOOKS_GET_ARRAY_DESCR_INFO NULL |
#define LANG_HOOKS_GET_DEBUG_TYPE NULL |
#define LANG_HOOKS_GET_FIXED_POINT_TYPE_INFO NULL |
#define LANG_HOOKS_GET_GENERIC_FUNCTION_DECL hook_tree_const_tree_null |
#define LANG_HOOKS_GET_INNERMOST_GENERIC_ARGS hook_tree_const_tree_null |
#define LANG_HOOKS_GET_INNERMOST_GENERIC_PARMS hook_tree_const_tree_null |
#define LANG_HOOKS_GET_SARIF_SOURCE_LANGUAGE lhd_get_sarif_source_language |
#define LANG_HOOKS_GET_SUBRANGE_BOUNDS NULL |
#define LANG_HOOKS_GET_SUBSTRING_LOCATION lhd_get_substring_location |
#define LANG_HOOKS_GET_TYPE_BIAS NULL |
#define LANG_HOOKS_GETDECLS getdecls |
#define LANG_HOOKS_GIMPLIFY_EXPR lhd_gimplify_expr |
Hooks for tree gimplification.
#define LANG_HOOKS_GLOBAL_BINDINGS_P global_bindings_p |
Declaration hooks.
#define LANG_HOOKS_HANDLE_OPTION lhd_handle_option |
#define LANG_HOOKS_IDENTIFIER_SIZE sizeof (struct lang_identifier) |
#define LANG_HOOKS_INCOMPLETE_TYPE_ERROR lhd_incomplete_type_error |
#define LANG_HOOKS_INIT hook_bool_void_false |
#define LANG_HOOKS_INIT_OPTIONS lhd_init_options |
#define LANG_HOOKS_INIT_OPTIONS_STRUCT hook_void_gcc_optionsp |
#define LANG_HOOKS_INIT_TS lhd_do_nothing |
#define LANG_HOOKS_INITIALIZE_DIAGNOSTICS lhd_initialize_diagnostics |
#define LANG_HOOKS_INITIALIZER |
The whole thing. The structure is defined in langhooks.h.
#define LANG_HOOKS_LTO |
#define LANG_HOOKS_MAKE_TYPE lhd_make_node |
#define LANG_HOOKS_MISSING_NORETURN_OK_P hook_bool_tree_true |
#define LANG_HOOKS_NAME "GNU unknown" |
#define LANG_HOOKS_OMP_ALLOCATABLE_P hook_bool_tree_false |
#define LANG_HOOKS_OMP_ARRAY_DATA hook_tree_tree_bool_null |
#define LANG_HOOKS_OMP_ARRAY_SIZE lhd_omp_array_size |
#define LANG_HOOKS_OMP_CHECK_OPTIONAL_ARGUMENT hook_tree_tree_bool_null |
#define LANG_HOOKS_OMP_CLAUSE_ASSIGN_OP lhd_omp_assignment |
#define LANG_HOOKS_OMP_CLAUSE_COPY_CTOR lhd_omp_assignment |
#define LANG_HOOKS_OMP_CLAUSE_DEFAULT_CTOR hook_tree_tree_tree_tree_null |
#define LANG_HOOKS_OMP_CLAUSE_DTOR hook_tree_tree_tree_null |
#define LANG_HOOKS_OMP_CLAUSE_LINEAR_CTOR NULL |
#define LANG_HOOKS_OMP_DEEP_MAPPING lhd_omp_deep_mapping |
#define LANG_HOOKS_OMP_DEEP_MAPPING_CNT lhd_omp_deep_mapping_cnt |
#define LANG_HOOKS_OMP_DEEP_MAPPING_P lhd_omp_deep_mapping_p |
#define LANG_HOOKS_OMP_DISREGARD_VALUE_EXPR hook_bool_tree_bool_false |
#define LANG_HOOKS_OMP_FINISH_CLAUSE lhd_omp_finish_clause |
#define LANG_HOOKS_OMP_FINISH_DECL_INITS lhd_omp_finish_decl_inits |
#define LANG_HOOKS_OMP_FIRSTPRIVATIZE_TYPE_SIZES lhd_omp_firstprivatize_type_sizes |
#define LANG_HOOKS_OMP_GET_DECL_INIT lhd_omp_get_decl_init |
#define LANG_HOOKS_OMP_IS_ALLOCATABLE_OR_PTR hook_bool_const_tree_false |
#define LANG_HOOKS_OMP_PREDETERMINED_MAPPING lhd_omp_predetermined_mapping |
#define LANG_HOOKS_OMP_PREDETERMINED_SHARING lhd_omp_predetermined_sharing |
#define LANG_HOOKS_OMP_PRIVATE_DEBUG_CLAUSE hook_bool_tree_bool_false |
#define LANG_HOOKS_OMP_PRIVATE_OUTER_REF hook_bool_tree_false |
#define LANG_HOOKS_OMP_PRIVATIZE_BY_REFERENCE hook_bool_const_tree_false |
#define LANG_HOOKS_OMP_REPORT_DECL lhd_pass_through_t |
#define LANG_HOOKS_OMP_SCALAR_P lhd_omp_scalar_p |
#define LANG_HOOKS_OMP_SCALAR_TARGET_P hook_bool_tree_false |
#define LANG_HOOKS_OPTION_LANG_MASK hook_uint_void_0 |
#define LANG_HOOKS_OVERWRITE_DECL_ASSEMBLER_NAME lhd_overwrite_decl_assembler_name |
#define LANG_HOOKS_PARSE_FILE lhd_do_nothing |
#define LANG_HOOKS_POST_COMPILATION_PARSING_CLEANUPS NULL |
#define LANG_HOOKS_POST_OPTIONS lhd_post_options |
#define LANG_HOOKS_PREPROCESS_MAIN_FILE NULL |
#define LANG_HOOKS_PREPROCESS_OPTIONS NULL |
#define LANG_HOOKS_PREPROCESS_TOKEN NULL |
#define LANG_HOOKS_PREPROCESS_UNDEF NULL |
#define LANG_HOOKS_PRINT_DECL lhd_print_tree_nothing |
#define LANG_HOOKS_PRINT_ERROR_FUNCTION lhd_print_error_function |
#define LANG_HOOKS_PRINT_IDENTIFIER lhd_print_tree_nothing |
#define LANG_HOOKS_PRINT_STATISTICS lhd_do_nothing |
#define LANG_HOOKS_PRINT_TYPE lhd_print_tree_nothing |
#define LANG_HOOKS_PRINT_XNODE lhd_print_tree_nothing |
#define LANG_HOOKS_PUSHDECL pushdecl |
#define LANG_HOOKS_RECONSTRUCT_COMPLEX_TYPE reconstruct_complex_type |
#define LANG_HOOKS_REGISTER_BUILTIN_TYPE lhd_register_builtin_type |
#define LANG_HOOKS_REGISTER_DUMPS lhd_register_dumps |
#define LANG_HOOKS_RUN_LANG_SELFTESTS lhd_do_nothing |
#define LANG_HOOKS_SET_DECL_ASSEMBLER_NAME lhd_set_decl_assembler_name |
#define LANG_HOOKS_SIMULATE_BUILTIN_FUNCTION_DECL LANG_HOOKS_BUILTIN_FUNCTION |
#define LANG_HOOKS_SIMULATE_ENUM_DECL lhd_simulate_enum_decl |
#define LANG_HOOKS_SIMULATE_RECORD_DECL lhd_simulate_record_decl |
#define LANG_HOOKS_TO_TARGET_CHARSET lhd_to_target_charset |
#define LANG_HOOKS_TREE_DUMP_DUMP_TREE_FN lhd_tree_dump_dump_tree |
#define LANG_HOOKS_TREE_DUMP_INITIALIZER |
#define LANG_HOOKS_TREE_DUMP_TYPE_QUALS_FN lhd_tree_dump_type_quals |
#define LANG_HOOKS_TREE_INLINING_INITIALIZER |
#define LANG_HOOKS_TREE_INLINING_VAR_MOD_TYPE_P hook_bool_tree_tree_false |
Tree inlining hooks.
#define LANG_HOOKS_TREE_SIZE lhd_tree_size |
#define LANG_HOOKS_TYPE_DWARF_ATTRIBUTE lhd_type_dwarf_attribute |
#define LANG_HOOKS_TYPE_FOR_SIZE lhd_type_for_size |
#define LANG_HOOKS_TYPE_HASH_EQ NULL |
#define LANG_HOOKS_TYPE_MAX_SIZE lhd_return_null_const_tree |
#define LANG_HOOKS_TYPE_PROMOTES_TO lhd_type_promotes_to |
#define LANG_HOOKS_TYPES_COMPATIBLE_P lhd_types_compatible_p |
#define LANG_HOOKS_UNIT_SIZE_WITHOUT_REUSABLE_PADDING lhd_unit_size_without_reusable_padding |
#define LANG_HOOKS_WARN_UNUSED_GLOBAL_DECL lhd_warn_unused_global_decl |
|
extern |
Write DATA of length LEN to the current LTO output section. This default implementation just calls assemble_string.
References assemble_string(), timevar_pop(), and timevar_push().
|
extern |
LTO hooks.
Begin a new LTO output section named NAME. This default implementation saves the old section and emits assembly code to switch to the new section.
References gcc_assert, get_section(), in_section, NULL, saved_section, SECTION_DEBUG, SECTION_EXCLUDE, switch_to_section(), and text_section.
References lang_hooks::decls, and lang_hooks_for_decls::pushdecl.
By default, always complain about options for the wrong language.
|
extern |
Default implementation of LANG_HOOKS_DECL_DWARF_ATTRIBUTE. Don't add any attributes.
|
extern |
Return true if decl, which is a function decl, may be called by a sibcall.
|
extern |
|
extern |
Note to creators of new hooks: The macros in this file should NOT be surrounded by a #ifdef...#endif pair, since this file declares the defaults. Each front end overrides any hooks it wishes to, in the file containing its struct lang_hooks, AFTER including this file.
See langhooks.h for the definition and documentation of each hook.
Default language-specific hooks. Copyright (C) 2001-2024 Free Software Foundation, Inc. Contributed by Alexandre Oliva <aoliva@redhat.com> This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with GCC; see the file COPYING3. If not see <http://www.gnu.org/licenses/>.
Do nothing; in many cases the default hook.
|
extern |
|
extern |
|
extern |
|
extern |
This is the default dwarf_name function.
References DECL_P, lang_hooks::decl_printable_name, and gcc_assert.
|
extern |
Finish the current LTO output section. This default implementation emits assembly code to switch to any section previously saved by lhd_begin_section.
References NULL, saved_section, and switch_to_section().
|
extern |
Default implementation of enum_underlying_base_type using type_for_size.
References lang_hooks_for_types::type_for_size, TYPE_PRECISION, TYPE_UNSIGNED, and lang_hooks::types.
|
extern |
Default implementation for the finalize_early_debug hook.
References debug_hooks, symtab_node::decl, gcc_debug_hooks::early_global_decl, and FOR_EACH_FUNCTION_WITH_GIMPLE_BODY.
|
extern |
|
extern |
Default implementation of LANG_HOOKS_GET_SARIF_SOURCE_LANGUAGE.
References NULL.
|
extern |
Default implementation of LANG_HOOKS_GET_SUBSTRING_LOCATION.
|
extern |
Declarations for tree gimplification hooks.
lang_hooks.gimplify_expr re-writes *EXPR_P into GIMPLE form.
References GS_UNHANDLED.
|
extern |
By default, no language-specific options are valid.
|
extern |
|
extern |
Called to perform language-specific options initialization.
|
extern |
Declarations of default tree inlining hooks.
Called to perform language-specific initialization of CTX.
|
extern |
References make_node().
|
extern |
Return array size; cf. omp_array_data.
References NULL_TREE.
|
extern |
Do the additional mappings.
|
extern |
Returns number of additional mappings for a decl.
References NULL_TREE.
Returns true when additional mappings for a decl are needed.
|
extern |
Finalize clause C.
|
extern |
Free any extra memory used to hold initializer information for variable declarations.
|
extern |
Register language specific type size variables as potentially OpenMP firstprivate variables.
Return static initializer for DECL.
References DECL_INITIAL.
|
extern |
Return sharing kind if OpenMP mapping attribute of DECL is predetermined, OMP_CLAUSE_DEFAULTMAP_CATEGORY_UNSPECIFIED otherwise.
References DECL_ARTIFICIAL, OMP_CLAUSE_DEFAULTMAP_CATEGORY_UNSPECIFIED, and OMP_CLAUSE_DEFAULTMAP_TO.
|
extern |
Return sharing kind if OpenMP sharing attribute of DECL is predetermined, OMP_CLAUSE_DEFAULT_UNSPECIFIED otherwise.
References DECL_ARTIFICIAL, OMP_CLAUSE_DEFAULT_SHARED, and OMP_CLAUSE_DEFAULT_UNSPECIFIED.
Return true if DECL is a scalar variable (for the purpose of implicit firstprivatization & mapping). Only if alloc_ptr_ok are allocatables and pointers accepted.
References INTEGRAL_TYPE_P, SCALAR_FLOAT_TYPE_P, TREE_CODE, and TREE_TYPE.
Forcibly overwrite the DECL_ASSEMBLER_NAME for DECL to NAME.
References DECL_ASSEMBLER_NAME_RAW.
|
extern |
|
extern |
|
extern |
|
extern |
|
extern |
Called to register dumps.
|
extern |
|
extern |
Set the DECL_ASSEMBLER_NAME for DECL.
References ASM_FORMAT_PRIVATE_NAME, DECL_EXTERNAL, DECL_FILE_SCOPE_P, DECL_NAME, gcc_assert, get_identifier(), IDENTIFIER_POINTER, SET_DECL_ASSEMBLER_NAME, targetm, TREE_CODE, TREE_PUBLIC, TREE_STATIC, and VAR_P.
Referenced by gimplify_init_constructor().
|
extern |
Default implementation of LANG_HOOKS_SIMULATE_ENUM_DECL. Assume a simple int-based enumerator (which is all the hook can be used for at present) and push each decl individually without any decoration. This definition is suitable for LTO and is generic enough that it might be reusable elsewhere.
References build_decl(), build_int_cst(), DECL_INITIAL, lang_hooks::decls, FOR_EACH_VEC_ELT, get_identifier(), i, integer_type_node, layout_type(), lang_hooks_for_types::make_type, NULL_TREE, lang_hooks_for_decls::pushdecl, SET_TYPE_ALIGN, tree_cons(), TYPE_ALIGN, TYPE_MAX_VALUE, TYPE_MIN_VALUE, TYPE_PRECISION, TYPE_STUB_DECL, and lang_hooks::types.
|
extern |
Default implementation of LANG_HOOKS_SIMULATE_RECORD_DECL. Just create a normal RECORD_TYPE and a TYPE_DECL for it.
References build_decl(), DECL_CHAIN, lang_hooks::decls, fields, finish_builtin_struct(), get_identifier(), i, lang_hooks_for_types::make_type, NULL_TREE, lang_hooks_for_decls::pushdecl, type(), and lang_hooks::types.
|
extern |
Tree dump hooks.
lang_hooks.tree_dump.dump_tree: Dump language-specific parts of tree nodes. Returns nonzero if it does not want the usual dumping of the second argument.
|
extern |
lang_hooks.tree_dump.type_qual: Determine type qualifiers in a language-specific way.
References TYPE_QUALS.
|
extern |
lang_hooks.tree_size: Determine the size of a tree with code C, which is a language-specific tree code in category tcc_constant, tcc_exceptional or tcc_type. The default expects never to be called.
References gcc_unreachable.
|
extern |
Default implementation of LANG_HOOKS_TYPE_DWARF_ATTRIBUTE. Don't add any attributes.
|
extern |
Default implementation of LANG_HOOKS_TYPE_FOR_SIZE. Return an integer type with PRECISION bits of precision, that is unsigned if UNSIGNEDP is nonzero, otherwise signed.
References i, int_n_data, int_n_enabled_p, int_n_trees, intDI_type_node, integer_type_node, intHI_type_node, intQI_type_node, intSI_type_node, intTI_type_node, long_integer_type_node, long_long_integer_type_node, long_long_unsigned_type_node, long_unsigned_type_node, NULL_TREE, short_integer_type_node, short_unsigned_type_node, signed_char_type_node, TYPE_PRECISION, unsigned_char_type_node, unsigned_intDI_type_node, unsigned_intHI_type_node, unsigned_intQI_type_node, unsigned_intSI_type_node, unsigned_intTI_type_node, and unsigned_type_node.
This compares two types for equivalence ("compatible" in C-based languages). This routine should only return 1 if it is sure. It should not be used in contexts where erroneously returning 0 causes problems.
References TYPE_MAIN_VARIANT, and y.
Types hooks. There are no reasonable defaults for most of them, so we create a compile-time error instead.
Default implementation of LANG_HOOKS_UNIT_SIZE_WITHOUT_REUSABLE_PADDING. Just return TYPE_SIZE_UNIT unadjusted.
References TYPE_SIZE_UNIT.
|
extern |
Called from check_global_declaration.
References DECL_DECLARED_INLINE_P, DECL_IN_SYSTEM_HEADER, TREE_CODE, TREE_READONLY, and VAR_P.