summaryrefslogtreecommitdiff
path: root/gcc/type-reconstructor.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/type-reconstructor.c')
-rw-r--r--gcc/type-reconstructor.c24
1 files changed, 18 insertions, 6 deletions
diff --git a/gcc/type-reconstructor.c b/gcc/type-reconstructor.c
index 5adb6220b5d..91d4f383ea7 100644
--- a/gcc/type-reconstructor.c
+++ b/gcc/type-reconstructor.c
@@ -108,6 +108,9 @@ TypeReconstructor::is_memoized(const_tree t)
{
const bool already_changed = _reorg_map.find(t) != _reorg_map.end();
mark_all_pointing_here_as_modified();
+ const bool has_typed_cached_values = TYPE_CACHED_VALUES_P (t);
+ TypeStringifier stringifier;
+ std::string name = stringifier.stringify(t);
return already_changed;
}
@@ -188,6 +191,13 @@ TypeReconstructor::_walk_ARRAY_TYPE_post(const_tree t)
//std::string name = stringifier.stringify(copy);
log("are we going to crash is modified %s %s\n", is_modified ? "t" : "f", TypeStringifier::get_type_identifier(copy).c_str());
if (is_modified) layout_type(copy);
+ TYPE_CACHED_VALUES_P (copy) = false;
+ //TYPE_CACHED_VALUES (copy) = TYPE_CACHED_VALUES(t);
+ tree tt = (tree)t;
+ while (TREE_TYPE(tt)) { tt = TREE_TYPE(tt); };
+
+ const bool points_to_record = TREE_CODE(tt) == RECORD_TYPE;
+ if (!points_to_record) return;
_reorg_map[t] = is_modified ? copy : (tree)t;
}
@@ -219,6 +229,14 @@ TypeReconstructor::_walk_POINTER_TYPE_post(const_tree t)
// This is useful so that we go again through type layout
//TYPE_SIZE(copy) = is_modified ? NULL : TYPE_SIZE(copy);
//if (is_modified) layout_type(copy);
+ TYPE_CACHED_VALUES_P (copy) = false;
+ //TYPE_CACHED_VALUES (copy) = TYPE_CACHED_VALUES(t);
+ //Let's just make sure that we are pointing to a a struct...
+
+ tree tt = (tree)t;
+ while (TREE_TYPE(tt)) { tt = TREE_TYPE(tt); };
+ const bool points_to_record = TREE_CODE(tt) == RECORD_TYPE;
+ if (!points_to_record) return;
_reorg_map[t] = is_modified ? copy : (tree)t;
}
@@ -370,12 +388,6 @@ TypeReconstructor::_walk_field_post(const_tree t)
// What record does this field belongs to?
const_tree record = for_reference.top();
- // Is this a record that has a field that might be deleted?
- const bool is_record_interesting = _records.find(record) != _records.end();
- if (!is_record_interesting) {
- return;
- }
-
field_offsets_t field_offsets = _records[record];
// What's the field offset?
unsigned f_byte_offset = tree_to_uhwi(DECL_FIELD_OFFSET(t));