aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorEugen Wissner <belka@caraus.de>2026-08-01 20:03:34 +0200
committerEugen Wissner <belka@caraus.de>2026-08-01 20:03:34 +0200
commite9cd3e5d0157f145dc0c3fea59f434fdd5ae55c6 (patch)
tree90ba6af2fe70ab961cdf48b46caa669757cd11b7 /include
parent71b3bbb7698b13b42c99a4ca66c27db4a6189ff8 (diff)
downloadelna-e9cd3e5d0157f145dc0c3fea59f434fdd5ae55c6.tar.gz
Evaluate strings at compile time
Diffstat (limited to 'include')
-rw-r--r--include/elna/boot/result.h19
-rw-r--r--include/elna/boot/symbol.h8
-rw-r--r--include/elna/gcc/elna-tree.h8
3 files changed, 9 insertions, 26 deletions
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<template<typename, typename> typename C, template<typename> 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<ordered_map>,
constant_aggregate<std::vector>
>;
@@ -655,12 +644,6 @@ struct std::hash<elna::boot::identifier>
};
template<>
-struct std::hash<elna::boot::global_address>
-{
- std::size_t operator()(const elna::boot::global_address& key) const noexcept;
-};
-
-template<>
struct std::hash<elna::boot::constant_aggregate<std::vector>>
{
std::size_t operator()(const elna::boot::constant_aggregate<std::vector>& key) const noexcept;
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
@@ -588,6 +588,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.
*