Skip to content
Snippets Groups Projects
Commit 41f7bc67 authored by Henrich Lauko's avatar Henrich Lauko
Browse files

rst: Implement unit aggregate abstract domain.

parent b94009a6
No related branches found
No related tags found
No related merge requests found
......@@ -39,6 +39,8 @@ extern "C" {
float __unit_lift_float32( float );
double __unit_lift_float64( double );
void * __unit_aggregate();
char * __mstring_val( char * buff, unsigned buff_len );
uint8_t __constant_lift_i8( uint8_t c );
......
......@@ -124,4 +124,28 @@ namespace __dios::rst::abstract {
#undef __bin
};
struct UnitAggregate : Base
{
using Ptr = void *;
template< typename T >
_LART_INTERFACE static Ptr lift_any( Abstracted< T > ) noexcept
{
return __new< UnitAggregate >();
}
_LART_INTERFACE
static Ptr op_load( Ptr /* address */ ) noexcept
{
return __new< Unit< PointerBase > >();
}
_LART_INTERFACE
static void op_store( Ptr /* value */, Ptr /* address */ ) noexcept { }
_LART_INTERFACE
static Ptr op_gep( Ptr address, Ptr /* offset */ ) noexcept { return address; }
};
} // namespace __dios::rst::abstract
......@@ -9,11 +9,14 @@ namespace __dios::rst::abstract {
template struct Unit< PointerBase >;
using Ptr = void *;
template< typename C >
_LART_INLINE C make_unit() noexcept
{
return make_abstract< C, Unit< PointerBase > >();
}
template< typename C >
_LART_INLINE C make_unit( C c ) noexcept
{
......@@ -25,6 +28,9 @@ namespace __dios::rst::abstract {
_LART_SCALAR uint16_t __unit_val_i16() { return make_unit< uint16_t >(); }
_LART_SCALAR uint32_t __unit_val_i32() { return make_unit< uint32_t >(); }
_LART_SCALAR uint64_t __unit_val_i64() { return make_unit< uint64_t >(); }
_LART_AGGREGATE Ptr __unit_aggregate() { return make_abstract< Ptr, UnitAggregate >(); }
_LART_SCALAR float __unit_val_float32() { return make_unit< float >(); }
_LART_SCALAR double __unit_val_float64() { return make_unit< double >(); }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment