|
GCC Middle and Back End API Reference
|
#include "config.h"#include "system.h"#include "coretypes.h"#include "backend.h"#include "rtl.h"#include "tree.h"#include "gimple.h"#include "alloc-pool.h"#include "tree-pass.h"#include "ssa.h"#include "cgraph.h"#include "diagnostic-core.h"#include "fold-const.h"#include "stor-layout.h"#include "stmt.h"#include "gimple-iterator.h"#include "tree-into-ssa.h"#include "tree-dfa.h"#include "gimple-walk.h"#include "varasm.h"#include "stringpool.h"#include "attribs.h"#include "tree-ssa.h"#include "tree-cfg.h"#include "gimple-range.h"#include "ipa-modref-tree.h"#include "ipa-modref.h"#include "attr-fnspec.h"#include "tree-ssa-structalias.h"#include "gimple-ssa-pta-constraints.h"
Data Structures | |
| struct | fieldoff |
Namespaces | |
| namespace | pointer_analysis |
Typedefs | |
| typedef struct fieldoff | fieldoff_s |
Variables | |
| static hash_map< tree, varinfo_t > * | vi_for_tree |
| static hash_map< gimple *, varinfo_t > * | call_stmt_vars |
| static object_allocator< constraint > | constraint_pool ("Constraint pool") |
| struct obstack | fake_var_decl_obstack |
| typedef struct fieldoff fieldoff_s |
|
static |
Return a printable name for DECL.
References alias_get_name(), DECL_ASSEMBLER_NAME_RAW, DECL_ASSEMBLER_NAME_SET_P, DECL_P, DECL_UID, dump_file, free(), get_name(), ggc_strdup, HAS_DECL_ASSEMBLER_NAME_P, IDENTIFIER_POINTER, NULL, SSA_NAME_VERSION, and TREE_CODE.
Referenced by alias_get_name(), get_vi_for_tree(), intra_create_variable_infos(), and ipa_create_function_infos().
|
static |
Associate node with varinfo DATA. Worker for cgraph_for_symbol_thunks_and_aliases.
References associate_varinfo_to_alias(), and insert_vi_for_tree().
Referenced by associate_varinfo_to_alias(), and ipa_create_function_infos().
|
static |
Return the position, in bits, of FIELD_DECL from the beginning of its structure.
References bitpos_of_field(), DECL_FIELD_BIT_OFFSET, DECL_FIELD_OFFSET, tree_fits_uhwi_p(), and tree_to_uhwi().
Referenced by bitpos_of_field(), and push_fields_onto_fieldstack().
Build a fake VAR_DECL acting as referrer to a DECL_UID.
References allocate_decl_uid(), build_fake_var_decl(), DECL_UID, fake_var_decl_obstack, layout_decl(), SET_DECL_PT_UID, TREE_SET_CODE, and TREE_TYPE.
Referenced by build_fake_var_decl(), create_function_info_for(), create_variable_info_for_1(), and make_heapvar().
|
static |
Return true if FIELDSTACK contains fields that overlap. FIELDSTACK is assumed to be sorted by offset.
References check_for_overlaps(), FOR_EACH_VEC_ELT, i, NULL, and fieldoff::offset.
Referenced by check_for_overlaps(), and create_variable_info_for_1().
Count the number of arguments DECL has, and set IS_VARARGS to true if it is a varargs function.
References count_num_arguments(), DECL_ARGUMENTS, DECL_CHAIN, TREE_CHAIN, TREE_TYPE, TREE_VALUE, TYPE_ARG_TYPES, and void_type_node.
Referenced by count_num_arguments(), and create_function_info_for().
|
static |
Creation function node for DECL, using NAME, and return the index of the variable we've created for the function. If NONLOCAL_p, create initial constraints.
References build_fake_var_decl(), count_num_arguments(), create_function_info_for(), pointer_analysis::variable_info::decl, DECL_ARGUMENTS, DECL_BY_REFERENCE, DECL_CHAIN, DECL_NAME, DECL_RESULT, DECL_STRUCT_FUNCTION, pointer_analysis::escaped_id, pointer_analysis::fi_clobbers, pointer_analysis::fi_parm_base, pointer_analysis::fi_result, pointer_analysis::fi_static_chain, pointer_analysis::fi_uses, pointer_analysis::first_vi_for_offset(), free(), pointer_analysis::variable_info::fullsize, gcc_assert, pointer_analysis::get_varinfo(), ggc_strdup, i, pointer_analysis::variable_info::id, insert_vi_for_tree(), pointer_analysis::variable_info::is_fn_info, pointer_analysis::variable_info::is_full_var, pointer_analysis::variable_info::is_global_var, pointer_analysis::variable_info::is_heap_var, pointer_analysis::variable_info::is_reg_var, pointer_analysis::lookup_vi_for_tree(), MAIN_NAME_P, make_constraint_from(), make_copy_constraint(), pointer_analysis::variable_info::may_have_pointers, pointer_analysis::new_var_info(), pointer_analysis::variable_info::next, pointer_analysis::nonlocal_id, NULL, NULL_TREE, pointer_analysis::variable_info::offset, ptr_type_node, pointer_analysis::variable_info::size, function::static_chain_decl, TREE_TYPE, and VOID_TYPE_P.
Referenced by create_function_info_for(), and ipa_create_function_infos().
References varpool_node::all_refs_explicit_p(), create_variable_info_for(), create_variable_info_for_1(), DECL_HARD_REGISTER, DECL_INITIAL, pointer_analysis::escaped_id, pointer_analysis::fi_result, FOR_EACH_VEC_ELT, cgraph_node::get(), varpool_node::get(), get_constraint_for(), get_function_part_constraint(), get_vi_for_tree(), i, pointer_analysis::variable_info::id, pointer_analysis::in_ipa_mode, insert_vi_for_tree(), pointer_analysis::variable_info::is_global_var, pointer_analysis::variable_info::is_reg_var, pointer_analysis::variable_info::is_restrict_var, make_constraint_from_global_restrict(), make_copy_constraint(), pointer_analysis::variable_info::may_have_pointers, new_constraint(), pointer_analysis::new_var_info(), pointer_analysis::nonlocal_id, NULL, NULL_TREE, pointer_analysis::variable_info::only_restrict_pointers, POINTER_TYPE_P, process_constraint(), SCALAR, TREE_CODE, TREE_TYPE, TYPE_RESTRICT, VAR_P, and pointer_analysis::vi_next().
Referenced by create_variable_info_for(), and get_vi_for_tree().
|
static |
Create a varinfo structure for NAME and DECL, and add it to VARMAP. This will also create any varinfo structures necessary for fields of DECL. DECL is a function parameter if HANDLE_PARAM is set. HANDLED_STRUCT_TYPE is used to register struct types reached by following restrict pointers. This is needed to prevent infinite recursion. If ADD_RESTRICT, pretend that the pointer NAME is restrict even if DECL does not advertise it.
References bitmap_bit_p, bitmap_clear_bit(), bitmap_set_bit, build_fake_var_decl(), check_for_overlaps(), create_variable_info_for_1(), DECL_EXTERNAL, DECL_P, DECL_SIZE, dump_file, free(), pointer_analysis::variable_info::fullsize, ggc_strdup, fieldoff::has_unknown_size, pointer_analysis::variable_info::head, HOST_WIDE_INT_PRINT_DEC, i, pointer_analysis::variable_info::id, pointer_analysis::in_ipa_mode, insert_vi_for_tree(), pointer_analysis::variable_info::is_full_var, is_global_var(), pointer_analysis::variable_info::is_restrict_var, pointer_analysis::variable_info::is_unknown_size_var, make_constraint_from(), make_param_constraints(), fieldoff::may_have_pointers, pointer_analysis::variable_info::may_have_pointers, pointer_analysis::variable_info::name, pointer_analysis::new_var_info(), pointer_analysis::variable_info::next, NULL, fieldoff::offset, pointer_analysis::variable_info::offset, fieldoff::only_restrict_pointers, pointer_analysis::variable_info::only_restrict_pointers, POINTER_TYPE_P, push_fields_onto_fieldstack(), fieldoff::restrict_pointed_type, fieldoff::size, pointer_analysis::variable_info::size, sort_fieldstack(), tree_fits_uhwi_p(), tree_to_uhwi(), TREE_TYPE, type_contains_placeholder_p(), TYPE_RESTRICT, TYPE_SIZE, TYPE_UID, pointer_analysis::use_field_sensitive, var_can_have_subvars(), and pointer_analysis::vi_next().
Referenced by create_variable_info_for(), create_variable_info_for_1(), and intra_create_variable_infos().
Dereference the constraint expression CONS, and return the result. DEREF (ADDRESSOF) = SCALAR DEREF (SCALAR) = DEREF DEREF (DEREF) = (temp = DEREF1; result = DEREF (temp)) This is needed so that we can handle dereferencing DEREF constraints.
References pointer_analysis::ADDRESSOF, pointer_analysis::constraints, pointer_analysis::DEREF, do_deref(), FOR_EACH_VEC_ELT, gcc_unreachable, i, new_constraint(), new_scalar_tmp_constraint_exp(), process_constraint(), SCALAR, and pointer_analysis::constraint_expr::var.
Referenced by do_deref(), find_func_aliases_for_builtin_call(), find_func_aliases_for_call(), get_constraint_for_1(), and get_constraint_for_component_ref().
Handle aggregate copies by expanding into copies of the respective fields of the structures.
References pointer_analysis::ADDRESSOF, pointer_analysis::anything_id, pointer_analysis::DEREF, do_structure_copy(), gcc_assert, gcc_unreachable, get_constraint_for(), get_constraint_for_rhs(), get_ref_base_and_extent_hwi(), pointer_analysis::get_varinfo(), pointer_analysis::variable_info::is_full_var, pointer_analysis::variable_info::may_have_pointers, new_constraint(), pointer_analysis::constraint_expr::offset, pointer_analysis::variable_info::offset, process_all_all_constraints(), process_constraint(), ranges_overlap_p(), SCALAR, pointer_analysis::variable_info::size, pointer_analysis::constraint_expr::type, UNKNOWN_OFFSET, and pointer_analysis::constraint_expr::var.
Referenced by do_structure_copy(), and find_func_aliases().
References field_must_have_pointers(), TREE_TYPE, and type_must_have_pointers().
Referenced by field_must_have_pointers(), and push_fields_onto_fieldstack().
|
static |
qsort comparison function for two fieldoff's PA and PB.
References fieldoff_compare(), fieldoff::offset, and fieldoff::size.
Referenced by fieldoff_compare(), and sort_fieldstack().
Walk statement T setting up aliasing constraints according to the references found in T. This function is the main part of the constraint builder. AI points to auxiliary alias information used when building alias sets and computing alias grouping heuristics.
References AGGREGATE_TYPE_P, as_a(), CONVERT_EXPR_CODE_P, function::decl, DECL_P, do_structure_copy(), dyn_cast(), pointer_analysis::escaped_id, pointer_analysis::escaped_return_id, pointer_analysis::fi_result, find_func_aliases(), find_func_aliases_for_call(), FOR_EACH_VEC_ELT, get_base_address(), get_constraint_for(), get_constraint_for_address_of(), get_constraint_for_ptr_offset(), get_constraint_for_rhs(), get_function_part_constraint(), get_vi_for_tree(), gimple_asm_input_op(), gimple_asm_ninputs(), gimple_asm_noutputs(), gimple_asm_output_op(), gimple_assign_lhs(), gimple_assign_rhs1(), gimple_assign_rhs2(), gimple_assign_rhs3(), gimple_assign_rhs_code(), gimple_assign_single_p(), gimple_num_ops(), gimple_op(), gimple_phi_arg_def(), gimple_phi_num_args(), gimple_phi_result(), gimple_return_retval(), i, pointer_analysis::in_ipa_mode, is_gimple_assign(), is_gimple_call(), pointer_analysis::variable_info::is_global_var, pointer_analysis::variable_info::is_ipa_escape_point, pointer_analysis::lookup_vi_for_tree(), make_constraint_to(), make_constraints_to(), make_escape_constraint(), new_constraint(), pointer_analysis::nonlocal_id, NULL, NULL_TREE, pointer_analysis::constraint_expr::offset, parse_input_constraint(), parse_output_constraint(), process_all_all_constraints(), process_constraint(), SCALAR, TREE_CLOBBER_P, TREE_CODE, TREE_PURPOSE, TREE_STRING_POINTER, TREE_TYPE, TREE_VALUE, truth_value_p(), pointer_analysis::constraint_expr::type, and pointer_analysis::constraint_expr::var.
Referenced by find_func_aliases(), pointer_analysis::intra_build_constraints(), and pointer_analysis::ipa_build_constraints().
Create constraints for the builtin call T. Return true if the call was handled, otherwise false.
References pointer_analysis::ADDRESSOF, pointer_analysis::anything_id, BUILT_IN_NORMAL, CASE_BUILT_IN_TM_LOAD, CASE_BUILT_IN_TM_STORE, function::decl, pointer_analysis::variable_info::decl, DECL_EXTERNAL, DECL_FUNCTION_CODE(), do_deref(), ERF_NOALIAS, pointer_analysis::escaped_id, pointer_analysis::fi_result, pointer_analysis::fi_static_chain, find_func_aliases_for_builtin_call(), find_func_aliases_for_call_arg(), pointer_analysis::fndecl_maybe_in_other_partition(), FOR_EACH_VEC_ELT, gcc_assert, gcc_unreachable, get_call_clobber_vi(), get_call_use_vi(), get_constraint_for(), get_constraint_for_ptr_offset(), get_function_part_constraint(), pointer_analysis::get_varinfo(), get_vi_for_tree(), gimple_call_arg(), gimple_call_builtin_p(), gimple_call_fndecl(), gimple_call_lhs(), gimple_call_return_flags(), handle_lhs_call(), i, pointer_analysis::variable_info::id, pointer_analysis::in_ipa_mode, pointer_analysis::integer_id, integer_zerop(), pointer_analysis::variable_info::is_global_var, pointer_analysis::variable_info::is_heap_var, pointer_analysis::lookup_vi_for_tree(), make_any_offset_constraints(), make_constraint_from(), make_constraint_to(), make_heapvar(), new_constraint(), pointer_analysis::nonlocal_id, pointer_analysis::nothing_id, NULL, NULL_TREE, pointer_analysis::constraint_expr::offset, process_all_all_constraints(), process_constraint(), SCALAR, TREE_CODE, TREE_OPERAND, pointer_analysis::constraint_expr::type, and pointer_analysis::constraint_expr::var.
Referenced by find_func_aliases_for_builtin_call(), and find_func_aliases_for_call().
Create constraints for the call T.
References aggregate_value_p(), pointer_analysis::variable_info::decl, DECL_IS_OPERATOR_DELETE_P, DECL_IS_REPLACEABLE_OPERATOR, do_deref(), ECF_CONST, ECF_LOOPING_CONST_OR_PURE, ECF_NOVOPS, ECF_PURE, pointer_analysis::fi_result, pointer_analysis::fi_static_chain, find_func_aliases_for_builtin_call(), find_func_aliases_for_call(), find_func_aliases_for_call_arg(), fndecl_built_in_p(), FOR_EACH_VEC_ELT, gcc_checking_assert, get_call_clobber_vi(), get_call_use_vi(), get_constraint_for(), get_constraint_for_address_of(), get_constraint_for_rhs(), pointer_analysis::get_fi_for_callee(), get_function_part_constraint(), gimple_call_arg(), gimple_call_chain(), gimple_call_flags(), gimple_call_fndecl(), gimple_call_fntype(), gimple_call_from_new_or_delete(), gimple_call_internal_p(), gimple_call_lhs(), gimple_call_num_args(), gimple_call_return_flags(), handle_lhs_call(), handle_rhs_call(), pointer_analysis::in_ipa_mode, pointer_analysis::variable_info::is_fn_info, make_constraint_to(), new_constraint(), NULL_TREE, process_all_all_constraints(), and process_constraint().
Referenced by find_func_aliases(), and find_func_aliases_for_call().
Create constraints for assigning call argument ARG to the incoming parameter INDEX of function FI.
References pointer_analysis::fi_parm_base, find_func_aliases_for_call_arg(), FOR_EACH_VEC_ELT, get_constraint_for_rhs(), get_function_part_constraint(), new_constraint(), and process_constraint().
Referenced by find_func_aliases_for_builtin_call(), find_func_aliases_for_call(), and find_func_aliases_for_call_arg().
Walk statement T setting up clobber and use constraints according to the references found in T. This function is a main part of the IPA constraint builder.
References pointer_analysis::anything_id, as_a(), auto_var_in_fn_p(), BUILT_IN_NORMAL, function::decl, pointer_analysis::variable_info::decl, DECL_FUNCTION_CODE(), DECL_P, dyn_cast(), pointer_analysis::escaped_id, pointer_analysis::fi_clobbers, pointer_analysis::fi_uses, find_func_clobbers(), pointer_analysis::first_vi_for_offset(), pointer_analysis::fndecl_maybe_in_other_partition(), FOR_EACH_VEC_ELT, gcc_assert, gcc_unreachable, get_constraint_for(), get_constraint_for_address_of(), get_constraint_for_ptr_offset(), pointer_analysis::get_fi_for_callee(), get_function_part_constraint(), get_vi_for_tree(), gimple_assign_rhs1(), gimple_assign_single_p(), gimple_call_arg(), gimple_call_builtin_p(), gimple_call_fndecl(), gimple_call_num_args(), gimple_get_lhs(), gimple_has_lhs(), gimple_return_retval(), gimple_vdef(), gimple_vuse(), handled_component_p(), i, pointer_analysis::variable_info::id, pointer_analysis::in_ipa_mode, INDIRECT_REF_P, pointer_analysis::variable_info::is_fn_info, is_gimple_min_invariant(), pointer_analysis::lookup_call_clobber_vi(), pointer_analysis::lookup_call_use_vi(), pointer_analysis::lookup_vi_for_tree(), make_constraint_from(), make_copy_constraint(), new_constraint(), NULL, NULL_TREE, process_constraint(), process_ipa_clobber(), TREE_CODE, and TREE_OPERAND.
Referenced by find_func_clobbers(), and pointer_analysis::ipa_build_constraints().
Lookup or create the variable for the call statement CALL representing the clobbers.
References get_call_clobber_vi(), get_call_vi(), and pointer_analysis::vi_next().
Referenced by find_func_aliases_for_builtin_call(), find_func_aliases_for_call(), get_call_clobber_vi(), and handle_call_arg().
Lookup or create the variable for the call statement CALL representing the uses.
References get_call_use_vi(), and get_call_vi().
Referenced by find_func_aliases_for_builtin_call(), find_func_aliases_for_call(), get_call_use_vi(), handle_call_arg(), and handle_rhs_call().
Lookup or create the variable for the call statement CALL.
References call_stmt_vars, pointer_analysis::variable_info::fullsize, get_call_vi(), pointer_analysis::variable_info::id, pointer_analysis::variable_info::is_full_var, pointer_analysis::variable_info::is_reg_var, pointer_analysis::new_var_info(), pointer_analysis::variable_info::next, NULL_TREE, pointer_analysis::variable_info::offset, and pointer_analysis::variable_info::size.
Referenced by get_call_clobber_vi(), get_call_use_vi(), and get_call_vi().
Given a gimple tree T, return the constraint expression vector for it.
References gcc_assert, get_constraint_for(), and get_constraint_for_1().
Referenced by create_variable_info_for(), do_structure_copy(), find_func_aliases(), find_func_aliases_for_builtin_call(), find_func_aliases_for_call(), find_func_clobbers(), get_constraint_for(), and handle_lhs_call().
Given a tree T, return the constraint expression for it.
References address_p(), pointer_analysis::ADDRESSOF, pointer_analysis::anything_id, CONSTRUCTOR_ELTS, CONSTRUCTOR_NELTS, pointer_analysis::DEREF, do_deref(), FOR_EACH_CONSTRUCTOR_VALUE, FOR_EACH_VEC_ELT, get_constraint_for_1(), get_constraint_for_address_of(), get_constraint_for_component_ref(), get_constraint_for_ptr_offset(), get_constraint_for_ssa_var(), pointer_analysis::get_varinfo(), i, integer_zerop(), pointer_analysis::nonlocal_id, pointer_analysis::nothing_id, pointer_analysis::constraint_expr::offset, SCALAR, pointer_analysis::string_id, tcc_constant, tcc_declaration, tcc_exceptional, tcc_expression, tcc_reference, TREE_CODE, TREE_CODE_CLASS, tree_fits_uhwi_p(), TREE_OPERAND, TREE_THIS_VOLATILE, tree_to_uhwi(), TREE_TYPE, pointer_analysis::constraint_expr::type, type_can_have_subvars(), TYPE_SIZE, UNKNOWN_OFFSET, pointer_analysis::constraint_expr::var, VAR_P, and pointer_analysis::vi_next().
Referenced by get_constraint_for(), get_constraint_for_1(), get_constraint_for_address_of(), get_constraint_for_component_ref(), and get_constraint_for_rhs().
Given a tree T, return the constraint expression for taking the address of it.
References pointer_analysis::ADDRESSOF, pointer_analysis::DEREF, FOR_EACH_VEC_ELT, get_constraint_for_1(), get_constraint_for_address_of(), i, and SCALAR.
Referenced by find_func_aliases(), find_func_aliases_for_call(), find_func_clobbers(), get_constraint_for_1(), get_constraint_for_address_of(), and handle_rhs_call().
|
static |
Given a COMPONENT_REF T, return the constraint_expr vector for it. If address_p is true the result will be taken its address of. If lhs_p is true then the constraint expression is assumed to be used as the lhs.
References address_p(), pointer_analysis::ADDRESSOF, AGGREGATE_TYPE_P, pointer_analysis::anything_id, CONSTANT_CLASS_P, pointer_analysis::DEREF, do_deref(), dump_file, dump_flags, pointer_analysis::variable_info::fullsize, gcc_assert, gcc_unreachable, get_constraint_for_1(), get_constraint_for_component_ref(), get_ref_base_and_extent(), pointer_analysis::get_varinfo(), handled_component_p(), pointer_analysis::variable_info::id, INDIRECT_REF_P, pointer_analysis::integer_id, integer_zerop(), poly_int< N, C >::is_constant(), pointer_analysis::variable_info::is_full_var, known_eq, mem_ref_offset(), pointer_analysis::variable_info::next, pointer_analysis::nothing_id, pointer_analysis::constraint_expr::offset, pointer_analysis::variable_info::offset, SCALAR, pointer_analysis::variable_info::size, TDF_DETAILS, poly_int< N, C >::to_shwi(), TREE_CODE, TREE_OPERAND, TREE_TYPE, pointer_analysis::constraint_expr::type, UNKNOWN_OFFSET, pointer_analysis::constraint_expr::var, and pointer_analysis::vi_next().
Referenced by get_constraint_for_1(), and get_constraint_for_component_ref().
Get constraint expressions for offsetting PTR by OFFSET. Stores the resulting constraint expressions in *RESULTS.
References pointer_analysis::ADDRESSOF, pointer_analysis::first_or_preceding_vi_for_offset(), wi::fits_shwi_p(), gcc_assert, gcc_unreachable, get_constraint_for_ptr_offset(), get_constraint_for_rhs(), pointer_analysis::get_varinfo(), pointer_analysis::variable_info::head, pointer_analysis::variable_info::id, pointer_analysis::variable_info::is_full_var, NULL_TREE, pointer_analysis::constraint_expr::offset, pointer_analysis::variable_info::offset, SCALAR, SIGNED, pointer_analysis::variable_info::size, wi::to_wide(), TREE_CODE, pointer_analysis::constraint_expr::type, UNKNOWN_OFFSET, pointer_analysis::use_field_sensitive, pointer_analysis::constraint_expr::var, and pointer_analysis::vi_next().
Referenced by find_func_aliases(), find_func_aliases_for_builtin_call(), find_func_clobbers(), get_constraint_for_1(), and get_constraint_for_ptr_offset().
Given a gimple tree T, return the constraint expression vector for it to be used as the rhs of a constraint.
References gcc_assert, get_constraint_for_1(), and get_constraint_for_rhs().
Referenced by do_structure_copy(), find_func_aliases(), find_func_aliases_for_call(), find_func_aliases_for_call_arg(), get_constraint_for_ptr_offset(), get_constraint_for_rhs(), make_constraint_to(), and process_ipa_clobber().
Get a constraint expression vector from an SSA_VAR_P node. If address_p is true, the result will be taken its address of.
References address_p(), DECL_EXTERNAL, DECL_P, DECL_PT_UID, DECL_PT_UID_SET_P, DECL_UID, gcc_assert, varpool_node::get(), get_constraint_for_ssa_var(), get_vi_for_tree(), pointer_analysis::nothing_id, pointer_analysis::constraint_expr::offset, SCALAR, ssa_defined_default_def_p(), SSA_NAME_IS_DEFAULT_DEF, SSA_NAME_VAR, TREE_CODE, TREE_STATIC, pointer_analysis::constraint_expr::type, pointer_analysis::constraint_expr::var, VAR_P, and pointer_analysis::vi_next().
Referenced by get_constraint_for_1(), and get_constraint_for_ssa_var().
|
static |
Get a constraint for the requested part of a function designator FI when operating in IPA mode.
References pointer_analysis::anything_id, pointer_analysis::DEREF, pointer_analysis::first_vi_for_offset(), gcc_assert, get_function_part_constraint(), pointer_analysis::variable_info::id, pointer_analysis::in_ipa_mode, SCALAR, and TREE_CODE.
Referenced by create_variable_info_for(), find_func_aliases(), find_func_aliases_for_builtin_call(), find_func_aliases_for_call(), find_func_aliases_for_call_arg(), find_func_clobbers(), get_function_part_constraint(), and process_ipa_clobber().
Find the variable id for tree T in the map. If T doesn't exist in the map, create an entry for it and return it.
References alias_get_name(), create_variable_info_for(), pointer_analysis::get_varinfo(), get_vi_for_tree(), NULL, and vi_for_tree.
Referenced by create_variable_info_for(), find_func_aliases(), find_func_aliases_for_builtin_call(), find_func_clobbers(), get_constraint_for_ssa_var(), pointer_analysis::get_fi_for_callee(), get_vi_for_tree(), intra_create_variable_infos(), and ipa_create_global_variable_infos().
|
static |
Produce constraints for argument ARG of call STMT with eaf flags FLAGS. RESULTS is array holding constraints for return value. CALLESCAPE_ID is variable where call loocal escapes are added. WRITES_GLOVEL_MEMORY is true if callee may write global memory.
References pointer_analysis::DEREF, EAF_NO_DIRECT_CLOBBER, EAF_NO_DIRECT_ESCAPE, EAF_NO_DIRECT_READ, EAF_NO_INDIRECT_CLOBBER, EAF_NO_INDIRECT_ESCAPE, EAF_NO_INDIRECT_READ, EAF_NOT_RETURNED_DIRECTLY, EAF_NOT_RETURNED_INDIRECTLY, EAF_UNUSED, gcc_checking_assert, get_call_clobber_vi(), get_call_use_vi(), gimple_call_lhs(), handle_call_arg(), pointer_analysis::variable_info::id, pointer_analysis::variable_info::is_reg_var, make_any_offset_constraints(), make_constraint_to(), make_copy_constraint(), make_escape_constraint(), make_indirect_escape_constraint(), make_transitive_closure_constraints(), new_constraint(), pointer_analysis::new_var_info(), NULL, NULL_TREE, pointer_analysis::constraint_expr::offset, process_constraint(), SCALAR, pointer_analysis::constraint_expr::type, UNKNOWN_OFFSET, and pointer_analysis::constraint_expr::var.
Referenced by handle_call_arg(), and handle_rhs_call().
For non-IPA mode, generate constraints necessary for a call that returns a pointer and assigns it to LHS. This simply makes the LHS point to global and escaped variables.
References pointer_analysis::ADDRESSOF, BUILT_IN_NORMAL, pointer_analysis::variable_info::decl, DECL_EXTERNAL, DECL_P, ERF_NOALIAS, ERF_RETURN_ARG_MASK, ERF_RETURNS_ARG, pointer_analysis::escaped_id, fndecl_built_in_p(), get_base_address(), get_constraint_for(), gimple_call_arg(), gimple_call_num_args(), handle_lhs_call(), pointer_analysis::variable_info::id, is_global_var(), pointer_analysis::variable_info::is_global_var, make_constraint_from(), make_heapvar(), pointer_analysis::nonlocal_id, pointer_analysis::constraint_expr::offset, process_all_all_constraints(), SCALAR, pointer_analysis::constraint_expr::type, and pointer_analysis::constraint_expr::var.
Referenced by find_func_aliases_for_builtin_call(), find_func_aliases_for_call(), and handle_lhs_call().
|
static |
For non-IPA mode or for a function with body not available. Generate constraints necessary for a call on the RHS and collect return value constraint to RESULTS to be used later in handle_lhs_call. IMPLICIT_EAF_FLAGS are added to each function argument. If WRITES_GLOBAL_MEMORY is true function is assumed to possibly write to global memory. Similar for READS_GLOBAL_MEMORY.
References pointer_analysis::ADDRESSOF, pointer_analysis::determine_global_memory_access(), EAF_NO_DIRECT_ESCAPE, EAF_NOT_RETURNED_DIRECTLY, EAF_UNUSED, pointer_analysis::escaped_id, FOR_EACH_VEC_ELT, get_call_use_vi(), get_constraint_for_address_of(), gimple_call_arg(), gimple_call_arg_flags(), gimple_call_chain(), gimple_call_lhs(), gimple_call_num_args(), gimple_call_retslot_flags(), gimple_call_return_slot_opt_p(), gimple_call_static_chain_flags(), handle_call_arg(), handle_rhs_call(), i, pointer_analysis::variable_info::id, make_constraints_to(), make_copy_constraint(), new_constraint(), pointer_analysis::new_var_info(), pointer_analysis::nonlocal_id, NULL, NULL_TREE, process_constraint(), SCALAR, TREE_ADDRESSABLE, and TREE_TYPE.
Referenced by find_func_aliases_for_call(), and handle_rhs_call().
|
static |
Initialize the always-existing constraint variables for NULL ANYTHING, READONLY, and INTEGER.
References pointer_analysis::ADDRESSOF, pointer_analysis::anything_id, pointer_analysis::constraints, pointer_analysis::DEREF, pointer_analysis::escaped_id, pointer_analysis::escaped_return_id, pointer_analysis::variable_info::fullsize, gcc_assert, pointer_analysis::variable_info::id, init_base_vars(), pointer_analysis::integer_id, pointer_analysis::variable_info::is_artificial_var, pointer_analysis::variable_info::is_global_var, pointer_analysis::variable_info::is_special_var, pointer_analysis::variable_info::may_have_pointers, new_constraint(), pointer_analysis::new_var_info(), pointer_analysis::nonlocal_id, pointer_analysis::nothing_id, NULL, NULL_TREE, pointer_analysis::variable_info::offset, process_constraint(), SCALAR, pointer_analysis::variable_info::size, pointer_analysis::storedanything_id, pointer_analysis::string_id, UNKNOWN_OFFSET, and pointer_analysis::varmap.
Referenced by init_base_vars(), and pointer_analysis::init_constraint_builder().
Insert ID as the variable id for tree T in the vi_for_tree map.
References gcc_assert, insert_vi_for_tree(), and vi_for_tree.
Referenced by associate_varinfo_to_alias(), create_function_info_for(), create_variable_info_for(), create_variable_info_for_1(), insert_vi_for_tree(), intra_create_variable_infos(), and make_heapvar().
|
static |
Create varinfo structures for parameters, return value and the static chain of FN. Intended for intraprocedural mode.
References alias_get_name(), BITMAP_ALLOC, BITMAP_FREE, create_variable_info_for_1(), function::decl, DECL_ARGUMENTS, DECL_BY_REFERENCE, DECL_CHAIN, DECL_CXX_CONSTRUCTOR_P, DECL_RESULT, get_vi_for_tree(), insert_vi_for_tree(), intra_create_variable_infos(), make_constraint_from(), make_param_constraints(), pointer_analysis::nonlocal_id, NULL, NULL_TREE, function::static_chain_decl, and pointer_analysis::vi_next().
Referenced by pointer_analysis::intra_build_constraints(), and intra_create_variable_infos().
|
static |
Create function infos.
References alias_get_name(), associate_varinfo_to_alias(), pointer_analysis::constraints, create_function_info_for(), DECL_ASSEMBLER_NAME, DECL_ASSEMBLER_NAME_SET_P, DECL_ATTRIBUTES, DECL_EXTERNAL, pointer_analysis::dump_constraints(), dump_file, dump_flags, FOR_EACH_DEFINED_FUNCTION, gcc_assert, IDENTIFIER_POINTER, ipa_create_function_infos(), lookup_attribute(), refered_from_nonlocal_fn(), TDF_DETAILS, and TREE_PUBLIC.
Referenced by pointer_analysis::ipa_build_constraints(), and ipa_create_function_infos().
|
static |
Create constraints for global variables and their initializers.
References symtab_node::alias, symtab_node::analyzed, varpool_node::call_for_symbol_and_aliases(), pointer_analysis::constraints, symtab_node::decl, DECL_EXTERNAL, pointer_analysis::dump_constraints(), dump_file, dump_flags, FOR_EACH_VARIABLE, symtab_node::force_output, get_vi_for_tree(), ipa_create_global_variable_infos(), pointer_analysis::variable_info::is_ipa_escape_point, symtab_node::ref_by_asm, refered_from_nonlocal_var(), TDF_DETAILS, TREE_PUBLIC, and symtab_node::used_from_other_partition.
Referenced by pointer_analysis::ipa_build_constraints(), and ipa_create_global_variable_infos().
|
static |
Add constraints to that the solution of VI has all subvariables added.
References pointer_analysis::variable_info::id, make_any_offset_constraints(), new_constraint(), process_constraint(), SCALAR, and UNKNOWN_OFFSET.
Referenced by find_func_aliases_for_builtin_call(), handle_call_arg(), and make_any_offset_constraints().
|
static |
Create a constraint ID = &FROM.
References pointer_analysis::ADDRESSOF, pointer_analysis::variable_info::id, make_constraint_from(), new_constraint(), process_constraint(), and SCALAR.
Referenced by create_function_info_for(), create_variable_info_for_1(), find_func_aliases_for_builtin_call(), find_func_clobbers(), handle_lhs_call(), intra_create_variable_infos(), make_constraint_from(), make_constraint_from_restrict(), and make_param_constraints().
|
static |
Create a new artificial heap variable with NAME and make a constraint from it to LHS. Set flags according to a tag used for tracking restrict pointers and make the artificial heap point to global memory.
References make_constraint_from_global_restrict(), make_constraint_from_restrict(), make_copy_constraint(), and pointer_analysis::nonlocal_id.
Referenced by create_variable_info_for(), and make_constraint_from_global_restrict().
Create a new artificial heap variable with NAME and make a constraint from it to LHS. Set flags according to a tag used for tracking restrict pointers.
References pointer_analysis::variable_info::id, pointer_analysis::variable_info::is_global_var, pointer_analysis::variable_info::is_restrict_var, make_constraint_from(), make_constraint_from_restrict(), make_heapvar(), and pointer_analysis::variable_info::may_have_pointers.
Referenced by make_constraint_from_global_restrict(), and make_constraint_from_restrict().
|
static |
Create a constraint ID = OP.
References get_constraint_for_rhs(), make_constraint_to(), and make_constraints_to().
Referenced by find_func_aliases(), find_func_aliases_for_builtin_call(), find_func_aliases_for_call(), handle_call_arg(), make_constraint_to(), and make_escape_constraint().
Create constraints ID = { rhsc }.
References FOR_EACH_VEC_ELT, make_constraints_to(), new_constraint(), process_constraint(), and SCALAR.
Referenced by find_func_aliases(), handle_rhs_call(), make_constraint_to(), and make_constraints_to().
|
static |
Create a constraint ID = FROM.
References pointer_analysis::variable_info::id, make_copy_constraint(), new_constraint(), process_constraint(), and SCALAR.
Referenced by create_function_info_for(), create_variable_info_for(), find_func_clobbers(), handle_call_arg(), handle_rhs_call(), make_constraint_from_global_restrict(), and make_copy_constraint().
|
static |
Make constraints necessary to make OP escape.
References pointer_analysis::escaped_id, make_constraint_to(), and make_escape_constraint().
Referenced by find_func_aliases(), handle_call_arg(), and make_escape_constraint().
Create a new artificial heap variable with NAME. Return the created variable.
References build_fake_var_decl(), DECL_EXTERNAL, pointer_analysis::variable_info::fullsize, insert_vi_for_tree(), pointer_analysis::variable_info::is_full_var, pointer_analysis::variable_info::is_heap_var, pointer_analysis::variable_info::is_unknown_size_var, make_heapvar(), pointer_analysis::new_var_info(), pointer_analysis::variable_info::offset, ptr_type_node, and pointer_analysis::variable_info::size.
Referenced by find_func_aliases_for_builtin_call(), handle_lhs_call(), make_constraint_from_restrict(), and make_heapvar().
|
static |
Make constraint necessary to make all indirect references from VI escape.
References pointer_analysis::DEREF, pointer_analysis::escaped_id, pointer_analysis::variable_info::id, make_indirect_escape_constraint(), new_constraint(), process_constraint(), SCALAR, and UNKNOWN_OFFSET.
Referenced by handle_call_arg(), and make_indirect_escape_constraint().
|
static |
Register the constraints for function parameter related VI.
References pointer_analysis::variable_info::is_full_var, make_constraint_from(), make_param_constraints(), pointer_analysis::variable_info::may_have_pointers, pointer_analysis::nonlocal_id, pointer_analysis::variable_info::only_restrict_pointers, and pointer_analysis::vi_next().
Referenced by create_variable_info_for_1(), intra_create_variable_infos(), and make_param_constraints().
|
static |
Add constraints to that the solution of VI is transitively closed.
References pointer_analysis::DEREF, pointer_analysis::variable_info::id, make_transitive_closure_constraints(), new_constraint(), process_constraint(), SCALAR, and UNKNOWN_OFFSET.
Referenced by handle_call_arg(), and make_transitive_closure_constraints().
|
static |
Create a new constraint consisting of LHS and RHS expressions.
References constraint_pool, pointer_analysis::constraint::lhs, new_constraint(), and pointer_analysis::constraint::rhs.
Referenced by create_variable_info_for(), do_deref(), do_structure_copy(), find_func_aliases(), find_func_aliases_for_builtin_call(), find_func_aliases_for_call(), find_func_aliases_for_call_arg(), find_func_clobbers(), handle_call_arg(), handle_rhs_call(), init_base_vars(), make_any_offset_constraints(), make_constraint_from(), make_constraints_to(), make_copy_constraint(), make_indirect_escape_constraint(), make_transitive_closure_constraints(), new_constraint(), process_all_all_constraints(), process_constraint(), and process_ipa_clobber().
|
static |
Get a scalar constraint expression for a new temporary variable.
References new_scalar_tmp_constraint_exp(), pointer_analysis::new_var_info(), NULL_TREE, pointer_analysis::constraint_expr::offset, SCALAR, pointer_analysis::constraint_expr::type, and pointer_analysis::constraint_expr::var.
Referenced by do_deref(), new_scalar_tmp_constraint_exp(), process_all_all_constraints(), and process_constraint().
Efficiently generates constraints from all entries in *RHSC to all entries in *LHSC.
References FOR_EACH_VEC_ELT, i, new_constraint(), new_scalar_tmp_constraint_exp(), process_all_all_constraints(), and process_constraint().
Referenced by do_structure_copy(), find_func_aliases(), find_func_aliases_for_builtin_call(), find_func_aliases_for_call(), handle_lhs_call(), and process_all_all_constraints().
|
static |
Process constraint T, performing various simplifications and then adding it to our list of overall constraints.
References pointer_analysis::variable_info::address_taken, pointer_analysis::ADDRESSOF, pointer_analysis::anything_id, pointer_analysis::constraints, pointer_analysis::DEREF, gcc_assert, pointer_analysis::get_varinfo(), pointer_analysis::variable_info::head, pointer_analysis::constraint::lhs, pointer_analysis::variable_info::may_have_pointers, new_constraint(), new_scalar_tmp_constraint_exp(), process_constraint(), pointer_analysis::constraint::rhs, SCALAR, pointer_analysis::constraint_expr::type, and pointer_analysis::varmap.
Referenced by create_variable_info_for(), do_deref(), do_structure_copy(), find_func_aliases(), find_func_aliases_for_builtin_call(), find_func_aliases_for_call(), find_func_aliases_for_call_arg(), find_func_clobbers(), handle_call_arg(), handle_rhs_call(), init_base_vars(), make_any_offset_constraints(), make_constraint_from(), make_constraints_to(), make_copy_constraint(), make_indirect_escape_constraint(), make_transitive_closure_constraints(), process_all_all_constraints(), process_constraint(), and process_ipa_clobber().
Create a constraint adding to the clobber set of FI the memory pointed to by PTR.
References pointer_analysis::fi_clobbers, FOR_EACH_VEC_ELT, get_constraint_for_rhs(), get_function_part_constraint(), i, new_constraint(), process_constraint(), process_ipa_clobber(), and vNULL.
Referenced by find_func_clobbers(), and process_ipa_clobber().
|
static |
Given a TYPE, and a vector of field offsets FIELDSTACK, push all the fields of TYPE onto fieldstack, recording their offsets along the way. OFFSET is used to keep track of the offset in this entire structure, rather than just the immediately containing structure. Returns false if the caller is supposed to handle the field we recursed for.
References bitpos_of_field(), DECL_CHAIN, DECL_SIZE, empty_p(), field_must_have_pointers(), fieldoff::has_unknown_size, integer_zerop(), NULL, NULL_TREE, fieldoff::offset, POINTER_TYPE_P, push_fields_onto_fieldstack(), TREE_CODE, tree_fits_uhwi_p(), tree_to_uhwi(), TREE_TYPE, TYPE_FIELDS, TYPE_RESTRICT, and var_can_have_subvars().
Referenced by create_variable_info_for_1(), and push_fields_onto_fieldstack().
|
static |
Compute whether node is referred to non-locally. Worker for cgraph_for_symbol_thunks_and_aliases.
References DECL_ATTRIBUTES, DECL_EXTERNAL, lookup_attribute(), refered_from_nonlocal_fn(), and TREE_PUBLIC.
Referenced by ipa_create_function_infos(), and refered_from_nonlocal_fn().
|
static |
Same for varpool nodes.
References DECL_EXTERNAL, refered_from_nonlocal_var(), and TREE_PUBLIC.
Referenced by ipa_create_global_variable_infos(), and refered_from_nonlocal_var().
|
static |
Sort a fieldstack according to the field offset and sizes.
References fieldoff_compare(), and sort_fieldstack().
Referenced by create_variable_info_for_1(), and sort_fieldstack().
|
inlinestatic |
Return true if T is a type that can have subvars.
References TREE_CODE, and type_can_have_subvars().
Referenced by get_constraint_for_1(), type_can_have_subvars(), and var_can_have_subvars().
Return true if T is a type that does contain pointers.
References FUNC_OR_METHOD_TYPE_P, POINTER_TYPE_P, TREE_CODE, TREE_TYPE, and type_must_have_pointers().
Referenced by field_must_have_pointers(), and type_must_have_pointers().
|
inlinestatic |
Return true if V is a tree that we can have subvars for. Normally, this is any aggregate type. Also complex types which are not gimple registers can have subvars.
References DECL_P, TREE_THIS_VOLATILE, TREE_TYPE, type_can_have_subvars(), and var_can_have_subvars().
Referenced by create_variable_info_for_1(), push_fields_onto_fieldstack(), and var_can_have_subvars().
A map mapping call statements to per-stmt variables for uses and clobbers specific to the call.
Referenced by pointer_analysis::delete_constraint_builder(), get_call_vi(), pointer_analysis::init_constraint_builder(), and pointer_analysis::lookup_call_use_vi().
|
static |
Allocator for 'constraints' vector.
Referenced by pointer_analysis::delete_constraint_builder(), and new_constraint().
| struct obstack fake_var_decl_obstack |
Temporary storage for fake var decls.
Referenced by build_fake_var_decl(), pointer_analysis::delete_constraint_builder(), and pointer_analysis::init_constraint_builder().
Map from trees to variable infos.
Referenced by pointer_analysis::delete_constraint_builder(), get_vi_for_tree(), pointer_analysis::init_constraint_builder(), insert_vi_for_tree(), and pointer_analysis::lookup_vi_for_tree().