diff options
author | Erick Ochoa <erick.ochoa@theobroma-systems.com> | 2020-12-01 09:47:58 +0100 |
---|---|---|
committer | Erick Ochoa <erick.ochoa@theobroma-systems.com> | 2020-12-01 09:47:58 +0100 |
commit | 7f59d98cda5839cef67a13671ae5aa011f5c6823 (patch) | |
tree | 9260da7551409fd7ebda694bffdce63d22a779f9 | |
parent | edfb9cc0ac6949afb05fc4e7677b48d427b436fe (diff) |
STL to GCC type_rewriter
-rw-r--r-- | gcc/ipa-dfe.c | 14 | ||||
-rw-r--r-- | gcc/ipa-dfe.h | 6 | ||||
-rw-r--r-- | gcc/ipa-field-reorder.c | 2 |
3 files changed, 12 insertions, 10 deletions
diff --git a/gcc/ipa-dfe.c b/gcc/ipa-dfe.c index d60444c54c9..ab6870814e5 100644 --- a/gcc/ipa-dfe.c +++ b/gcc/ipa-dfe.c @@ -379,7 +379,7 @@ type_reconstructor::set_is_not_modified_yet (tree t) { gcc_assert (t); const bool is_in_reorg_map = _reorg_map2->get (t); - modified_map[t] = false; + modified_map2->put(t, false); if (is_in_reorg_map) mark_all_pointing_here_as_modified (); @@ -406,10 +406,10 @@ type_reconstructor::set_is_not_modified_yet (tree t) void type_reconstructor::mark_all_pointing_here_as_modified () { - for (is_modified_map_t::iterator i = modified_map.begin (), - e = modified_map.end (); i != e; ++i) + for (is_modified_map2_t::iterator i = modified_map2->begin (), + e = modified_map2->end (); i != e; ++i) { - i->second = true; + (*i).second = true; } } @@ -417,10 +417,10 @@ bool type_reconstructor::get_is_modified (tree t) { gcc_assert (t); - const bool in_map = modified_map.find (t) != modified_map.end (); + const bool in_map = modified_map2->get(t); gcc_assert (in_map); - bool retval = modified_map[t]; - modified_map.erase (t); + bool retval = *modified_map2->get(t); + modified_map2->remove (t); bool points_to_record = false; tree _t = tree_to_tree (t); diff --git a/gcc/ipa-dfe.h b/gcc/ipa-dfe.h index f99837b9da2..ba436f00d52 100644 --- a/gcc/ipa-dfe.h +++ b/gcc/ipa-dfe.h @@ -75,6 +75,7 @@ public: { _reorg_map2 = new reorg_record_map2_t; _reorg_fields2 = new reorg_field_map2_t; + modified_map2 = new is_modified_map2_t; }; ~type_reconstructor() { @@ -82,6 +83,7 @@ public: // but I don't think there is a copy constructor for this... delete _reorg_map2; delete _reorg_fields2; + delete modified_map2; } /* Whether a type has already been modified. */ @@ -94,7 +96,7 @@ public: reorg_field_map2_t *get_field_map2 (); /* Map RECORD_TYPE -> is_modified. */ - typedef std::map<tree, bool> is_modified_map_t; + typedef hash_map<tree, bool> is_modified_map2_t; protected: const char *get_new_suffix (); @@ -131,7 +133,7 @@ protected: reorg_field_map2_t *_reorg_fields2; // old RECORD_TYPE -> is_modified - is_modified_map_t modified_map; + is_modified_map2_t *modified_map2; // Keep track of which types may need to be modified // defaults to not modified. diff --git a/gcc/ipa-field-reorder.c b/gcc/ipa-field-reorder.c index 7a35db6c3b4..a9705778ba4 100644 --- a/gcc/ipa-field-reorder.c +++ b/gcc/ipa-field-reorder.c @@ -237,7 +237,7 @@ TypeReconstructorFieldReordering::_walk_RECORD_TYPE_post (tree t) // So, now we want to do a couple of things. // First, collect all fields in a struct and make a copy of them bool is_modified = get_is_modified (t); - vec<tree> to_reorder2; + vec<tree> to_reorder2 = vNULL; is_modified = true; for (field_tuple_list_t::iterator i = field_tuple_list.begin (), e = field_tuple_list.end (); |