diff options
Diffstat (limited to 'gcc/ipa-type-escape-analysis.c')
-rw-r--r-- | gcc/ipa-type-escape-analysis.c | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/gcc/ipa-type-escape-analysis.c b/gcc/ipa-type-escape-analysis.c index 64463c7df56..c39472079a2 100644 --- a/gcc/ipa-type-escape-analysis.c +++ b/gcc/ipa-type-escape-analysis.c @@ -116,6 +116,7 @@ update_escape_info_record (const_tree record_type, type_map &escape_map, bool is escaping_info *info = escape_map.get(record_type); // we are collecting records, therefore, we **must** have // it in the escaping info + //FIXME: Is this true? According to creduce bug, no. gcc_assert(info); info->is_escaping |= is_escaping; info->reason = union_op(info->reason, reason); @@ -426,6 +427,33 @@ collect_function_body (cgraph_node *cnode, type_map &escape_map) } static void +collect_return_type (cgraph_node *cnode, type_map &escape_map) +{ + gcc_assert(cnode); + + const_tree decl = cnode->decl; + const enum tree_code code = TREE_CODE(decl); + const bool is_function_decl = FUNCTION_DECL == code; + gcc_assert (is_function_decl); + + const_tree fn_type = TREE_TYPE (decl); + const enum tree_code fn_type_code = TREE_CODE(fn_type); + const bool is_fn_type = FUNCTION_TYPE == fn_type_code; + gcc_assert (is_fn_type); + + const_tree ret_type = TREE_TYPE(fn_type); + gcc_assert (ret_type); + + const bool is_boring = filter_type(escape_map, ret_type); + if (is_boring) return; + + escaping_reason reason = new_escaping_reason(); + escaping_info info = {ret_type, false, reason}; + escape_map.put(ret_type, info); + return; +} + +static void collect_types(type_map &escape_map) { collect_globals(escape_map); @@ -436,6 +464,7 @@ collect_types(type_map &escape_map) collect_parm_declarations (cnode, escape_map); collect_function_body (cnode, escape_map); collect_local_declarations (cnode, escape_map); + collect_return_type (cnode, escape_map); } } |