diff options
author | Erick Ochoa <erick.ochoa@theobroma-systems.com> | 2020-12-02 10:31:46 +0100 |
---|---|---|
committer | Erick Ochoa <erick.ochoa@theobroma-systems.com> | 2020-12-02 10:31:46 +0100 |
commit | 28dfabccb9454101cb88b654a8b4cd4ef420cede (patch) | |
tree | 393a8d931c5d6713ed8b8dd19c792af8b3fef7a7 | |
parent | 6ec52af8dc05de7e60137dedc2cadf1f65dbc541 (diff) |
outer type
-rw-r--r-- | gcc/ipa-type-escape-analysis.c | 20 | ||||
-rw-r--r-- | gcc/ipa-type-escape-analysis.h | 8 |
2 files changed, 15 insertions, 13 deletions
diff --git a/gcc/ipa-type-escape-analysis.c b/gcc/ipa-type-escape-analysis.c index 847e32c5b6e..64a8e0206fc 100644 --- a/gcc/ipa-type-escape-analysis.c +++ b/gcc/ipa-type-escape-analysis.c @@ -2797,15 +2797,15 @@ gimple_caster::_walk_pre_gcall (gcall *s) bool type_accessor::is_in_record_field_map(tree t) { - return _map3.find(t) != _map3.end(); + return _map4.get (t); } field_access_map_t type_accessor::get_from_record_field_map(tree t) { - gcc_assert(_map3.at(t)); + gcc_assert (_map4.get (t)); field_access_map_t temp; - field_access_map2_t *value = _map3.at(t); + field_access_map2_t *value = *_map4.get(t); for (auto i = value->begin(), e = value->end(); i != e; ++i) { temp.insert({(*i).first, (*i).second}); @@ -2817,15 +2817,15 @@ void type_accessor::put_in_record_field_map(tree t, field_access_map_t f) { field_access_map2_t *f2 = new field_access_map2_t; - if (_map3.find(t) != _map3.end()) + if (_map4.get (t)) { - delete _map3[t]; + delete *(_map4.get(t)); } for (auto i = f.begin(), e = f.end(); i != e; ++i) { f2->put(i->first, i->second); } - _map3[t] = f2; + _map4.put(t, f2); } bool @@ -2874,16 +2874,16 @@ type_accessor::get_map () // here we need to translate // record_field_map2_t to record_field_map record_field_map_t return_value; - for (auto i = _map3.begin(), e = _map3.end(); i != e; ++i) + for (auto i = _map4.begin(), e = _map4.end(); i != e; ++i) { - if (!i->second) continue; - field_access_map2_t *map = i->second; + if (!(*i).second) continue; + field_access_map2_t *map = (*i).second; field_access_map_t return_map; for (auto j = map->begin(), f = map->end(); j != f; ++j) { return_map.insert({(*j).first, (*j).second}); } - return_value.insert({i->first, return_map}); + return_value.insert({(*i).first, return_map}); } return return_value; } diff --git a/gcc/ipa-type-escape-analysis.h b/gcc/ipa-type-escape-analysis.h index 7c5e865ae44..c84fdb63f93 100644 --- a/gcc/ipa-type-escape-analysis.h +++ b/gcc/ipa-type-escape-analysis.h @@ -1131,6 +1131,7 @@ typedef hash_map<tree, unsigned> field_access_map2_t; // maps RECORD_TYPE -> (FIELD_DECL -> bitflag). typedef std::map<tree, field_access_map_t> record_field_map_t; typedef std::map<tree, field_access_map2_t*> record_field_map3_t; +typedef hash_map<tree, field_access_map2_t*> record_field_map4_t; // Class used to determine if a FIELD is read, written or never accessed. class type_accessor : public type_walker @@ -1142,9 +1143,9 @@ public: ~type_accessor() { - for (auto i = _map3.begin(), e = _map3.end(); i != e; ++i) + for (auto i = _map4.begin(), e = _map4.end(); i != e; ++i) { - delete i->second; + delete (*i).second; } }; @@ -1156,7 +1157,8 @@ public: private: // maps RECORD -> (FIELD_DECL -> bitflag). - record_field_map3_t _map3; + //record_field_map3_t _map3; + record_field_map4_t _map4; // set of trees which are memoized and we don't need to look into them. hash_set<tree> memoized_map2; |