summaryrefslogtreecommitdiff
path: root/gcc/expr-rewriter.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/expr-rewriter.c')
-rw-r--r--gcc/expr-rewriter.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/gcc/expr-rewriter.c b/gcc/expr-rewriter.c
index 803d4206cb8..142d023cb6e 100644
--- a/gcc/expr-rewriter.c
+++ b/gcc/expr-rewriter.c
@@ -332,6 +332,17 @@ void
ExprTypeRewriter::_walk_COMPONENT_REF_post(const_tree e)
{
+ /*
+ * Changing the record type will happen later...
+ const_tree r = TREE_OPERAND(e, 0);
+ tree record_type = TREE_TYPE(r);
+ log("changing the record type\n");
+ const bool in_map1 = _map.find(record_type) != _map.end();
+ log("record in map ? %s\n", in_map1 ? "t" : "f");
+ TREE_TYPE((tree)e) = in_map1 ? _map[record_type] : TREE_TYPE((tree)r);
+ */
+
+
const_tree f = TREE_OPERAND(e, 1);
// So, what we need is a map between this field and the new field
const bool in_map = _map2.find(f) != _map2.end();
@@ -355,6 +366,7 @@ ExprTypeRewriter::_walk_COMPONENT_REF_post(const_tree e)
// Otherwise, we will just overwrite memory where the previous field was located
log("replacing field %s %d with %s %d\n", TypeStringifier::get_field_identifier(f).c_str(), f_offset, TypeStringifier::get_field_identifier(n_f).c_str(), nf_offset);
+
if (!is_deleted) return;
log("deleting field %s %d\n", TypeStringifier::get_field_identifier(f).c_str(), f_offset);