diff options
Diffstat (limited to 'gcc/type-escaper.c')
-rw-r--r-- | gcc/type-escaper.c | 35 |
1 files changed, 33 insertions, 2 deletions
diff --git a/gcc/type-escaper.c b/gcc/type-escaper.c index e25ee999b0d..e03845fc570 100644 --- a/gcc/type-escaper.c +++ b/gcc/type-escaper.c @@ -36,6 +36,7 @@ bool TypeEscaper::is_memoized(const_tree t) { + /* const bool in_set = calc.find(t) != calc.end(); if (!in_set) return false; @@ -45,6 +46,7 @@ TypeEscaper::is_memoized(const_tree t) const bool already_escaping = in_set && calc[t].is_escaping; if (already_escaping) return true; + */ return false; } @@ -116,6 +118,7 @@ TypeEscaper::_update(const_tree t) _is_volatile.is_escaping = is_volatile; _is_volatile.type_is_volatile = is_volatile; Reason _inner = _reason | _is_volatile; + _inner.type_is_casted = _inside_indirect_field ? false : _inner.type_is_casted; already_in_typemap ? calc[t] |= _inner : calc[t] = _inner; } @@ -128,10 +131,17 @@ TypeEscaper::_walk_ARRAY_TYPE_pre(const_tree t) void TypeEscaper::_walk_POINTER_TYPE_pre(const_tree t) { + _inside_indirect_field = _inside_field > 0 ? _inside_indirect_field + 1 : _inside_indirect_field; _update(t); } void +TypeEscaper::_walk_POINTER_TYPE_post(const_tree t) +{ + _inside_indirect_field = _inside_field > 0 ? _inside_indirect_field - 1 : _inside_indirect_field; +} + +void TypeEscaper::_walk_REFERENCE_TYPE_pre(const_tree t) { _update(t); @@ -155,6 +165,18 @@ TypeEscaper::_walk_UNION_TYPE_pre(const_tree t) } void +TypeEscaper::_walk_field_pre(const_tree t) +{ + _inside_field++; +} + +void +TypeEscaper::_walk_field_post(const_tree t) +{ + _inside_field--; +} + +void TypeEscaper::_walk_UNION_TYPE_post(const_tree t) { _inside_union--; @@ -166,13 +188,22 @@ TypeEscaper::_walk_UNION_TYPE_post(const_tree t) void TypeEscaper::_walk_FUNCTION_TYPE_pre(const_tree t) { - _update(t); } void +TypeEscaper::_walk_FUNCTION_TYPE(const_tree t) +{ +} + +void +TypeEscaper::_walk_METHOD_TYPE(const_tree t) +{ +} + + +void TypeEscaper::_walk_METHOD_TYPE_pre(const_tree t) { - _update(t); } void |