aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorEugen Wissner <belka@caraus.de>2026-07-09 09:21:57 +0200
committerEugen Wissner <belka@caraus.de>2026-07-09 09:21:57 +0200
commit8d8e771af944796eba10cfa9568d284daaab93a1 (patch)
tree96aab1466fa210a574dd4dd406a5270d88c229c3 /gcc
parentcd3574320bf57b2eaad93ef6f58dee6c9d41cb19 (diff)
downloadelna-8d8e771af944796eba10cfa9568d284daaab93a1.tar.gz
Implement record extensions
Diffstat (limited to 'gcc')
-rw-r--r--gcc/gcc/elna-builtins.cc12
1 files changed, 12 insertions, 0 deletions
diff --git a/gcc/gcc/elna-builtins.cc b/gcc/gcc/elna-builtins.cc
index 7c97027..7817c7e 100644
--- a/gcc/gcc/elna-builtins.cc
+++ b/gcc/gcc/elna-builtins.cc
@@ -124,6 +124,18 @@ namespace elna::gcc
{
tree composite_type_node = make_node(RECORD_TYPE);
+ if (!reference->base.empty())
+ {
+ tree base_type_node = get_inner_alias(reference->base, symbols);
+
+ for (tree base_field = TYPE_FIELDS(base_type_node); base_field != NULL_TREE;
+ base_field = TREE_CHAIN(base_field))
+ {
+ tree cloned_field = build_field(UNKNOWN_LOCATION, composite_type_node,
+ IDENTIFIER_POINTER(DECL_NAME(base_field)), TREE_TYPE(base_field));
+ TYPE_FIELDS(composite_type_node) = chainon(TYPE_FIELDS(composite_type_node), cloned_field);
+ }
+ }
build_composite_type(reference->fields, composite_type_node, symbols);
return composite_type_node;