#include "config.h"#include "system.h"#include "coretypes.h"#include "tm.h"#include "tree.h"#include "tree-flow.h"#include "tree-inline.h"#include "tree-pass.h"#include "langhooks.h"#include "pointer-set.h"#include "ggc.h"#include "ipa-utils.h"#include "ipa-type-escape.h"#include "c-common.h"#include "tree-gimple.h"#include "cgraph.h"#include "output.h"#include "flags.h"#include "timevar.h"#include "diagnostic.h"

Go to the source code of this file.
| enum cast_type |
| enum escape_t |
Definition at line 1361 of file ipa-type-escape.c.
References bsi_end_p(), bsi_next(), bsi_start(), bsi_stmt_ptr(), cgraph_node_name(), check_function_parameter_and_return_types(), DECL_INITIAL, DECL_STRUCT_FUNCTION, dump_file, FOR_EACH_BB_FN, fprintf(), function, get_canon_type(), scan_for_refs(), step(), TREE_CHAIN, TREE_CODE, TREE_STATIC, TREE_TYPE, TREE_VALUE, and walk_tree().
Definition at line 1340 of file ipa-type-escape.c.
References DECL_INITIAL, FULL_ESCAPE, gcc_assert, get_canon_type(), mark_interesting_type(), NULL, scan_for_refs(), TREE_CODE, TREE_TYPE, and walk_tree().
Definition at line 1016 of file ipa-type-escape.c.
References AVAIL_NOT_AVAILABLE, AVAIL_OVERWRITABLE, call_expr_flags(), callee, cgraph_function_body_availability(), cgraph_node(), check_cast(), check_rhs_var(), DECL_ARGUMENTS, ECF_MALLOC, EXPOSED_PARAMETER, flags, FULL_ESCAPE, get_callee_fndecl(), get_canon_type(), mark_interesting_type(), NULL, NULL_TREE, TREE_CHAIN, TREE_OPERAND, TREE_TYPE, TREE_VALUE, TYPE_ARG_TYPES, and void_type_node.
Definition at line 654 of file ipa-type-escape.c.
References bitmap_bit_p(), check_cast_type(), CT_DOWN, CT_SIDEWAYS, CT_UP, CT_USELESS, DECL_P, DECL_UID, FULL_ESCAPE, get_canon_type(), ipa_type_escape_star_count_of_interesting_type(), results_of_malloc, and TREE_TYPE.
Referenced by check_call(), look_for_casts(), and scan_for_refs().
Definition at line 636 of file ipa-type-escape.c.
References count_stars(), CT_DOWN, CT_SIDEWAYS, CT_UP, CT_USELESS, and parent_type_p().
Referenced by check_cast().
Definition at line 705 of file ipa-type-escape.c.
References DECL_ARGUMENTS, EXPOSED_PARAMETER, get_canon_type(), mark_interesting_type(), TREE_CHAIN, TREE_TYPE, TREE_VALUE, TYPE_ARG_TYPES, and void_type_node.
Referenced by analyze_function(), and check_operand().
Definition at line 790 of file ipa-type-escape.c.
References check_function_parameter_and_return_types(), has_proper_scope_for_analysis(), and TREE_CODE.
Definition at line 949 of file ipa-type-escape.c.
References check_tree(), and look_for_address_of().
Definition at line 806 of file ipa-type-escape.c.
References check_operand(), check_tree(), handled_component_p(), INDIRECT_REF_P, SSA_VAR_P, TREE_CODE, and TREE_OPERAND.
| static bitmap close_addressof_down | ( | int | uid | ) | [static] |
Definition at line 1626 of file ipa-type-escape.c.
References been_there_done_that, BITMAP_ALLOC, bitmap_bit_p(), BITMAP_FREE, bitmap_ior_into(), bitmap_set_bit(), EXECUTE_IF_SET_IN_BITMAP, global_types_full_escape, i, if(), ipa_obstack, map, NULL, result, splay_tree_lookup(), splay_tree_remove(), and splay_tree_node_s::value.
Referenced by type_escape_execute().
Definition at line 1496 of file ipa-type-escape.c.
References been_there_done_that, bitmap_bit_p(), bitmap_set_bit(), EXPOSED_PARAMETER, field_type(), gcc_assert, get_canon_type(), ipa_type_escape_star_count_of_interesting_type(), mark_interesting_type(), POINTER_TYPE_P, TREE_CHAIN, TREE_CODE, TREE_TYPE, TYPE_FIELDS, and TYPE_UID.
Referenced by type_escape_execute().
Definition at line 1546 of file ipa-type-escape.c.
References been_there_done_that, BINFO_BASE_ITERATE, BINFO_TYPE, bitmap_bit_p(), bitmap_set_bit(), EXECUTE_IF_SET_IN_BITMAP, field_type(), FULL_ESCAPE, get_canon_type(), i, ipa_type_escape_star_count_of_interesting_or_array_type(), splay_tree_lookup(), subtype_map_for_uid(), TREE_CHAIN, TREE_CODE, TREE_TYPE, TYPE_BINFO, TYPE_FIELDS, type_for_uid(), TYPE_UID, and splay_tree_node_s::value.
Referenced by type_escape_execute().
Definition at line 1444 of file ipa-type-escape.c.
References been_there_done_that, BINFO_BASE_ITERATE, BINFO_TYPE, bitmap_bit_p(), bitmap_set_bit(), field_type(), get_canon_type(), i, ipa_type_escape_star_count_of_interesting_or_array_type(), subtype_map_for_uid(), TREE_CHAIN, TREE_CODE, TREE_TYPE, TYPE_BINFO, TYPE_FIELDS, TYPE_MAIN_VARIANT, and TYPE_UID.
Referenced by type_escape_execute().
| static int compare_type_brand | ( | splay_tree_key | sk1, | |
| splay_tree_key | sk2 | |||
| ) | [static] |
Definition at line 178 of file ipa-type-escape.c.
References type_brand_s::name, type_brand_s::seq, and strcmp().
Referenced by ipa_init().
| static int count_stars | ( | tree * | type_ptr | ) | [static] |
Definition at line 609 of file ipa-type-escape.c.
References i, POINTER_TYPE_P, TREE_TYPE, and TYPE_MAIN_VARIANT.
Referenced by check_cast_type().
Definition at line 201 of file ipa-type-escape.c.
References bitmap_set_bit(), free(), get_name_of_type(), global_types_seen, i, if(), type_brand_s::name, result, type_brand_s::seq, splay_tree_insert(), splay_tree_lookup(), TYPE_UID, splay_tree_node_s::value, and XNEW.
Referenced by get_canon_type().
Definition at line 972 of file ipa-type-escape.c.
References alloca, ASM_INPUTS, ASM_OUTPUTS, check_lhs_var(), check_rhs_var(), i, list_length(), parse_input_constraint(), parse_output_constraint(), TREE_CHAIN, TREE_PURPOSE, TREE_STRING_POINTER, and TREE_VALUE.
Definition at line 291 of file ipa-type-escape.c.
References discover_unique_type(), NULL, POINTER_TYPE_P, result, splay_tree_lookup(), TREE_CODE, TREE_TYPE, TYPE_MAIN_VARIANT, type_to_consider(), and splay_tree_node_s::value.
Referenced by analyze_function(), analyze_variable(), check_call(), check_cast(), check_function_parameter_and_return_types(), close_type_exposed_parameter(), close_type_full_escape(), close_type_seen(), get_canon_type_uid(), has_proper_scope_for_analysis(), ipa_type_escape_field_does_not_clobber_p(), look_for_address_of(), look_for_casts(), mark_interesting_addressof(), mark_type(), and scan_for_refs().
Definition at line 318 of file ipa-type-escape.c.
References get_canon_type(), and TYPE_UID.
Referenced by ipa_type_escape_field_does_not_clobber_p(), and ipa_type_escape_type_contained_p().
| static char* get_name_of_type | ( | tree | type | ) | [static] |
Definition at line 142 of file ipa-type-escape.c.
References DECL_NAME, IDENTIFIER_POINTER, TREE_CODE, and TYPE_NAME.
Referenced by discover_unique_type().
Definition at line 745 of file ipa-type-escape.c.
References DECL_ATTRIBUTES, DECL_EXTERNAL, DECL_INITIAL, FULL_ESCAPE, get_canon_type(), is_gimple_min_invariant(), lookup_attribute(), mark_interesting_type(), TREE_PUBLIC, TREE_READONLY, TREE_STATIC, TREE_THIS_VOLATILE, and TREE_TYPE.
Definition at line 1310 of file ipa-type-escape.c.
References BITMAP_ALLOC, bitmap_obstack_initialize(), compare_type_brand(), global_types_exposed_parameter, global_types_full_escape, global_types_seen, initialized, ipa_obstack, pointer_set_create(), results_of_malloc, splay_tree_compare_ints(), splay_tree_compare_pointers(), and splay_tree_new().
Definition at line 401 of file ipa-type-escape.c.
References bitmap_bit_p(), get_canon_type(), get_canon_type_uid(), initialized, ipa_type_escape_type_contained_p(), POINTER_TYPE_P, result, splay_tree_lookup(), TREE_CODE, TREE_TYPE, TYPE_MAIN_VARIANT, TYPE_UID, and splay_tree_node_s::value.
Referenced by may_alias_p(), and nonoverlapping_memrefs_p().
| int ipa_type_escape_star_count_of_interesting_or_array_type | ( | tree | type | ) |
Definition at line 361 of file ipa-type-escape.c.
References count, POINTER_TYPE_P, TREE_CODE, TREE_TYPE, and TYPE_MAIN_VARIANT.
Referenced by close_type_full_escape(), close_type_seen(), and type_escape_execute().
| int ipa_type_escape_star_count_of_interesting_type | ( | tree | type | ) |
Definition at line 332 of file ipa-type-escape.c.
References count, POINTER_TYPE_P, TREE_CODE, TREE_TYPE, and TYPE_MAIN_VARIANT.
Referenced by check_cast(), close_type_exposed_parameter(), mark_interesting_addressof(), mark_interesting_type(), and may_alias_p().
Definition at line 389 of file ipa-type-escape.c.
References bitmap_bit_p(), get_canon_type_uid(), global_types_full_escape, and initialized.
Referenced by ipa_type_escape_field_does_not_clobber_p().
Definition at line 882 of file ipa-type-escape.c.
References DECL_FIELD_CONTEXT, get_base_var(), get_canon_type(), has_proper_scope_for_analysis(), mark_interesting_addressof(), NULL_TREE, TREE_CODE, TREE_OPERAND, TREE_TYPE, and x.
Definition at line 916 of file ipa-type-escape.c.
References base, check_cast(), get_base_address(), get_canon_type(), is_gimple_cast(), TREE_CODE, TREE_OPERAND, and TREE_TYPE.
Referenced by scan_for_refs().
Definition at line 830 of file ipa-type-escape.c.
References BITMAP_ALLOC, gcc_assert, get_canon_type(), ipa_obstack, ipa_type_escape_star_count_of_interesting_type(), result, splay_tree_insert(), splay_tree_lookup(), type_map, TYPE_UID, and splay_tree_node_s::value.
Referenced by look_for_address_of().
Definition at line 503 of file ipa-type-escape.c.
References EXPOSED_PARAMETER, FULL_ESCAPE, ipa_type_escape_star_count_of_interesting_type(), and POINTER_TYPE_P.
Referenced by analyze_variable(), check_call(), check_function_parameter_and_return_types(), close_type_exposed_parameter(), has_proper_scope_for_analysis(), and scan_for_refs().
Definition at line 463 of file ipa-type-escape.c.
References bitmap_bit_p(), bitmap_set_bit(), EXPOSED_PARAMETER, FULL_ESCAPE, get_canon_type(), global_types_exposed_parameter, global_types_full_escape, map, NULL, and TYPE_UID.
Definition at line 1144 of file ipa-type-escape.c.
References operand_equal_p(), POINTER_TYPE_P, size_in_bytes(), TREE_TYPE, and TYPE_MAIN_VARIANT.
Referenced by scan_for_refs().
Definition at line 523 of file ipa-type-escape.c.
References BINFO_BASE_ITERATE, BINFO_TYPE, field_type(), i, TREE_CHAIN, TREE_CODE, TREE_TYPE, TYPE_BINFO, and TYPE_FIELDS.
Referenced by check_cast_type().
Definition at line 1174 of file ipa-type-escape.c.
References bitmap_set_bit(), cgraph_node(), check_call(), check_cast(), check_lhs_var(), check_rhs_var(), DECL_INITIAL, DECL_UID, FULL_ESCAPE, get_asm_expr_operands(), get_canon_type(), look_for_casts(), mark_interesting_type(), NULL, okay_pointer_operation(), POINTER_TYPE_P, results_of_malloc, tcc_binary, tcc_declaration, tcc_expression, tcc_reference, tcc_unary, TREE_CODE, TREE_CODE_CLASS, TREE_OPERAND, TREE_TYPE, and walk_tree().
Referenced by analyze_function(), and analyze_variable().
Definition at line 1420 of file ipa-type-escape.c.
References BITMAP_ALLOC, ipa_obstack, NULL, result, splay_tree_insert(), splay_tree_lookup(), and splay_tree_node_s::value.
Referenced by close_type_full_escape(), and close_type_seen().
| static unsigned int type_escape_execute | ( | void | ) | [static] |
Definition at line 1674 of file ipa-type-escape.c.
References analyze_function(), analyze_variable(), AVAIL_OVERWRITABLE, b, been_there_done_that, BITMAP_ALLOC, bitmap_bit_p(), bitmap_clear(), bitmap_clear_bit(), bitmap_copy(), BITMAP_FREE, bitmap_tmp, cgraph_function_body_availability(), cgraph_is_master_clone(), cgraph_node(), cgraph_varpool_node(), close_addressof_down(), close_type_exposed_parameter(), close_type_full_escape(), close_type_seen(), dump_file, EXECUTE_IF_SET_IN_BITMAP, fprintf(), global_types_exposed_parameter, global_types_full_escape, global_types_seen, i, int, ipa_init(), ipa_obstack, ipa_type_escape_star_count_of_interesting_or_array_type(), splay_tree_node_s::key, node, NULL, pointer_set_destroy(), POINTER_TYPE_P, print_generic_expr(), result, results_of_malloc, splay_tree_delete(), splay_tree_min(), splay_tree_remove(), splay_tree_successor(), TREE_CODE, type_for_uid(), TYPE_UID, and splay_tree_node_s::value.
| static tree type_for_uid | ( | int | uid | ) | [static] |
Definition at line 1405 of file ipa-type-escape.c.
References NULL, result, splay_tree_lookup(), and splay_tree_node_s::value.
Referenced by close_type_full_escape(), and type_escape_execute().
Definition at line 260 of file ipa-type-escape.c.
References COMPLEX_TYPE, POINTER_TYPE_P, TREE_CODE, TREE_TYPE, and TYPE_MAIN_VARIANT.
Referenced by get_canon_type().
splay_tree all_canon_types [static] |
Definition at line 113 of file ipa-type-escape.c.
bitmap been_there_done_that [static] |
Definition at line 71 of file ipa-type-escape.c.
Referenced by close_addressof_down(), close_type_exposed_parameter(), close_type_full_escape(), close_type_seen(), and type_escape_execute().
bitmap bitmap_tmp [static] |
bitmap global_types_exposed_parameter [static] |
Definition at line 101 of file ipa-type-escape.c.
Referenced by ipa_init(), mark_type(), and type_escape_execute().
bitmap global_types_full_escape [static] |
Definition at line 102 of file ipa-type-escape.c.
Referenced by close_addressof_down(), ipa_init(), ipa_type_escape_type_contained_p(), mark_type(), and type_escape_execute().
bitmap global_types_seen [static] |
Definition at line 105 of file ipa-type-escape.c.
Referenced by discover_unique_type(), ipa_init(), and type_escape_execute().
bool initialized = false [static] |
Definition at line 61 of file ipa-type-escape.c.
bitmap_obstack ipa_obstack [static] |
Definition at line 138 of file ipa-type-escape.c.
Referenced by analyze_function(), close_addressof_down(), ipa_init(), mark_interesting_addressof(), static_execute(), subtype_map_for_uid(), and type_escape_execute().
Initial value:
{
"type-escape-var",
gate_type_escape_vars,
type_escape_execute,
NULL,
NULL,
0,
TV_IPA_TYPE_ESCAPE,
0,
0,
0,
0,
0,
0
}
Definition at line 1831 of file ipa-type-escape.c.
Referenced by init_optimization_passes().
bitmap results_of_malloc [static] |
Definition at line 68 of file ipa-type-escape.c.
Referenced by check_cast(), ipa_init(), scan_for_refs(), and type_escape_execute().
splay_tree type_to_canon_type [static] |
Definition at line 116 of file ipa-type-escape.c.
splay_tree uid_to_addressof_down_map [static] |
Definition at line 121 of file ipa-type-escape.c.
splay_tree uid_to_addressof_up_map [static] |
Definition at line 126 of file ipa-type-escape.c.
splay_tree uid_to_canon_type [static] |
Definition at line 109 of file ipa-type-escape.c.
splay_tree uid_to_subtype_map [static] |
Definition at line 130 of file ipa-type-escape.c.
struct pointer_set_t* visited_nodes [static] |
Definition at line 136 of file ipa-type-escape.c.
1.5.6