aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorEugen Wissner <belka@caraus.de>2026-10-09 14:43:11 +0200
committerEugen Wissner <belka@caraus.de>2026-10-09 14:43:11 +0200
commit134d3ac4caff6d87c79b0892e57073594cb0064c (patch)
treee93c73d59ee50f3bdaa073bb5908ae3c74f7a985 /gcc
parent244449004fb62adbfd43b81e8dfce7500ca4a7e4 (diff)
downloadelna-134d3ac4caff6d87c79b0892e57073594cb0064c.tar.gz
Remove Pointer and nil support
Diffstat (limited to 'gcc')
-rw-r--r--gcc/gcc/elna-builtins.cc1
-rw-r--r--gcc/gcc/elna-generic.cc6
-rw-r--r--gcc/gcc/elna-tree.cc16
3 files changed, 10 insertions, 13 deletions
diff --git a/gcc/gcc/elna-builtins.cc b/gcc/gcc/elna-builtins.cc
index 8eb5ce1..69b8229 100644
--- a/gcc/gcc/elna-builtins.cc
+++ b/gcc/gcc/elna-builtins.cc
@@ -142,7 +142,6 @@ namespace elna::gcc
declare_builtin_type(builtin_table, "Word64", unsigned_intDI_type_node);
declare_builtin_type(builtin_table, "Char", elna_char_type_node);
declare_builtin_type(builtin_table, "Bool", elna_bool_type_node);
- declare_builtin_type(builtin_table, "Pointer", elna_pointer_type_node);
declare_builtin_type(builtin_table, "Single", float_type_node);
declare_builtin_type(builtin_table, "Double", double_type_node);
diff --git a/gcc/gcc/elna-generic.cc b/gcc/gcc/elna-generic.cc
index bb93270..bf4784b 100644
--- a/gcc/gcc/elna-generic.cc
+++ b/gcc/gcc/elna-generic.cc
@@ -662,12 +662,6 @@ namespace elna::gcc
this->symbols, elna_char_type_node);
}
- void generic_visitor::visit(boot::literal<std::nullptr_t> *)
- {
- this->current_expression = constant_to_tree(boot::constant_value{ std::nullptr_t{} },
- this->symbols, elna_pointer_type_node);
- }
-
void generic_visitor::visit(boot::literal<std::string> *string)
{
tree slice_type = get_inner_alias(string->type_decoration, symbols);
diff --git a/gcc/gcc/elna-tree.cc b/gcc/gcc/elna-tree.cc
index 0f94864..9612ae2 100644
--- a/gcc/gcc/elna-tree.cc
+++ b/gcc/gcc/elna-tree.cc
@@ -85,12 +85,9 @@ namespace elna::gcc
return field_declaration;
}
- // The generic Pointer has no pointee size; it advances byte by byte.
static tree pointer_stride(tree pointer_type, tree offset_type)
{
- return pointer_type == elna_pointer_type_node
- ? size_one_node
- : fold_convert(offset_type, size_in_bytes(TREE_TYPE(pointer_type)));
+ return fold_convert(offset_type, size_in_bytes(TREE_TYPE(pointer_type)));
}
tree do_pointer_arithmetic(boot::binary_operator binary_operator,
@@ -293,9 +290,16 @@ namespace elna::gcc
{
return build_int_cstu(elna_char_type_node, std::get<std::uint32_t>(constant_value));
}
- else if (std::holds_alternative<std::nullptr_t>(constant_value))
+ else if (std::holds_alternative<boot::pointer_literal>(constant_value))
{
- return null_pointer_node;
+ const boot::integer_literal& address =
+ std::get<boot::pointer_literal>(constant_value).address;
+
+ if (auto converted = address.try_to<std::size_t>())
+ {
+ return build_int_cstu(type, *converted);
+ }
+ return NULL_TREE;
}
else if (std::holds_alternative<std::string>(constant_value))
{