|
| const std::string & | abstract_cpp_includes () |
| void | register_bundled_cpp () |
| | Registers the bundled C++ operational models with file_operations.
|
| template<class T> |
| void | hash_combine (std::size_t &seed, const T &v) |
| | Mix a value into a running hash seed.
|
| template<class K, std::size_t I> |
| constexpr std::size_t | nth_field_size_in_derived () |
| template<class K, std::size_t... Is> |
| constexpr std::size_t | sum_derived_field_sizes (std::index_sequence< Is... >) |
| template<class K, std::size_t... Is> |
| constexpr std::size_t | count_derived_field_entries (std::index_sequence< Is... >) |
| template<class K> |
| constexpr bool | fields_cover_class () |
| template<class K> |
| constexpr std::size_t | derived_field_count () |
| template<class K> |
| constexpr bool | assert_kind_invariants () |
| template<class K> |
| bool | generic_cmp (const K &a, const expr2t &o) |
| template<class K> |
| int | generic_lt (const K &a, const expr2t &o) |
| template<class K> |
| list_of_memberst | generic_tostring (const K &a, unsigned int indent) |
| template<class K> |
| const expr2tc * | generic_get_sub_expr (const K &a, size_t idx) |
| template<class K> |
| size_t | generic_get_num_sub_exprs (const K &a) |
| template<class K> |
| void | generic_foreach_operand_impl_const (const K &a, expr2t::const_op_delegate &f) |
| template<class K> |
| void | generic_foreach_operand_impl (K &a, expr2t::op_delegate &f) |
| template<class K> |
| bool | generic_cmp_type (const K &a, const type2t &o) |
| template<class K> |
| int | generic_lt_type (const K &a, const type2t &o) |
| template<class K> |
| list_of_memberst | generic_tostring_type (const K &a, unsigned int indent) |
| template<class K> |
| void | generic_foreach_subtype_const (const K &a, type2t::const_subtype_delegate &f) |
| template<class K> |
| void | generic_foreach_subtype (K &a, type2t::subtype_delegate &f) |
Containers and field-walking infrastructure for irep2 nodes.
Each concrete kind (e.g. add2t, if2t, array_type2t) inherits directly from expr2t / type2t and carries:
static constexpr auto fields = std::make_tuple(&Kind::field1, ...); static std::string field_names[num_type_fields];
The generic_*<K> helpers in irep2_dispatch.h walk that tuple via std::apply to implement clone/cmp/lt/crc/hash/tostring and operand iteration. The switch-on-id dispatchers on expr2t / type2t select the right K per kind from the X-macro manifests (expr_kinds.inc, type_kinds.inc).
Each kind also has a container alias <kind>2tc (alias for irep_container<expr2t> / irep_container<type2t>) and a factory <kind>2tc(args...) that wraps make_irep<T>(args...). Containers behave like value types via copy-on-write: const access shares the pointee, non-const get() / operator-> / operator* calls detach() first (clones into a fresh refcount=1 object when shared).
Identification and downcasting helpers is_<kind>2t(expr), to_<kind>2t(expr), try_to_<kind>2t(expr) are macro-generated by irep2_expr.h / irep2_type.h from the same manifests. to_* throws irep2_cast_error on a kind mismatch; try_to_* returns nullptr. The non-const downcast goes through the non-const container accessor, so it triggers detach automatically.