diff options
author | Erick Ochoa <erick.ochoa@theobroma-systems.com> | 2020-12-02 13:50:54 +0100 |
---|---|---|
committer | Erick Ochoa <erick.ochoa@theobroma-systems.com> | 2020-12-02 13:50:54 +0100 |
commit | 8a81f2d85cafd628ca6514a71fcba5ca91572931 (patch) | |
tree | 1b2e1a4bc7ce73b4890842213ff0c215daf42349 | |
parent | af3a1b87f1cbbd289ffe3546ae4eb00a570521ce (diff) |
std::set<tree> -> hash_set<tree>
-rw-r--r-- | gcc/ipa-type-escape-analysis.c | 8 | ||||
-rw-r--r-- | gcc/ipa-type-escape-analysis.h | 2 |
2 files changed, 6 insertions, 4 deletions
diff --git a/gcc/ipa-type-escape-analysis.c b/gcc/ipa-type-escape-analysis.c index 30872e3cfe6..0c7342e3664 100644 --- a/gcc/ipa-type-escape-analysis.c +++ b/gcc/ipa-type-escape-analysis.c @@ -675,7 +675,7 @@ void type_walker::walk (tree t) { gcc_assert (t); - this->tset.clear (); + this->tset2.empty (); this->_walk (t); } @@ -701,11 +701,11 @@ type_walker::_walk (tree type) // of trees and therefore we need a way to // avoid loops in this graph. // Imrpove: Outline finding if it is recursive? - const bool is_recursing = tset.find (type) != tset.end (); + const bool is_recursing = tset2.contains (type); if (is_recursing) return; - tset.insert (type); + tset2.add (type); const enum tree_code code = TREE_CODE (type); switch (code) { @@ -772,7 +772,7 @@ type_walker::_walk (tree type) } break; } - tset.erase (type); + tset2.remove (type); } // This is used to walk over subtrees. diff --git a/gcc/ipa-type-escape-analysis.h b/gcc/ipa-type-escape-analysis.h index 92458e744a3..f38b53719df 100644 --- a/gcc/ipa-type-escape-analysis.h +++ b/gcc/ipa-type-escape-analysis.h @@ -107,6 +107,7 @@ tree_to_tree (tree t) // TODO: Rename? // TSET_T stands for type set. typedef std::set<tree> tset_t; +typedef hash_set<tree> tset2_t; /* Base class used for visiting tree nodes starting with root T. * It can handle recursive cases in the tree graph by holding @@ -131,6 +132,7 @@ protected: /* Typeset holds previously visited nodes. */ tset_t tset; + tset2_t tset2; /* Inner walking method, used to recurse. */ void _walk (tree t); |