TPDE
Loading...
Searching...
No Matches
tpde::IRAdaptor Concept Reference

#include <IRAdaptor.hpp>

Concept definition

template<typename T>
concept tpde::IRAdaptor = requires(T a) {
typename T::IRValueRef;
requires sizeof(typename T::IRValueRef) <= 8;
typename T::IRInstRef;
typename T::IRBlockRef;
requires sizeof(typename T::IRBlockRef) <= 8;
typename T::IRFuncRef;
requires sizeof(typename T::IRFuncRef) <= 8;
{ T::INVALID_VALUE_REF } -> SameBaseAs<typename T::IRValueRef>;
requires requires(typename T::IRValueRef r, typename T::IRValueRef w) {
{ r == T::INVALID_VALUE_REF } -> std::convertible_to<bool>;
{ r != T::INVALID_VALUE_REF } -> std::convertible_to<bool>;
{ r < w } -> std::convertible_to<bool>;
};
{ T::INVALID_BLOCK_REF } -> SameBaseAs<typename T::IRBlockRef>;
requires requires(typename T::IRBlockRef r) {
{ r == T::INVALID_BLOCK_REF } -> std::convertible_to<bool>;
{ r != T::INVALID_BLOCK_REF } -> std::convertible_to<bool>;
};
{ T::INVALID_FUNC_REF } -> SameBaseAs<typename T::IRFuncRef>;
requires requires(typename T::IRFuncRef r) {
{ r == T::INVALID_FUNC_REF } -> std::convertible_to<bool>;
{ r != T::INVALID_FUNC_REF } -> std::convertible_to<bool>;
};
{ T::TPDE_PROVIDES_HIGHEST_VAL_IDX } -> SameBaseAs<bool>;
{ T::TPDE_LIVENESS_VISIT_ARGS } -> SameBaseAs<bool>;
{ a.func_count() } -> std::convertible_to<u32>;
{ a.funcs() } -> IRRange<typename T::IRFuncRef>;
{ a.funcs_to_compile() } -> IRRange<typename T::IRFuncRef>;
{
a.func_link_name(ARG(typename T::IRFuncRef))
} -> std::convertible_to<std::string_view>;
{ a.func_extern(ARG(typename T::IRFuncRef)) } -> std::convertible_to<bool>;
{
a.func_only_local(ARG(typename T::IRFuncRef))
} -> std::convertible_to<bool>;
{
a.func_has_weak_linkage(ARG(typename T::IRFuncRef))
} -> std::convertible_to<bool>;
{ a.cur_needs_unwind_info() } -> std::convertible_to<bool>;
{ a.cur_is_vararg() } -> std::convertible_to<bool>;
requires IsFalse<T::TPDE_PROVIDES_HIGHEST_VAL_IDX> || requires {
{ a.cur_highest_val_idx() } -> std::convertible_to<u32>;
};
{ a.cur_args() } -> IRRange<typename T::IRValueRef>;
{ a.cur_arg_is_byval(ARG(u32)) } -> std::convertible_to<bool>;
{ a.cur_arg_byval_size(ARG(u32)) } -> std::same_as<u32>;
{ a.cur_arg_byval_align(ARG(u32)) } -> std::same_as<u32>;
{ a.cur_arg_is_sret(ARG(u32)) } -> std::convertible_to<bool>;
{ a.cur_static_allocas() } -> IRRange<typename T::IRValueRef>;
{ a.cur_has_dynamic_alloca() } -> std::convertible_to<bool>;
{ a.cur_entry_block() } -> std::convertible_to<typename T::IRBlockRef>;
{ a.cur_blocks() } -> IRRange<typename T::IRBlockRef>;
{
a.block_succs(ARG(typename T::IRBlockRef))
} -> IRRange<typename T::IRBlockRef>;
{
a.block_insts(ARG(typename T::IRBlockRef))
} -> IRRange<typename T::IRInstRef>;
{
a.block_phis(ARG(typename T::IRBlockRef))
} -> IRRange<typename T::IRValueRef>;
{ a.block_info(ARG(typename T::IRBlockRef)) } -> std::same_as<u32>;
{ a.block_set_info(ARG(typename T::IRBlockRef), ARG(u32)) };
{ a.block_info2(ARG(typename T::IRBlockRef)) } -> std::same_as<u32>;
{ a.block_set_info2(ARG(typename T::IRBlockRef), ARG(u32)) };
{ a.block_fmt_ref(ARG(typename T::IRBlockRef)) } -> CanBeFormatted;
{
a.val_local_idx(ARG(typename T::IRValueRef))
} -> std::convertible_to<ValLocalIdx>;
{
a.val_ignore_in_liveness_analysis(ARG(typename T::IRValueRef))
} -> std::convertible_to<bool>;
{ a.val_is_phi(ARG(typename T::IRValueRef)) } -> std::convertible_to<bool>;
{
a.val_as_phi(ARG(typename T::IRValueRef))
} -> PHIRef<typename T::IRValueRef, typename T::IRBlockRef>;
{
a.val_alloca_size(ARG(typename T::IRValueRef))
} -> std::convertible_to<u32>;
{
a.val_alloca_align(ARG(typename T::IRValueRef))
} -> std::convertible_to<u32>;
{ a.value_fmt_ref(ARG(typename T::IRValueRef)) } -> CanBeFormatted;
{
a.inst_operands(ARG(typename T::IRInstRef))
} -> IRRange<typename T::IRValueRef>;
{
a.inst_results(ARG(typename T::IRInstRef))
} -> IRRange<typename T::IRValueRef>;
{ a.inst_fused(ARG(typename T::IRInstRef)) } -> std::convertible_to<bool>;
{ a.inst_fmt_ref(ARG(typename T::IRInstRef)) } -> CanBeFormatted;
{ a.start_compile() };
{ a.end_compile() };
{ a.switch_func(ARG(typename T::IRFuncRef)) } -> std::convertible_to<bool>;
{ a.reset() };
}

Detailed Description

The IRAdaptor specifies the interface with which the IR-independent parts of the compiler interact with the source IR

It provides type definitions for values and blocks, ways to iterate over blocks, values and their arguments. Additionally, it exposes information about functions in the IR.

Since we also expect that most IRAdaptors will allocate some space or have some available in the storage of values/blocks, we ask the adaptor to also store some information about values/blocks for setting/retrieval by the compiler.

Definition at line 91 of file IRAdaptor.hpp.