From 586e0cd8645de44fbfc678bf01e658f0c68894f3 Mon Sep 17 00:00:00 2001 From: Erick Ochoa Date: Tue, 1 Dec 2020 11:24:33 +0100 Subject: STL -> GCC --- gcc/ipa-dfe.c | 14 +++++++------- gcc/ipa-dfe.h | 5 ++++- gcc/ipa-field-reorder.c | 12 ++++++------ 3 files changed, 17 insertions(+), 14 deletions(-) diff --git a/gcc/ipa-dfe.c b/gcc/ipa-dfe.c index 2f2174d8cf4..a56b4f717cf 100644 --- a/gcc/ipa-dfe.c +++ b/gcc/ipa-dfe.c @@ -603,7 +603,7 @@ type_reconstructor::_walk_RECORD_TYPE_pre (tree t) tree _t = tree_to_tree (t); tree copy = build_variant_type_copy (_t); in_progress.push (copy); - field_list_stack.push (field_tuple_list_t ()); + field_list2_stack.push (vNULL); } void @@ -615,8 +615,8 @@ type_reconstructor::_walk_RECORD_TYPE_post (tree t) tree copy = in_progress.top (); in_progress.pop (); - field_tuple_list_t field_tuple_list = field_list_stack.top (); - field_list_stack.pop (); + field_tuple_list2_t field_tuple_list2 = field_list2_stack.top (); + field_list2_stack.pop (); // So, here all the work has been done to make sure // that the fields produced a field_tuple_list_t @@ -627,8 +627,8 @@ type_reconstructor::_walk_RECORD_TYPE_post (tree t) // of the copy bool is_modified = get_is_modified (t); tree prev_field = NULL; - for (field_tuple_list_t::iterator i = field_tuple_list.begin (), - e = field_tuple_list.end (); i != e; ++i) + for (auto i = field_tuple_list2.begin (), + e = field_tuple_list2.end (); i != e; ++i) { field_tuple_t field_tuple = *i; tree modified_field = field_tuple.second; @@ -746,8 +746,8 @@ type_reconstructor::_walk_field_post (tree t) field_tuple_t tuple = std::make_pair (t, can_field_be_deleted ? NULL : copy); // Put the field into the vector - field_tuple_list_t &field_tuple_list = field_list_stack.top (); - field_tuple_list.push_back (tuple); + field_tuple_list2_t &field_tuple_list2 = field_list2_stack.top (); + field_tuple_list2.safe_push (tuple); const bool already_has_field = _reorg_fields2->get (t); if (already_has_field) return; diff --git a/gcc/ipa-dfe.h b/gcc/ipa-dfe.h index 6fc7128c9cf..b21ffdc63a8 100644 --- a/gcc/ipa-dfe.h +++ b/gcc/ipa-dfe.h @@ -119,10 +119,12 @@ protected: // list of fields for new type typedef std::vector field_tuple_list_t; + typedef vec field_tuple_list2_t; // to deal with nested structures we need to have a stack // of field_tuple_list_t typedef std::stack field_tuple_list_stack_t; + typedef std::stack field_tuple_list2_stack_t; // Which records can be modified. //record_field_offset_map_t _records; @@ -132,7 +134,8 @@ protected: const char *_suffix; // Which fields will be deleted. - field_tuple_list_stack_t field_list_stack; + field_tuple_list2_stack_t field_list2_stack; + // old RECORD_TYPE -> new RECORD_TYPE reorg_record_map2_t *_reorg_map2; diff --git a/gcc/ipa-field-reorder.c b/gcc/ipa-field-reorder.c index a9705778ba4..1ebfc136609 100644 --- a/gcc/ipa-field-reorder.c +++ b/gcc/ipa-field-reorder.c @@ -227,8 +227,8 @@ TypeReconstructorFieldReordering::_walk_RECORD_TYPE_post (tree t) tree copy = in_progress.top (); in_progress.pop (); - field_tuple_list_t field_tuple_list = field_list_stack.top (); - field_list_stack.pop (); + field_tuple_list2_t field_tuple_list2 = field_list2_stack.top (); + field_list2_stack.pop (); // So, here all the work has been done to make sure // that the fields produced a field_tuple_list_t @@ -239,8 +239,8 @@ TypeReconstructorFieldReordering::_walk_RECORD_TYPE_post (tree t) bool is_modified = get_is_modified (t); vec to_reorder2 = vNULL; is_modified = true; - for (field_tuple_list_t::iterator i = field_tuple_list.begin (), - e = field_tuple_list.end (); + for (auto i = field_tuple_list2.begin (), + e = field_tuple_list2.end (); i != e; ++i) { field_tuple_t field_tuple = *i; @@ -268,8 +268,8 @@ TypeReconstructorFieldReordering::_walk_RECORD_TYPE_post (tree t) compare_FIELD_DECLs_TYPE_SIZE); is_modified = false; - for (field_tuple_list_t::iterator i = field_tuple_list.begin (), - e = field_tuple_list.end (); + for (auto i = field_tuple_list2.begin (), + e = field_tuple_list2.end (); i != e; ++i) { field_tuple_t field_tuple = *i; -- cgit v1.2.3