GCC Middle and Back End API Reference
|
#include "config.h"
#include "system.h"
#include "coretypes.h"
#include "backend.h"
#include "target.h"
#include "rtl.h"
#include "tree.h"
#include "gimple.h"
#include "memmodel.h"
#include "tm_p.h"
#include "stringpool.h"
#include "cgraph.h"
#include "fold-const.h"
#include "stor-layout.h"
#include "dumpfile.h"
#include "tree-inline.h"
#include "gimplify.h"
#include "gimple-iterator.h"
#include "gimple-walk.h"
#include "tree-cfg.h"
#include "explow.h"
#include "langhooks.h"
#include "gimple-low.h"
#include "gomp-constants.h"
#include "diagnostic.h"
#include "alloc-pool.h"
#include "tree-nested.h"
#include "symbol-summary.h"
#include "symtab-thunks.h"
#include "attribs.h"
#include "gt-tree-nested.h"
Data Structures | |
struct | nesting_info |
struct | nesting_copy_body_data |
Macros | |
#define | FOR_EACH_NEST_INFO(I, ROOT) |
#define | create_tmp_var cant_use_create_tmp_var_here_dummy |
#define | COPY_DLF(n) |
Variables | |
static function_summary< nested_function_info * > * | nested_function_sum = NULL |
static struct bitmap_obstack | nesting_info_bitmap_obstack |
static tree | trampoline_type |
static tree | descriptor_type |
#define COPY_DLF | ( | n | ) |
Referenced by get_debug_decl().
#define create_tmp_var cant_use_create_tmp_var_here_dummy |
We're working in so many different function contexts simultaneously, that create_tmp_var is dangerous. Prevent mishap.
Referenced by add_taskreg_looptemp_clauses(), asan_expand_poison_ifn(), asan_maybe_insert_dynamic_shadow_at_function_entry(), build_instrumentation_call(), build_stack_save_restore(), clear_padding_type(), ipa_param_body_adjustments::common_initialization(), create_access_replacement(), create_call_for_reduction_1(), create_one_component_var(), create_tmp_from_val(), create_tmp_reg(), create_vector_array(), declare_return_variable(), detach_value(), expand_assign_tm(), expand_oacc_collapse_init(), expand_oacc_for(), expand_omp_atomic_pipeline(), expand_omp_for_generic(), expand_omp_for_init_vars(), expand_omp_for_static_chunk(), expand_omp_for_static_nochunk(), expand_omp_ordered_sink(), expand_omp_ordered_source_sink(), expand_omp_sections(), expand_omp_simd(), expand_omp_target(), expand_parallel_call(), fold_builtin_alloca_with_align(), gen_conditions_for_pow_int_base(), gen_emutls_addr(), gen_one_condition(), get_target_arguments(), gimple_fold_builtin_clear_padding(), gimple_fold_call(), gimple_lower_bitint(), gimple_push_cleanup(), gimplify_bind_expr(), gimplify_call_expr(), gimplify_cond_expr(), gimplify_expr(), gimplify_function_tree(), gimplify_init_constructor(), gimplify_init_ctor_eval_range(), gimplify_modify_expr_to_memcpy(), gimplify_modify_expr_to_memset(), gimplify_omp_depend(), gimplify_omp_dispatch(), gimplify_omp_for(), gimplify_omp_taskloop_expr(), gimplify_parameters(), gimplify_vla_decl(), handle_abnormal_edges(), instrument_builtin_call(), ipa_tm_insert_gettmclone_call(), lower_assumption(), lower_builtin_posix_memalign(), lower_depend_clauses(), lower_eh_constructs_2(), lower_eh_dispatch(), lower_emutls_1(), lower_lastprivate_clauses(), lower_oacc_head_tail(), lower_oacc_reductions(), lower_omp_1(), lower_omp_for(), lower_omp_for_scan(), lower_omp_ordered(), lower_omp_scan(), lower_omp_scope(), lower_omp_sections(), lower_omp_single_copy(), lower_omp_single_simple(), lower_omp_target(), lower_omp_task_reductions(), lower_omp_taskreg(), lower_omp_teams(), lower_private_allocate(), lower_rec_input_clauses(), lower_rec_simd_input_clauses(), lower_reduction_clauses(), lower_resx(), lower_transaction(), lower_try_finally_switch(), make_blocks_1(), maybe_add_implicit_barrier_cancel(), oacc_dim_call(), omp_extract_for_data(), remap_type_1(), rt_bb_visited::rt_bb_visited(), scan_omp_parallel(), separate_decls_in_region(), separate_decls_in_region_name(), simd_clone_adjust(), task_copyfn_copy_decl(), task_reduction_read(), ubsan_encode_value(), update_alias_info_with_stack_vars(), vect_build_loop_niters(), vect_gen_prolog_loop_niters(), vect_gen_vector_loop_niters(), vect_gen_vector_loop_niters_mult_vf(), vect_get_mask_load_else(), vect_get_vec_defs_for_operand(), vect_update_ivs_after_vectorizer(), vector_element(), vectorizable_simd_clone_call(), rt_bb_visited::vindex(), voidify_wrapper_expr(), rt_bb_visited::vset(), worker_single_copy(), and worker_single_simple().
#define FOR_EACH_NEST_INFO | ( | I, | |
ROOT ) |
Referenced by convert_all_function_calls(), finalize_nesting_tree(), unnest_nesting_tree(), and walk_all_functions().
Take the address of EXP to be used within function CONTEXT. Mark it for addressability as necessary.
References build_fold_addr_expr, exp(), and mark_addressable().
Referenced by build_init_call_stmt(), convert_nl_goto_reference(), convert_tramp_reference_op(), create_call_for_reduction_1(), finalize_nesting_tree_1(), get_static_chain(), gimple_gen_ic_func_profiler(), gimple_gen_interval_profiler(), gimple_ic(), instrument_decisions(), lower_builtin_setjmp(), and take_address_of().
|
static |
Given DECL, a nested function, build an initialization call for FIELD, the trampoline or descriptor for DECL, using FUNC as the function.
References build3(), build_addr(), DECL_STATIC_CHAIN, nesting_info::frame_decl, gcc_assert, gimple_build_call(), NULL_TREE, and TREE_TYPE.
Referenced by finalize_nesting_tree_1().
Like build_simple_mem_ref, but set TREE_THIS_NOTRAP on the result.
References build_simple_mem_ref, and TREE_THIS_NOTRAP.
Referenced by convert_nonlocal_reference_op(), get_frame_field(), get_nonlocal_debug_decl(), and get_static_chain().
We have to check for a fairly pathological case. The operands of function nested function are to be interpreted in the context of the enclosing function. So if any are variably-sized, they will get remapped when the enclosing function is inlined. But that remapping would also have to be done in the types of the PARM_DECLs of the nested function, meaning the argument types of that function will disagree with the arguments in the calls to that function. So we'd either have to make a copy of the nested function corresponding to each time the enclosing function was inlined or add a VIEW_CONVERT_EXPR to each such operand for each call to the nested function. The former is not practical. The latter would still require detecting this case to know when to add the conversions. So, for now at least, we don't inline such an enclosing function. A similar issue applies if the nested function has a variably modified return type, and is not inlined, but the enclosing function is inlined and so the type of the return slot as used in the enclosing function is remapped, so also avoid inlining in that case. We have to do that check recursively, so here return indicating whether FNDECL has such a nested function. ORIG_FN is the function we were trying to inline to use for checking whether any argument is variably modified by anything in it. It would be better to do this in tree-inline.cc so that we could give the appropriate warning for why a function can't be inlined, but that's too late since the nesting structure has already been flattened and adding a flag just to record this fact seems a waste of a flag.
References check_for_nested_with_variably_modified(), symtab_node::decl, DECL_ARGUMENTS, DECL_CHAIN, first_nested_function(), cgraph_node::get(), next_nested_function(), TREE_TYPE, and variably_modified_type_p().
Referenced by check_for_nested_with_variably_modified(), and create_nesting_tree().
A helper function for remap_vla_decls. See if *TP contains some remapped variables.
References DECL_P, hash_map< KeyId, Value, Traits >::get(), NULL, and nesting_info::var_map.
Referenced by remap_vla_decls().
|
static |
Walk the nesting tree starting with ROOT. Convert all trampolines and call expressions. At the same time, determine if a nested function actually uses its static chain; if not, remember that.
References thunk_info::alias, nesting_info::chain_decl, nesting_info::chain_field, nesting_info::context, convert_gimple_call(), convert_tramp_reference_op(), convert_tramp_reference_stmt(), lang_hooks::decl_printable_name, DECL_STATIC_CHAIN, dump_file, dump_flags, FOR_EACH_NEST_INFO, fputc(), cgraph_node::get(), thunk_info::get(), get_chain_decl(), get_frame_type(), nesting_info::inner, NULL, nesting_info::outer, TDF_DETAILS, nesting_info::thunk_p, and walk_function().
Referenced by lower_nested_functions().
|
static |
Called via walk_function+walk_gimple_stmt, rewrite all GIMPLE_CALLs that reference nested functions to make sure that the static chain is set up properly for the call.
References as_a(), build_omp_clause(), nesting_info::context, convert_gimple_call(), decl_function_context(), DECL_NAME, DECL_SIZE_UNIT, DECL_STATIC_CHAIN, nesting_info::frame_decl, get_chain_decl(), get_static_chain(), gimple_call_chain(), gimple_call_fndecl(), gimple_call_set_chain(), gimple_location(), gimple_omp_body_ptr(), gimple_omp_for_pre_body_ptr(), gimple_omp_target_clauses(), gimple_omp_target_set_clauses(), gimple_omp_taskreg_clauses(), gimple_omp_taskreg_set_clauses(), gimple_omp_teams_host(), gsi_stmt(), i, IDENTIFIER_POINTER, internal_error(), is_gimple_omp_offloaded(), NULL, NULL_TREE, OMP_CLAUSE_CHAIN, OMP_CLAUSE_CODE, OMP_CLAUSE_DECL, OMP_CLAUSE_FIRSTPRIVATE, OMP_CLAUSE_MAP, OMP_CLAUSE_SET_MAP_KIND, OMP_CLAUSE_SHARED, OMP_CLAUSE_SIZE, nesting_info::outer, nesting_info::static_chain_added, and walk_body().
Referenced by convert_all_function_calls(), and convert_gimple_call().
|
static |
Called via walk_function+walk_gimple_stmt, rewrite all references to VAR and PARM_DECLs that were referenced by inner nested functions. The rewrite will be a structure reference to the local frame variable.
Helper for convert_local_reference. Convert all the references in the chain of clauses at *PCLAUSES. WI is as in convert_local_reference.
References bitmap_copy(), BITMAP_GGC_ALLOC, bitmap_set_bit, nesting_info::context, convert_local_reference_op(), convert_local_reference_stmt(), convert_nonlocal_reference_op(), DECL_CONTEXT, DECL_EXTERNAL, decl_function_context(), DECL_P, DECL_UID, gcc_unreachable, get_local_debug_decl(), INDIRECT_REF_P, lookup_field_for_decl(), NULL, OMP_CLAUSE__CACHE_, OMP_CLAUSE__CONDTEMP_, OMP_CLAUSE__LOOPTEMP_, OMP_CLAUSE__REDUCTEMP_, OMP_CLAUSE__SCANTEMP_, OMP_CLAUSE__SIMDUID_, OMP_CLAUSE__SIMT_, OMP_CLAUSE_ALIGNED, OMP_CLAUSE_ALIGNED_ALIGNMENT, OMP_CLAUSE_ALLOCATE, OMP_CLAUSE_ALLOCATE_ALLOCATOR, OMP_CLAUSE_ASYNC, OMP_CLAUSE_AUTO, OMP_CLAUSE_BIND, OMP_CLAUSE_CHAIN, OMP_CLAUSE_CODE, OMP_CLAUSE_COLLAPSE, OMP_CLAUSE_COPYIN, OMP_CLAUSE_COPYPRIVATE, OMP_CLAUSE_DECL, OMP_CLAUSE_DEFAULT, OMP_CLAUSE_DEFAULTMAP, OMP_CLAUSE_DEPEND, OMP_CLAUSE_DETACH, OMP_CLAUSE_DEVICE, OMP_CLAUSE_DIST_SCHEDULE, OMP_CLAUSE_DIST_SCHEDULE_CHUNK_EXPR, OMP_CLAUSE_DOACROSS, OMP_CLAUSE_ENTER, OMP_CLAUSE_FILTER, OMP_CLAUSE_FINAL, OMP_CLAUSE_FINALIZE, OMP_CLAUSE_FIRSTPRIVATE, OMP_CLAUSE_FOR, OMP_CLAUSE_FROM, OMP_CLAUSE_GANG, OMP_CLAUSE_GANG_STATIC_EXPR, OMP_CLAUSE_GRAINSIZE, OMP_CLAUSE_HAS_DEVICE_ADDR, OMP_CLAUSE_HINT, OMP_CLAUSE_IF, OMP_CLAUSE_IF_PRESENT, OMP_CLAUSE_IN_REDUCTION, OMP_CLAUSE_INBRANCH, OMP_CLAUSE_INDEPENDENT, OMP_CLAUSE_IS_DEVICE_PTR, OMP_CLAUSE_LASTPRIVATE, OMP_CLAUSE_LASTPRIVATE_GIMPLE_SEQ, OMP_CLAUSE_LINEAR, OMP_CLAUSE_LINEAR_GIMPLE_SEQ, OMP_CLAUSE_LINEAR_STEP, OMP_CLAUSE_LINK, OMP_CLAUSE_MAP, OMP_CLAUSE_MERGEABLE, OMP_CLAUSE_NOGROUP, OMP_CLAUSE_NOHOST, OMP_CLAUSE_NONTEMPORAL, OMP_CLAUSE_NOTINBRANCH, OMP_CLAUSE_NOWAIT, OMP_CLAUSE_NUM_GANGS, OMP_CLAUSE_NUM_TASKS, OMP_CLAUSE_NUM_TEAMS, OMP_CLAUSE_NUM_THREADS, OMP_CLAUSE_NUM_WORKERS, OMP_CLAUSE_OPERAND, OMP_CLAUSE_ORDER, OMP_CLAUSE_ORDERED, OMP_CLAUSE_PARALLEL, OMP_CLAUSE_PRIORITY, OMP_CLAUSE_PRIVATE, OMP_CLAUSE_PROC_BIND, OMP_CLAUSE_REDUCTION, OMP_CLAUSE_REDUCTION_DECL_PLACEHOLDER, OMP_CLAUSE_REDUCTION_GIMPLE_INIT, OMP_CLAUSE_REDUCTION_GIMPLE_MERGE, OMP_CLAUSE_REDUCTION_PLACEHOLDER, OMP_CLAUSE_SAFELEN, OMP_CLAUSE_SCHEDULE, OMP_CLAUSE_SCHEDULE_CHUNK_EXPR, OMP_CLAUSE_SECTIONS, OMP_CLAUSE_SELF, OMP_CLAUSE_SEQ, OMP_CLAUSE_SHARED, OMP_CLAUSE_SHARED_READONLY, OMP_CLAUSE_SIMD, OMP_CLAUSE_SIMDLEN, OMP_CLAUSE_SIZE, OMP_CLAUSE_TASK_REDUCTION, OMP_CLAUSE_TASKGROUP, OMP_CLAUSE_THREAD_LIMIT, OMP_CLAUSE_THREADS, OMP_CLAUSE_TILE, OMP_CLAUSE_TO, OMP_CLAUSE_UNIFORM, OMP_CLAUSE_UNTIED, OMP_CLAUSE_USE_DEVICE_ADDR, OMP_CLAUSE_USE_DEVICE_PTR, OMP_CLAUSE_VECTOR, OMP_CLAUSE_VECTOR_LENGTH, OMP_CLAUSE_WAIT, OMP_CLAUSE_WORKER, nesting_info::suppress_expansion, TREE_CODE, TREE_OPERAND, TREE_STATIC, use_pointer_in_frame(), VAR_P, walk_body(), and walk_tree.
Referenced by convert_local_reference_stmt().
References hash_set< KeyId, Lazy, Traits >::add(), bitmap_bit_p, nesting_info::context, convert_local_reference_op(), current_function_decl, DECL_EXTERNAL, decl_function_context(), DECL_P, DECL_UID, nesting_info::frame_decl, get_frame_field(), get_local_debug_decl(), gsi_gimplify_val(), handled_component_p(), init_tmp_var(), IS_TYPE_OR_DECL_P, lookup_field_for_decl(), nesting_info::mem_refs, NULL, NULL_TREE, recompute_tree_invariant_for_addr_expr(), save_tmp_var(), nesting_info::suppress_expansion, TREE_ADDRESSABLE, TREE_CODE, TREE_OPERAND, TREE_STATIC, use_pointer_in_frame(), and walk_tree.
Referenced by convert_local_omp_clauses(), convert_local_reference_op(), convert_local_reference_stmt(), and lower_nested_functions().
|
static |
Called via walk_function+walk_gimple_stmt, rewrite all references to VAR and PARM_DECLs that were referenced by inner nested functions. The rewrite will be a structure reference to the local frame variable.
References as_a(), build_omp_clause(), CONSTRUCTOR_ELT, CONSTRUCTOR_ELTS, nesting_info::context, convert_local_omp_clauses(), convert_local_reference_op(), convert_local_reference_stmt(), DECL_CHAIN, DECL_EXTERNAL, decl_function_context(), DECL_P, DECL_SIZE_UNIT, declare_vars(), decls, FOR_EACH_CONSTRUCTOR_VALUE, nesting_info::frame_decl, get_frame_type(), get_local_debug_decl(), gimple_assign_lhs(), gimple_bind_vars(), gimple_build_nop(), gimple_clobber_p(), gimple_location(), gimple_omp_body(), gimple_omp_body_ptr(), gimple_omp_for_clauses_ptr(), gimple_omp_scope_clauses_ptr(), gimple_omp_sections_clauses_ptr(), gimple_omp_single_clauses_ptr(), gimple_omp_target_clauses(), gimple_omp_target_clauses_ptr(), gimple_omp_target_set_clauses(), gimple_omp_taskgroup_clauses_ptr(), gimple_omp_taskreg_clauses(), gimple_omp_taskreg_clauses_ptr(), gimple_omp_taskreg_set_clauses(), gimple_omp_teams_clauses_ptr(), gimple_omp_teams_host(), gimple_seq_first_stmt(), gsi_replace(), gsi_stmt(), i, is_gimple_omp_offloaded(), lookup_field_for_decl(), NAMELIST_DECL_ASSOCIATED_DECL, nesting_info::new_local_var_chain, NULL, NULL_TREE, OMP_CLAUSE_CHAIN, OMP_CLAUSE_DECL, OMP_CLAUSE_MAP, OMP_CLAUSE_SET_MAP_KIND, OMP_CLAUSE_SHARED, OMP_CLAUSE_SIZE, nesting_info::static_chain_added, nesting_info::suppress_expansion, TREE_CODE, TREE_STATIC, use_pointer_in_frame(), VAR_P, walk_body(), and walk_gimple_omp_for().
Referenced by convert_local_omp_clauses(), convert_local_reference_stmt(), and lower_nested_functions().
|
static |
Called via walk_function+walk_tree, rewrite all GIMPLE_LABELs whose labels are referenced via nonlocal goto from a nested function. The rewrite will involve installing a newly generated DECL_NONLOCAL label, and (potentially) a branch around the rtl gunk that is assumed to be attached to such a label.
References dyn_cast(), hash_map< KeyId, Value, Traits >::get(), gimple_build_goto(), gimple_build_label(), gimple_label_label(), gimple_stmt_may_fallthru(), gsi_end_p(), gsi_insert_before(), gsi_prev(), GSI_SAME_STMT, gsi_stmt(), NULL_TREE, and nesting_info::var_map.
Referenced by lower_nested_functions().
|
static |
Called via walk_function+walk_gimple_stmt, rewrite all GIMPLE_GOTOs that reference labels from outer functions. The rewrite will be a call to __builtin_nonlocal_goto.
References build_addr(), builtin_decl_implicit(), nesting_info::context, create_artificial_label(), decl_function_context(), DECL_NONLOCAL, get_frame_field(), get_nl_goto_field(), gimple_build_call(), gimple_goto_dest(), gsi_gimplify_val(), gsi_replace(), gsi_stmt(), i, NULL, NULL_TREE, nesting_info::outer, TREE_CODE, and UNKNOWN_LOCATION.
Referenced by lower_nested_functions().
|
static |
Helper for convert_nonlocal_references, rewrite all references to VAR and PARM_DECLs that belong to outer functions.
References bitmap_copy(), BITMAP_GGC_ALLOC, bitmap_set_bit, nesting_info::context, convert_nonlocal_reference_op(), convert_nonlocal_reference_stmt(), DECL_CONTEXT, DECL_EXTERNAL, decl_function_context(), DECL_P, DECL_UID, declare_vars(), g, gcc_unreachable, get_nonlocal_debug_decl(), gimple_build_bind(), gimple_seq_add_stmt_without_update(), gimple_seq_first_stmt(), INDIRECT_REF_P, nesting_info::new_local_var_chain, NULL, NULL_TREE, OMP_CLAUSE__CACHE_, OMP_CLAUSE__CONDTEMP_, OMP_CLAUSE__LOOPTEMP_, OMP_CLAUSE__REDUCTEMP_, OMP_CLAUSE__SCANTEMP_, OMP_CLAUSE__SIMDUID_, OMP_CLAUSE__SIMT_, OMP_CLAUSE_ALIGNED, OMP_CLAUSE_ALIGNED_ALIGNMENT, OMP_CLAUSE_ALLOCATE, OMP_CLAUSE_ALLOCATE_ALLOCATOR, OMP_CLAUSE_ASYNC, OMP_CLAUSE_AUTO, OMP_CLAUSE_BIND, OMP_CLAUSE_CHAIN, OMP_CLAUSE_CODE, OMP_CLAUSE_COLLAPSE, OMP_CLAUSE_COPYIN, OMP_CLAUSE_COPYPRIVATE, OMP_CLAUSE_DECL, OMP_CLAUSE_DEFAULT, OMP_CLAUSE_DEFAULTMAP, OMP_CLAUSE_DEPEND, OMP_CLAUSE_DETACH, OMP_CLAUSE_DEVICE, OMP_CLAUSE_DIST_SCHEDULE, OMP_CLAUSE_DIST_SCHEDULE_CHUNK_EXPR, OMP_CLAUSE_DOACROSS, OMP_CLAUSE_ENTER, OMP_CLAUSE_FILTER, OMP_CLAUSE_FINAL, OMP_CLAUSE_FINALIZE, OMP_CLAUSE_FIRSTPRIVATE, OMP_CLAUSE_FOR, OMP_CLAUSE_FROM, OMP_CLAUSE_GANG, OMP_CLAUSE_GANG_STATIC_EXPR, OMP_CLAUSE_GRAINSIZE, OMP_CLAUSE_HAS_DEVICE_ADDR, OMP_CLAUSE_HINT, OMP_CLAUSE_IF, OMP_CLAUSE_IF_PRESENT, OMP_CLAUSE_IN_REDUCTION, OMP_CLAUSE_INBRANCH, OMP_CLAUSE_INDEPENDENT, OMP_CLAUSE_IS_DEVICE_PTR, OMP_CLAUSE_LASTPRIVATE, OMP_CLAUSE_LASTPRIVATE_GIMPLE_SEQ, OMP_CLAUSE_LINEAR, OMP_CLAUSE_LINEAR_GIMPLE_SEQ, OMP_CLAUSE_LINEAR_STEP, OMP_CLAUSE_LINK, OMP_CLAUSE_MAP, OMP_CLAUSE_MERGEABLE, OMP_CLAUSE_NOGROUP, OMP_CLAUSE_NOHOST, OMP_CLAUSE_NONTEMPORAL, OMP_CLAUSE_NOTINBRANCH, OMP_CLAUSE_NOWAIT, OMP_CLAUSE_NUM_GANGS, OMP_CLAUSE_NUM_TASKS, OMP_CLAUSE_NUM_TEAMS, OMP_CLAUSE_NUM_THREADS, OMP_CLAUSE_NUM_WORKERS, OMP_CLAUSE_OPERAND, OMP_CLAUSE_ORDER, OMP_CLAUSE_ORDERED, OMP_CLAUSE_PARALLEL, OMP_CLAUSE_PRIORITY, OMP_CLAUSE_PRIVATE, OMP_CLAUSE_PROC_BIND, OMP_CLAUSE_REDUCTION, OMP_CLAUSE_REDUCTION_DECL_PLACEHOLDER, OMP_CLAUSE_REDUCTION_GIMPLE_INIT, OMP_CLAUSE_REDUCTION_GIMPLE_MERGE, OMP_CLAUSE_REDUCTION_PLACEHOLDER, OMP_CLAUSE_SAFELEN, OMP_CLAUSE_SCHEDULE, OMP_CLAUSE_SCHEDULE_CHUNK_EXPR, OMP_CLAUSE_SECTIONS, OMP_CLAUSE_SELF, OMP_CLAUSE_SEQ, OMP_CLAUSE_SHARED, OMP_CLAUSE_SHARED_READONLY, OMP_CLAUSE_SIMD, OMP_CLAUSE_SIMDLEN, OMP_CLAUSE_SIZE, OMP_CLAUSE_TASK_REDUCTION, OMP_CLAUSE_TASKGROUP, OMP_CLAUSE_THREAD_LIMIT, OMP_CLAUSE_THREADS, OMP_CLAUSE_TILE, OMP_CLAUSE_TO, OMP_CLAUSE_UNIFORM, OMP_CLAUSE_UNTIED, OMP_CLAUSE_USE_DEVICE_ADDR, OMP_CLAUSE_USE_DEVICE_PTR, OMP_CLAUSE_VECTOR, OMP_CLAUSE_VECTOR_LENGTH, OMP_CLAUSE_WAIT, OMP_CLAUSE_WORKER, nesting_info::suppress_expansion, TREE_CODE, TREE_OPERAND, TREE_STATIC, VAR_P, walk_body(), and walk_tree.
Referenced by convert_nonlocal_reference_stmt().
Callback for walk_gimple_stmt, rewrite all references to VAR and PARM_DECLs that belong to outer functions. The rewrite will involve some number of structure accesses back up the static chain. E.g. for a variable FOO up one nesting level it'll be CHAIN->FOO. For two levels it'll be CHAIN->__chain->FOO. Further indirections apply to decls for which use_pointer_in_frame is true.
References bitmap_bit_p, build_simple_mem_ref_notrap(), nesting_info::context, convert_nonlocal_reference_op(), current_function_decl, DECL_EXTERNAL, decl_function_context(), DECL_NAME, DECL_UID, FORCED_LABEL, get_frame_field(), get_nonlocal_debug_decl(), gsi_gimplify_val(), handled_component_p(), i, IDENTIFIER_POINTER, init_tmp_var(), internal_error(), IS_TYPE_OR_DECL_P, lookup_field_for_decl(), NULL, NULL_TREE, nesting_info::outer, recompute_tree_invariant_for_addr_expr(), save_tmp_var(), nesting_info::suppress_expansion, TREE_CODE, TREE_OPERAND, TREE_STATIC, use_pointer_in_frame(), and walk_tree.
Referenced by convert_local_omp_clauses(), convert_nonlocal_omp_clauses(), convert_nonlocal_reference_op(), convert_nonlocal_reference_stmt(), and lower_nested_functions().
|
static |
Callback for walk_gimple_stmt. Rewrite all references to VAR and PARM_DECLs that belong to outer functions. This handles statements that are not handled via the standard recursion done in walk_gimple_stmt. STMT is the statement to examine, DATA is as in convert_nonlocal_reference_op. Set *HANDLED_OPS_P to true if all the operands of STMT have been handled by this function.
References as_a(), build_omp_clause(), CONSTRUCTOR_ELT, CONSTRUCTOR_ELTS, nesting_info::context, convert_nonlocal_omp_clauses(), convert_nonlocal_reference_op(), convert_nonlocal_reference_stmt(), DECL_CHAIN, DECL_EXTERNAL, decl_function_context(), DECL_P, DECL_SIZE_UNIT, declare_vars(), decls, FOR_EACH_CONSTRUCTOR_VALUE, get_chain_decl(), get_nonlocal_debug_decl(), gimple_assign_lhs(), gimple_bind_vars(), gimple_build_nop(), gimple_clobber_p(), gimple_goto_dest(), gimple_location(), gimple_omp_body(), gimple_omp_body_ptr(), gimple_omp_for_clauses_ptr(), gimple_omp_scope_clauses_ptr(), gimple_omp_sections_clauses_ptr(), gimple_omp_single_clauses_ptr(), gimple_omp_target_clauses(), gimple_omp_target_clauses_ptr(), gimple_omp_target_set_clauses(), gimple_omp_taskgroup_clauses_ptr(), gimple_omp_taskreg_clauses(), gimple_omp_taskreg_clauses_ptr(), gimple_omp_taskreg_set_clauses(), gimple_omp_teams_clauses_ptr(), gimple_omp_teams_host(), gimple_seq_first_stmt(), gsi_replace(), gsi_stmt(), i, is_gimple_omp_offloaded(), NAMELIST_DECL_ASSOCIATED_DECL, nesting_info::new_local_var_chain, NULL, NULL_TREE, OMP_CLAUSE_CHAIN, OMP_CLAUSE_DECL, OMP_CLAUSE_FIRSTPRIVATE, OMP_CLAUSE_MAP, OMP_CLAUSE_SET_MAP_KIND, OMP_CLAUSE_SIZE, nesting_info::suppress_expansion, TREE_CODE, TREE_STATIC, VAR_P, walk_body(), and walk_gimple_omp_for().
Referenced by convert_nonlocal_omp_clauses(), convert_nonlocal_reference_stmt(), and lower_nested_functions().
Called via walk_function+walk_stmt, rewrite all references to addresses of nested functions that require the use of trampolines. The rewrite will involve a reference a trampoline generated for the occasion.
References build1(), build_addr(), builtin_decl_implicit(), nesting_info::context, decl_function_context(), DECL_STATIC_CHAIN, FUNC_ADDR_BY_DESCRIPTOR, get_frame_field(), gimple_build_call(), gsi_gimplify_val(), i, init_tmp_var(), init_tmp_var_with_call(), IS_TYPE_OR_DECL_P, lookup_descr_for_decl(), lookup_tramp_for_decl(), NULL_TREE, TRAMPOLINE_IMPL_HEAP, TREE_CODE, TREE_NO_TRAMPOLINE, TREE_OPERAND, and TREE_TYPE.
Referenced by convert_all_function_calls(), and convert_tramp_reference_stmt().
|
static |
Called via walk_function+walk_gimple_stmt, rewrite all references to addresses of nested functions that require the use of trampolines. The rewrite will involve a reference a trampoline generated for the occasion.
References as_a(), build_omp_clause(), convert_tramp_reference_op(), convert_tramp_reference_stmt(), DECL_SIZE_UNIT, declare_vars(), nesting_info::frame_decl, get_chain_decl(), gimple_call_arg_ptr(), gimple_call_num_args(), gimple_location(), gimple_omp_body(), gimple_omp_body_ptr(), gimple_omp_target_clauses(), gimple_omp_target_set_clauses(), gimple_omp_taskreg_clauses(), gimple_omp_taskreg_set_clauses(), gimple_omp_teams_host(), gimple_seq_first_stmt(), gsi_stmt(), i, is_gimple_omp_offloaded(), nesting_info::new_local_var_chain, NULL, NULL_TREE, OMP_CLAUSE_CHAIN, OMP_CLAUSE_CODE, OMP_CLAUSE_DECL, OMP_CLAUSE_FIRSTPRIVATE, OMP_CLAUSE_MAP, OMP_CLAUSE_SET_MAP_KIND, OMP_CLAUSE_SHARED, OMP_CLAUSE_SIZE, nesting_info::static_chain_added, walk_body(), walk_gimple_op(), and walk_tree.
Referenced by convert_all_function_calls(), and convert_tramp_reference_stmt().
|
static |
Given DECL, a nested function, create a field in the non-local frame structure for this function.
References DECL_NAME, get_frame_type(), insert_field_into_struct(), make_node(), TREE_ADDRESSABLE, TREE_TYPE, and type().
Referenced by lookup_descr_for_decl(), and lookup_tramp_for_decl().
|
static |
Construct our local datastructure describing the function nesting tree rooted by CGN.
References BITMAP_ALLOC, check_for_nested_with_variably_modified(), nesting_info::context, create_nesting_tree(), symtab_node::decl, DECL_ATTRIBUTES, DECL_UNINLINABLE, nesting_info::field_map, first_nested_function(), get_identifier(), nesting_info::inner, lookup_attribute(), nesting_info::mem_refs, nesting_info_bitmap_obstack, next_nested_function(), NULL, nesting_info::suppress_expansion, cgraph_node::thunk, nesting_info::thunk_p, tree_cons(), and nesting_info::var_map.
Referenced by create_nesting_tree(), and lower_nested_functions().
|
static |
Like create_tmp_var, except record the variable for registration at the given nesting level.
References nesting_info::context, create_tmp_var_raw(), DECL_CHAIN, DECL_CONTEXT, DECL_SEEN_IN_BIND_EXPR_P, gcc_assert, nesting_info::new_local_var_chain, TREE_ADDRESSABLE, TREE_CODE, and TYPE_SIZE_UNIT.
Referenced by init_tmp_var(), init_tmp_var_with_call(), and save_tmp_var().
|
static |
References finalize_nesting_tree_1(), and FOR_EACH_NEST_INFO.
Referenced by lower_nested_functions().
|
static |
Do "everything else" to clean up or complete state collected by the various walking passes -- create a field to hold the frame base address, lay out the types and decls, generate code to initialize the frame decl, store critical expressions in the struct function for rtl to find.
References annotate_all_with_location(), nesting_info::any_descr_created, nesting_info::any_parm_remapped, nesting_info::any_tramp_created, BLOCK_VARS, build3(), build_addr(), build_init_call_stmt(), build_int_cst(), builtin_decl_explicit(), builtin_decl_implicit(), nesting_info::chain_decl, nesting_info::chain_field, chainon(), nesting_info::context, nesting_info::debug_var_chain, DECL_ARGUMENTS, DECL_CHAIN, DECL_CONTEXT, DECL_INITIAL, DECL_NAME, DECL_ORIGINAL_TYPE, DECL_SOURCE_LOCATION, DECL_STATIC_CHAIN, DECL_STRUCT_FUNCTION, declare_vars(), dump_file, dump_flags, dump_function_to_file(), fixup_vla_decls(), fold_mem_refs(), nesting_info::frame_decl, nesting_info::frame_type, gcc_assert, get_chain_decl(), get_frame_field(), get_identifier(), gimple_bind_block(), gimple_bind_body(), gimple_bind_set_body(), gimple_body(), gimple_build_assign(), gimple_build_call(), gimple_build_try(), gimple_seq_add_seq(), gimple_seq_add_stmt(), gimple_seq_first_stmt(), gimple_seq_first_stmt_as_a_bind(), GIMPLE_TRY_FINALLY, gsi_last(), function::has_nonlocal_label, i, init_tmp_var(), init_tmp_var_with_call(), nesting_info::inner, integer_zero_node, is_gimple_reg(), is_gimple_reg_type(), layout_decl(), layout_type(), lookup_descr_for_decl(), lookup_field_for_decl(), lookup_tramp_for_decl(), make_node(), nesting_info::mem_refs, nesting_copy_decl(), nesting_info::new_local_var_chain, nesting_info::next, nesting_info::nl_goto_field, function::nonlocal_goto_save_area, NULL, NULL_TREE, nesting_info::outer, POINTER_TYPE_P, ptr_type_node, remap_decl(), remap_type(), remap_vla_decls(), nesting_copy_body_data::root, function::static_chain_decl, nesting_info::thunk_p, TRAMPOLINE_IMPL_HEAP, hash_set< KeyId, Lazy, Traits >::traverse(), TREE_ADDRESSABLE, TREE_CODE, TREE_TYPE, type(), TYPE_FIELDS, TYPE_NAME, use_pointer_in_frame(), variably_modified_type_p(), and y.
Referenced by finalize_nesting_tree().
|
static |
Fixup VLA decls in BLOCK and subblocks if remapped variables are involved.
References BLOCK_CHAIN, BLOCK_SUBBLOCKS, BLOCK_VARS, build1(), DECL_CHAIN, DECL_HAS_VALUE_EXPR_P, DECL_VALUE_EXPR, fixup_vla_decls(), INDIRECT_REF_P, SET_DECL_VALUE_EXPR, TREE_OPERAND, TREE_TYPE, and VAR_P.
Referenced by finalize_nesting_tree_1(), and fixup_vla_decls().
|
static |
Free the data structures allocated during this pass.
References nesting_info::field_map, free(), iter_nestinfo_next(), iter_nestinfo_start(), nesting_info::mem_refs, nesting_info::next, and nesting_info::var_map.
Referenced by lower_nested_functions().
|
static |
Build or return the variable that holds the static chain within INFO->CONTEXT. This variable may only be used within INFO->CONTEXT.
References build_decl(), build_pointer_type(), nesting_info::chain_decl, nesting_info::context, create_tmp_var_name(), DECL_ARG_TYPE, DECL_ARTIFICIAL, DECL_CONTEXT, DECL_IGNORED_P, lang_hooks::decl_printable_name, DECL_SOURCE_LOCATION, DECL_STATIC_CHAIN, dump_file, dump_flags, get_frame_type(), nesting_info::outer, TDF_DETAILS, TREE_READONLY, TREE_USED, and type().
Referenced by convert_all_function_calls(), convert_gimple_call(), convert_nonlocal_reference_stmt(), convert_tramp_reference_stmt(), finalize_nesting_tree_1(), get_frame_field(), get_nonlocal_debug_decl(), and get_static_chain().
|
static |
Build or return the field within the non-local frame state that holds the static chain for INFO->CONTEXT. This is the way to walk back up multiple nesting levels.
References build_pointer_type(), nesting_info::chain_field, nesting_info::context, DECL_NAME, DECL_NONADDRESSABLE_P, lang_hooks::decl_printable_name, DECL_STATIC_CHAIN, dump_file, dump_flags, get_frame_type(), get_identifier(), insert_field_into_struct(), make_node(), nesting_info::outer, SET_DECL_ALIGN, TDF_DETAILS, TREE_TYPE, type(), and TYPE_ALIGN.
Referenced by get_frame_field(), get_nonlocal_debug_decl(), and get_static_chain().
Helper for get_nonlocal_debug_decl and get_local_debug_decl.
References build_decl(), COPY_DLF, DECL_ARTIFICIAL, DECL_BY_REFERENCE, DECL_IGNORED_P, DECL_LANG_SPECIFIC, DECL_NAME, DECL_SEEN_IN_BIND_EXPR_P, DECL_SOURCE_LOCATION, TREE_ADDRESSABLE, TREE_CODE, TREE_READONLY, TREE_SIDE_EFFECTS, TREE_THIS_VOLATILE, TREE_TYPE, and VAR_P.
Referenced by get_local_debug_decl(), and get_nonlocal_debug_decl().
|
static |
References build_array_type(), build_decl(), build_index_type(), DECL_CONTEXT, DECL_SOURCE_LOCATION, DECL_USER_ALIGN, descriptor_type, FUNCTION_ALIGNMENT, get_identifier(), integer_one_node, layout_type(), make_node(), MAX, ptr_type_node, SET_DECL_ALIGN, TYPE_ALIGN, TYPE_FIELDS, and TYPE_NAME.
Referenced by lookup_descr_for_decl().
|
static |
Return an expression referencing FIELD from TARGET_CONTEXT's non-local frame as seen from INFO->CONTEXT. Insert any necessary computations before GSI.
References build3(), build_simple_mem_ref_notrap(), nesting_info::context, nesting_info::frame_decl, get_chain_decl(), get_chain_field(), get_frame_type(), i, init_tmp_var(), NULL_TREE, nesting_info::outer, nesting_info::static_chain_added, TREE_THIS_VOLATILE, and TREE_TYPE.
Referenced by convert_local_reference_op(), convert_nl_goto_reference(), convert_nonlocal_reference_op(), convert_tramp_reference_op(), and finalize_nesting_tree_1().
|
static |
Build or return the RECORD_TYPE that describes the frame state that is shared between INFO->CONTEXT and its nested functions. This record will not be complete until finalize_nesting_tree; up until that point we'll be adding fields as necessary. We also build the DECL that represents this frame in the function.
References nesting_info::context, create_tmp_var_raw(), DECL_CONTEXT, DECL_NAME, DECL_NONLOCAL_FRAME, DECL_SEEN_IN_BIND_EXPR_P, nesting_info::frame_decl, nesting_info::frame_type, free(), get_identifier(), IDENTIFIER_POINTER, make_node(), NULL, TREE_ADDRESSABLE, type(), and TYPE_NAME.
Referenced by convert_all_function_calls(), convert_local_reference_stmt(), create_field_for_decl(), get_chain_decl(), get_chain_field(), get_frame_field(), get_local_debug_decl(), get_nl_goto_field(), get_nonlocal_debug_decl(), and lookup_field_for_decl().
|
static |
A subroutine of convert_local_reference. Create a local variable in the parent function with DECL_VALUE_EXPR set to reference the field in FRAME. This is used both for debug info and in OMP lowering.
References build3(), nesting_info::context, nesting_info::debug_var_chain, DECL_CHAIN, DECL_CONTEXT, DECL_HAS_VALUE_EXPR_P, DECL_IGNORED_P, nesting_info::frame_decl, get_debug_decl(), get_frame_type(), hash_map< KeyId, Value, Traits >::get_or_insert(), NULL_TREE, SET_DECL_VALUE_EXPR, TREE_TYPE, and nesting_info::var_map.
Referenced by convert_local_omp_clauses(), convert_local_reference_op(), and convert_local_reference_stmt().
|
static |
Build or return the field within the non-local frame state that holds the non-local goto "jmp_buf". The buffer itself is maintained by the rtl middle-end as dynamic stack space is allocated.
References as_a(), build_array_type(), build_index_type(), DECL_NAME, get_frame_type(), get_identifier(), GET_MODE_SIZE(), insert_field_into_struct(), make_node(), nesting_info::nl_goto_field, ptr_mode, ptr_type_node, SAVE_NONLOCAL, SET_DECL_ALIGN, size_int, TREE_ADDRESSABLE, TREE_TYPE, type(), TYPE_ALIGN, lang_hooks_for_types::type_for_mode, and lang_hooks::types.
Referenced by convert_nl_goto_reference().
|
static |
A subroutine of convert_nonlocal_reference_op. Create a local variable in the nested function with DECL_VALUE_EXPR set to reference the true variable in the parent function. This is used both for debug info and in OMP lowering.
References build3(), build_simple_mem_ref_notrap(), nesting_info::context, nesting_info::debug_var_chain, DECL_CHAIN, DECL_CONTEXT, decl_function_context(), DECL_HAS_VALUE_EXPR_P, nesting_info::frame_decl, get_chain_decl(), get_chain_field(), get_debug_decl(), get_frame_type(), hash_map< KeyId, Value, Traits >::get_or_insert(), i, lookup_field_for_decl(), note_nonlocal_vla_type(), NULL, NULL_TREE, nesting_info::outer, SET_DECL_VALUE_EXPR, nesting_info::static_chain_added, TREE_TYPE, use_pointer_in_frame(), nesting_info::var_map, and variably_modified_type_p().
Referenced by convert_nonlocal_omp_clauses(), convert_nonlocal_reference_op(), convert_nonlocal_reference_stmt(), and note_nonlocal_vla_type().
|
static |
Return an expression computing the static chain for TARGET_CONTEXT from INFO->CONTEXT. Insert any necessary computations before TSI.
References build3(), build_addr(), build_simple_mem_ref_notrap(), nesting_info::context, nesting_info::frame_decl, get_chain_decl(), get_chain_field(), i, init_tmp_var(), NULL_TREE, nesting_info::outer, nesting_info::static_chain_added, and TREE_TYPE.
Referenced by convert_gimple_call().
|
static |
References build_array_type(), build_decl(), build_index_type(), build_pointer_type(), char_type_node, DECL_CONTEXT, DECL_SOURCE_LOCATION, DECL_USER_ALIGN, get_identifier(), layout_type(), make_node(), SET_DECL_ALIGN, size_int, TRAMPOLINE_ALIGNMENT, TRAMPOLINE_IMPL_HEAP, trampoline_type, TYPE_FIELDS, TYPE_NAME, and void_type_node.
Referenced by lookup_tramp_for_decl().
|
static |
Gimplify a function and all its nested functions.
References symtab_node::decl, first_nested_function(), gimple_body(), gimplify_all_functions(), gimplify_function_tree(), next_nested_function(), and cgraph_node::thunk.
Referenced by gimplify_all_functions(), and lower_nested_functions().
|
static |
Similarly, but only do so to force EXP to satisfy is_gimple_val.
References exp(), init_tmp_var(), and is_gimple_val().
Referenced by convert_local_reference_op(), convert_nl_goto_reference(), convert_nonlocal_reference_op(), and convert_tramp_reference_op().
|
static |
Copy EXP into a temporary. Allocate the temporary in the context of INFO and insert the initialization statement before GSI.
References create_tmp_var_for(), exp(), gimple_build_assign(), gimple_location(), gimple_set_location(), gsi_end_p(), gsi_insert_before_without_update(), GSI_SAME_STMT, gsi_stmt(), NULL, and TREE_TYPE.
Referenced by convert_local_reference_op(), convert_nonlocal_reference_op(), convert_tramp_reference_op(), finalize_nesting_tree_1(), get_frame_field(), get_static_chain(), and gsi_gimplify_val().
|
static |
Initialize a new temporary with the GIMPLE_CALL STMT.
References create_tmp_var_for(), gimple_call_return_type(), gimple_call_set_lhs(), gimple_location(), gimple_set_location(), gsi_end_p(), gsi_insert_before(), GSI_SAME_STMT, gsi_stmt(), and NULL.
Referenced by convert_tramp_reference_op(), and finalize_nesting_tree_1().
Insert FIELD into TYPE, sorted by alignment requirements.
References DECL_ALIGN, DECL_CHAIN, DECL_CONTEXT, SET_TYPE_ALIGN, type(), TYPE_ALIGN, and TYPE_FIELDS.
Referenced by add_field_for_name(), add_field_for_reduction(), create_field_for_decl(), get_chain_field(), get_nl_goto_field(), install_var_field(), install_var_field(), lookup_field_for_decl(), ompdevlow_adjust_simt_enter(), and scan_sharing_clauses().
|
inlinestatic |
References iter_nestinfo_start(), nesting_info::next, and nesting_info::outer.
Referenced by free_nesting_tree().
|
inlinestatic |
Iterate over the nesting tree, starting with ROOT, depth first.
References nesting_info::inner.
Referenced by free_nesting_tree(), and iter_nestinfo_next().
|
static |
Given DECL, a nested function, find or create a field in the non-local frame structure for a descriptor for this function.
References nesting_info::any_descr_created, create_field_for_decl(), get_descriptor_type(), insert(), lookup_element_for_decl(), NULL_TREE, and TREE_VALUE.
Referenced by convert_tramp_reference_op(), and finalize_nesting_tree_1().
|
static |
Given DECL, a nested function, find or create an element in the var map for this function.
References build_tree_list(), hash_map< KeyId, Value, Traits >::get(), hash_map< KeyId, Value, Traits >::get_or_insert(), insert(), NULL_TREE, and nesting_info::var_map.
Referenced by lookup_descr_for_decl(), and lookup_tramp_for_decl().
|
static |
Given DECL, a non-locally accessed variable, find or create a field in the non-local frame structure for the given nesting context.
References nesting_info::any_parm_remapped, build3(), build_pointer_type(), nesting_info::context, copy_warning(), DECL_ALIGN, DECL_CHAIN, decl_function_context(), DECL_HAS_VALUE_EXPR_P, DECL_IGNORED_P, DECL_NAME, DECL_NONADDRESSABLE_P, DECL_SOURCE_LOCATION, DECL_USER_ALIGN, DECL_VALUE_EXPR, nesting_info::field_map, nesting_info::frame_decl, gcc_checking_assert, hash_map< KeyId, Value, Traits >::get(), get_frame_type(), hash_map< KeyId, Value, Traits >::get_or_insert(), insert(), insert_field_into_struct(), make_node(), NULL_TREE, SET_DECL_ALIGN, SET_DECL_VALUE_EXPR, TREE_ADDRESSABLE, TREE_CODE, TREE_THIS_VOLATILE, TREE_TYPE, TYPE_ALIGN, use_pointer_in_frame(), and VAR_P.
Referenced by convert_local_omp_clauses(), convert_local_reference_op(), convert_local_reference_stmt(), convert_nonlocal_reference_op(), finalize_nesting_tree_1(), and get_nonlocal_debug_decl().
|
static |
Given DECL, a nested function, find or create a field in the non-local frame structure for a trampoline for this function.
References nesting_info::any_tramp_created, create_field_for_decl(), get_trampoline_type(), insert(), lookup_element_for_decl(), NULL_TREE, and TREE_PURPOSE.
Referenced by convert_tramp_reference_op(), and finalize_nesting_tree_1().
void lower_nested_functions | ( | tree | fndecl | ) |
Main entry point for this pass. Process FNDECL and all of its nested subroutines and turn them into something less tightly bound.
References bitmap_obstack_initialize(), bitmap_obstack_release(), convert_all_function_calls(), convert_local_reference_op(), convert_local_reference_stmt(), convert_nl_goto_receiver(), convert_nl_goto_reference(), convert_nonlocal_reference_op(), convert_nonlocal_reference_stmt(), create_nesting_tree(), lang_hooks::decl_printable_name, dump_begin(), dump_end(), dump_file, dump_flags, finalize_nesting_tree(), first_nested_function(), free_nesting_tree(), cgraph_node::get(), gimplify_all_functions(), nesting_info_bitmap_obstack, NULL, set_dump_file(), TDI_nested, unnest_nesting_tree(), and walk_all_functions().
Referenced by cgraph_node::analyze().
void maybe_record_nested_function | ( | cgraph_node * | node | ) |
If NODE is nested function, record it.
References CONSTRUCTION, symtab_node::decl, DECL_CONTEXT, cgraph_node::get_create(), nested_function_info::get_create(), nested_function_info::nested, nested_function_info::next_nested, nested_function_info::origin, symbol_table::state, symtab, and TREE_CODE.
Referenced by cgraph_node::create().
|
static |
A helper subroutine for debug_var_chain type remapping.
References copy_decl_no_change(), DECL_ORIGINAL_TYPE, hash_map< KeyId, Value, Traits >::get(), remap_type(), nesting_copy_body_data::root, TREE_CODE, nesting_info::var_map, and VAR_P.
Referenced by finalize_nesting_tree_1(), and remap_vla_decls().
|
static |
Create nonlocal debug decls for nonlocal VLA array bounds.
References nesting_info::context, decl_function_context(), DECL_ORIGINAL_TYPE, get_nonlocal_debug_decl(), note_nonlocal_vla_type(), POINTER_TYPE_P, TREE_CODE, TREE_TYPE, TYPE_DOMAIN, TYPE_MAX_VALUE, TYPE_MIN_VALUE, TYPE_NAME, VAR_P, and VECTOR_TYPE_P.
Referenced by get_nonlocal_debug_decl(), and note_nonlocal_vla_type().
|
static |
Remap VLA decls in BLOCK and subblocks if remapped variables are involved.
References BLOCK_CHAIN, BLOCK_SUBBLOCKS, BLOCK_VARS, build1(), contains_remapped_vars(), nesting_info::context, copy_tree_body_r(), DECL_CHAIN, decl_function_context(), DECL_HAS_VALUE_EXPR_P, DECL_ORIGINAL_TYPE, DECL_P, DECL_STRUCT_FUNCTION, DECL_VALUE_EXPR, gcc_assert, hash_map< KeyId, Value, Traits >::get(), i, INDIRECT_REF_P, nesting_copy_decl(), NULL, NULL_TREE, nesting_info::outer, POINTER_TYPE_P, remap_decl(), remap_type(), remap_vla_decls(), nesting_copy_body_data::root, SET_DECL_VALUE_EXPR, TREE_CODE, TREE_OPERAND, TREE_TYPE, type(), TYPE_NAME, nesting_info::var_map, VAR_P, variably_modified_type_p(), and walk_tree.
Referenced by finalize_nesting_tree_1(), and remap_vla_decls().
|
static |
Similarly, but copy from the temporary and insert the statement after the iterator.
References create_tmp_var_for(), exp(), gimple_build_assign(), gimple_location(), gimple_set_location(), gsi_end_p(), gsi_insert_after_without_update(), GSI_SAME_STMT, gsi_stmt(), NULL, and TREE_TYPE.
Referenced by convert_local_reference_op(), and convert_nonlocal_reference_op().
void unnest_function | ( | cgraph_node * | node | ) |
cgraph_node is no longer nested function; update cgraph accordingly.
References gcc_checking_assert, nested_function_info::get(), nested_function_info::nested, nested_function_origin(), nested_function_sum, nested_function_info::next_nested, NULL, nested_function_info::origin, and cgraph_node::remove().
Referenced by unnest_nesting_tree_1().
|
static |
References FOR_EACH_NEST_INFO, and unnest_nesting_tree_1().
Referenced by lower_nested_functions().
|
static |
Unnest the nodes and pass them to cgraph.
References nesting_info::context, cgraph_node::finalize_function(), cgraph_node::get(), nested_function_info::get(), nesting_info::thunk_p, and unnest_function().
Referenced by unnest_nesting_tree().
Return true if DECL should be referenced by pointer in the non-local frame structure.
References AGGREGATE_TYPE_P, DECL_SIZE, TREE_CODE, and TREE_TYPE.
Referenced by convert_local_omp_clauses(), convert_local_reference_op(), convert_local_reference_stmt(), convert_nonlocal_reference_op(), finalize_nesting_tree_1(), get_nonlocal_debug_decl(), and lookup_field_for_decl().
|
static |
Similarly for ROOT and all functions nested underneath, depth first.
References FOR_EACH_NEST_INFO, and walk_function().
Referenced by lower_nested_functions().
|
static |
Invoke CALLBACK on all statements of GIMPLE sequence *PSEQ.
References walk_stmt_info::info, and walk_gimple_seq_mod().
Referenced by convert_gimple_call(), convert_local_omp_clauses(), convert_local_reference_stmt(), convert_nonlocal_omp_clauses(), convert_nonlocal_reference_stmt(), convert_tramp_reference_stmt(), walk_function(), and walk_gimple_omp_for().
|
inlinestatic |
Invoke CALLBACK_STMT/CALLBACK_OP on all statements of INFO->CONTEXT.
References gimple_body(), gimple_set_body(), walk_stmt_info::info, and walk_body().
Referenced by convert_all_function_calls(), and walk_all_functions().
|
static |
Invoke CALLBACK on a GIMPLE_OMP_FOR's init, cond, incr and pre-body.
References annotate_all_with_location(), BINARY_CLASS_P, gcc_assert, gimple_location(), gimple_omp_for_collapse(), gimple_omp_for_final_ptr(), gimple_omp_for_incr(), gimple_omp_for_index_ptr(), gimple_omp_for_initial_ptr(), gimple_omp_for_pre_body(), gimple_omp_for_pre_body_ptr(), gimple_omp_for_set_pre_body(), gimple_seq_add_seq(), gimple_seq_empty_p(), gsi_last(), gsi_seq(), i, walk_stmt_info::info, NULL, TREE_OPERAND, walk_body(), and walk_tree.
Referenced by convert_local_reference_stmt(), and convert_nonlocal_reference_stmt().
|
static |
Build or return the type used to represent a nested function descriptor.
Referenced by get_descriptor_type().
|
static |
Nested function decomposition for GIMPLE. Copyright (C) 2004-2024 Free Software Foundation, Inc. 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/>.
Summary of nested functions.
Referenced by nested_function_info::get(), nested_function_info::get_create(), nested_function_info::release(), and unnest_function().
|
static |
Obstack used for the bitmaps in the struct above.
Referenced by create_nesting_tree(), and lower_nested_functions().
|
static |
Build or return the type used to represent a nested function trampoline.
Referenced by get_trampoline_type().