diff options
Diffstat (limited to 'gcc/collect-types.c')
-rw-r--r-- | gcc/collect-types.c | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/gcc/collect-types.c b/gcc/collect-types.c index 200e5f16e98..894a755cd5f 100644 --- a/gcc/collect-types.c +++ b/gcc/collect-types.c @@ -225,6 +225,7 @@ collect_types_from_record_or_union_type(const_tree type, ptrset_t &types) const bool is_qual_union = QUAL_UNION_TYPE == code; const bool is_valid_input = is_record || is_union || is_qual_union; gcc_assert(is_valid_input); + assert_is_complete(type); for (tree field = TYPE_FIELDS(type) ; field ; field = DECL_CHAIN(field)) { @@ -237,14 +238,14 @@ collect_types_from_record_or_union_type(const_tree type, ptrset_t &types) static void collect_types_from_record_type(const_tree type, ptrset_t &types) { - assert_is_type(type, RECORD_TYPE); + assert_is_complete_type(type, RECORD_TYPE); collect_types_from_record_or_union_type(type, types); } static void collect_types_from_union_type(const_tree type, ptrset_t &types) { - assert_is_type(type, UNION_TYPE); + assert_is_complete_type(type, UNION_TYPE); collect_types_from_record_or_union_type(type, types); } @@ -252,6 +253,7 @@ static void collect_types_from_wrapper_type(const_tree type, ptrset_t &types) { gcc_assert(type); + assert_is_complete(type); const_tree inner_type = TREE_TYPE(type); gcc_assert(inner_type); collect_types(inner_type, types); @@ -261,20 +263,21 @@ static void collect_types_from_pointer_type(const_tree type, ptrset_t &types) { assert_is_type(type, POINTER_TYPE); + assert_is_complete(type); collect_types_from_wrapper_type(type, types); } static void collect_types_from_reference_type(const_tree type, ptrset_t &types) { - assert_is_type(type, REFERENCE_TYPE); + assert_is_complete_type(type, REFERENCE_TYPE); collect_types_from_wrapper_type(type, types); } static void collect_types_from_array_type(const_tree type, ptrset_t &types) { - assert_is_type(type, ARRAY_TYPE); + assert_is_complete_type(type, ARRAY_TYPE); collect_types_from_wrapper_type(type, types); } @@ -282,6 +285,7 @@ static void collect_types_from_function_or_method_type(const_tree type, ptrset_t &types) { gcc_assert(type); + assert_is_complete(type); const enum tree_code code = TREE_CODE(type); const bool is_function = FUNCTION_TYPE == code; const bool is_method = METHOD_TYPE == code; @@ -305,14 +309,14 @@ collect_types_from_function_or_method_type(const_tree type, ptrset_t &types) static void collect_types_from_function_type(const_tree type, ptrset_t &types) { - assert_is_type(type, FUNCTION_TYPE); + assert_is_complete_type(type, FUNCTION_TYPE); collect_types_from_function_or_method_type(type, types); } static void collect_types_from_method_type(const_tree type, ptrset_t &types) { - assert_is_type(type, METHOD_TYPE); + assert_is_complete_type(type, METHOD_TYPE); collect_types_from_function_or_method_type(type, types); } |