summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorErick Ochoa <erick.ochoa@theobroma-systems.com>2020-12-02 13:30:01 +0100
committerErick Ochoa <erick.ochoa@theobroma-systems.com>2020-12-02 13:30:01 +0100
commitc377f0f2313fd933e790ee4a4574e910b19d260f (patch)
tree4c8375a61a8bf95b6df20656a15b778a01bb5307
parent0431e1622df24f34622db28cd54dfe6f882b285f (diff)
ptr
-rw-r--r--gcc/ipa-type-escape-analysis.c46
-rw-r--r--gcc/ipa-type-escape-analysis.h3
2 files changed, 25 insertions, 24 deletions
diff --git a/gcc/ipa-type-escape-analysis.c b/gcc/ipa-type-escape-analysis.c
index 2ce5893ab9f..e37d30c91f0 100644
--- a/gcc/ipa-type-escape-analysis.c
+++ b/gcc/ipa-type-escape-analysis.c
@@ -1647,7 +1647,7 @@ type_collector::collect (tree t)
// The boolean will be updated to show
// whether a record is reachable from
// the type.
- gcc_assert (ptr.empty ());
+ gcc_assert (ptr2.is_empty ());
walk (t);
}
@@ -1694,10 +1694,10 @@ type_collector::is_memoized (tree t)
// we must update all types that can refer
// to memoized type.
const bool points_to_record = ptrset.in_points_to_record (t);
- for (std::map<tree, bool>::iterator i = ptr.begin (),
- e = ptr.end (); i != e; ++i)
+ for (auto i = ptr2.begin (),
+ e = ptr2.end (); i != e; ++i)
{
- i->second |= points_to_record;
+ (*i).second |= points_to_record;
}
return true;
}
@@ -1705,7 +1705,7 @@ type_collector::is_memoized (tree t)
void
type_collector::_walk_VOID_TYPE_pre (tree t)
{
- ptr[t] = false;
+ ptr2.put(t, false);
}
void
@@ -1717,7 +1717,7 @@ type_collector::_walk_VOID_TYPE_post (tree t)
void
type_collector::_walk_INTEGER_TYPE_pre (tree t)
{
- ptr[t] = false;
+ ptr2.put(t, false);
}
void
@@ -1729,7 +1729,7 @@ type_collector::_walk_INTEGER_TYPE_post (tree t)
void
type_collector::_walk_REAL_TYPE_pre (tree t)
{
- ptr[t] = false;
+ ptr2.put(t, false);
}
void
@@ -1741,7 +1741,7 @@ type_collector::_walk_REAL_TYPE_post (tree t)
void
type_collector::_walk_FIXED_POINT_TYPE_pre (tree t)
{
- ptr[t] = false;
+ ptr2.put(t, false);
}
void
@@ -1753,7 +1753,7 @@ type_collector::_walk_FIXED_POINT_TYPE_post (tree t)
void
type_collector::_walk_COMPLEX_TYPE_pre (tree t)
{
- ptr[t] = false;
+ ptr2.put(t, false);
}
void
@@ -1765,7 +1765,7 @@ type_collector::_walk_COMPLEX_TYPE_post (tree t)
void
type_collector::_walk_ENUMERAL_TYPE_pre (tree t)
{
- ptr[t] = false;
+ ptr2.put(t, false);
}
void
@@ -1777,7 +1777,7 @@ type_collector::_walk_ENUMERAL_TYPE_post (tree t)
void
type_collector::_walk_BOOLEAN_TYPE_pre (tree t)
{
- ptr[t] = false;
+ ptr2.put(t, false);
}
void
@@ -1790,15 +1790,15 @@ void
type_collector::_collect_simple (tree t)
{
// Insert into persistent set.
- ptrset.insert (t, ptr[t]);
+ ptrset.insert (t, *ptr2.get(t));
// erase from current working set.
- ptr.erase (t);
+ ptr2.remove (t);
}
void
type_collector::_walk_ARRAY_TYPE_pre (tree t)
{
- ptr[t] = false;
+ ptr2.put(t, false);
}
void
@@ -1810,7 +1810,7 @@ type_collector::_walk_ARRAY_TYPE_post (tree t)
void
type_collector::_walk_POINTER_TYPE_pre (tree t)
{
- ptr[t] = false;
+ ptr2.put(t, false);
}
void
@@ -1822,7 +1822,7 @@ type_collector::_walk_POINTER_TYPE_post (tree t)
void
type_collector::_walk_REFERENCE_TYPE_pre (tree t)
{
- ptr[t] = false;
+ ptr2.put(t, false);
}
void
@@ -1835,10 +1835,10 @@ void
type_collector::_walk_RECORD_TYPE_post (tree t)
{
// All in ptr point to record
- for (std::map<tree, bool>::iterator i = ptr.begin (),
- e = ptr.end (); i != e; ++i)
+ for (auto i = ptr2.begin (),
+ e = ptr2.end (); i != e; ++i)
{
- i->second = true;
+ (*i).second = true;
}
_collect_simple (t);
@@ -1847,13 +1847,13 @@ type_collector::_walk_RECORD_TYPE_post (tree t)
void
type_collector::_walk_RECORD_TYPE_pre (tree t)
{
- ptr[t] = false;
+ ptr2.put(t, false);
}
void
type_collector::_walk_UNION_TYPE_pre (tree t)
{
- ptr[t] = false;
+ ptr2.put(t, false);
}
void
@@ -1871,7 +1871,7 @@ type_collector::_walk_FUNCTION_TYPE_post (tree t)
void
type_collector::_walk_FUNCTION_TYPE_pre (tree t)
{
- ptr[t] = false;
+ ptr2.put(t, false);
}
void
@@ -1883,7 +1883,7 @@ type_collector::_walk_METHOD_TYPE_post (tree t)
void
type_collector::_walk_METHOD_TYPE_pre (tree t)
{
- ptr[t] = false;
+ ptr2.put(t, false);
}
inline void
diff --git a/gcc/ipa-type-escape-analysis.h b/gcc/ipa-type-escape-analysis.h
index dd32e28c978..4fd7e2a58c5 100644
--- a/gcc/ipa-type-escape-analysis.h
+++ b/gcc/ipa-type-escape-analysis.h
@@ -488,7 +488,8 @@ private:
* In other words, the contents are reset after every
* call to collect.
*/
- std::map<tree, bool> ptr;
+ hash_map<tree, bool> ptr2;
+ //std::map<tree, bool> ptr;
/* The type partition set that will hold partitions for
* points to record or does not point to record.