From e9cd3e5d0157f145dc0c3fea59f434fdd5ae55c6 Mon Sep 17 00:00:00 2001 From: Eugen Wissner Date: Sat, 1 Aug 2026 20:03:34 +0200 Subject: Evaluate strings at compile time --- include/elna/boot/result.h | 19 +------------------ include/elna/boot/symbol.h | 8 ++++++++ include/elna/gcc/elna-tree.h | 8 -------- 3 files changed, 9 insertions(+), 26 deletions(-) (limited to 'include') diff --git a/include/elna/boot/result.h b/include/elna/boot/result.h index 56884ff..1455371 100644 --- a/include/elna/boot/result.h +++ b/include/elna/boot/result.h @@ -507,17 +507,6 @@ namespace elna::boot type_properties bool_properties; }; - /** - * Address of a module-level variable, tracked by name so that - * different variables have distinct addresses at compile time. - */ - struct global_address - { - std::string name; - - bool operator==(const global_address&) const = default; - }; - template typename C, template typename Alloc = std::allocator> class constant_aggregate; @@ -533,7 +522,7 @@ namespace elna::boot bool, unsigned char, std::nullptr_t, - global_address, + std::string, constant_aggregate, constant_aggregate >; @@ -654,12 +643,6 @@ struct std::hash std::size_t operator()(const elna::boot::identifier& key) const noexcept; }; -template<> -struct std::hash -{ - std::size_t operator()(const elna::boot::global_address& key) const noexcept; -}; - template<> struct std::hash> { diff --git a/include/elna/boot/symbol.h b/include/elna/boot/symbol.h index 01eedb1..5000ab8 100644 --- a/include/elna/boot/symbol.h +++ b/include/elna/boot/symbol.h @@ -587,6 +587,14 @@ namespace elna::boot */ bool is_scalar_type(const type& checked); + /** + * Checks whether the given type is a string (slice of const Char). + * + * \param checked The type t o check. + * \return Whether the type is a string type. + */ + bool is_string_type(const type& checked); + /** * If \a range is an array or a slice gives its base type, otherwise * returns an empty type. diff --git a/include/elna/gcc/elna-tree.h b/include/elna/gcc/elna-tree.h index 41f5cc3..219acb1 100644 --- a/include/elna/gcc/elna-tree.h +++ b/include/elna/gcc/elna-tree.h @@ -36,14 +36,6 @@ namespace elna::gcc bool is_integral_type(tree type); bool is_unique_type(tree type); - bool is_void_type(tree type); - - /** - * \param type The type to evaluate. - * \return Whether this type can be converted to another type. - */ - bool is_castable_type(tree type); - /** * Prepares a value to be bound to a variable or parameter. * -- cgit v1.2.3