ESBMC
Efficient SMT-based Context-Bounded Model Checker
Loading...
Searching...
No Matches
code_type2t Class Reference

Type of functions. More...

#include <irep2_type.h>

Inheritance diagram for code_type2t:
[legend]

Public Member Functions

 code_type2t (const std::vector< type2tc > &args, const type2tc &ret, const std::vector< irep_idt > &names, bool e, const std::vector< irep_idt > &base_names={}, const std::vector< expr2tc > &defaults={}, const irep_idt &exc_kind=irep_idt(), const std::vector< irep_idt > &exc_types={}, const irep_idt &ret_marker=irep_idt(), bool implicit_union_copy_move=false, const std::vector< type2tc > &exc_decl={})
 code_type2t (const code_type2t &ref)=default
unsigned int get_width () const
Public Member Functions inherited from type2t
virtual ~type2t ()=default
unsigned int get_width () const
 Fetch bit width of this type.
bool operator== (const type2t &ref) const
bool operator!= (const type2t &ref) const
bool operator< (const type2t &ref) const
std::string pretty (unsigned int indent=0) const
 Produce a human-readable string representation of type.
DUMP_METHOD void dump () const
 Dump object string representation to stdout.
size_t crc () const
 Produce a checksum/hash of the current object.
bool cmp (const type2t &ref) const
 Structural comparison.
int lt (const type2t &ref) const
 Trinary structural ordering.
list_of_memberst tostring (unsigned int indent) const
 Extract a list of members from type as strings.
type2tc clone () const
 Clone method.
template<typename T>
void foreach_subtype (T &&t) const
template<typename T>
void Foreach_subtype (T &&t)
Public Member Functions inherited from irep2t
 irep2t () noexcept
 irep2t (const irep2t &) noexcept
irep2t & operator= (const irep2t &)=delete
virtual ~irep2t ()=default
void mark_writer () const noexcept
void clear_writer () const noexcept

Public Attributes

std::vector< type2tc > arguments
type2tc ret_type
std::vector< irep_idt > argument_names
std::vector< irep_idt > argument_base_names
 The arguments' #base_names, carried across the migrate seam but not reflected: C11 6.7.6.3p15 makes a parameter's spelling no part of the function type, so two signatures differing only here are the same type and must hash and compare equal.
std::vector< expr2tc > argument_defaults
 The arguments' #default_values, null where an argument has none, and empty when none has one.
std::vector< irep_idt > exception_types
 A resolved C++ exception specification, as exception_spec_kind and exception_spec_types record it (util/lang/exception_specification.h); empty when there is none.
std::vector< type2tc > exception_decl
 A dynamic specification's declared types before finalize_exception_specification resolves them to exception_types.
irep_idt exception_kind
irep_idt return_marker
 A C++ constructor's or destructor's pseudo return type ("constructor" / "destructor"), which ret_type models as empty; and whether it is an implicit copy/move constructor of a union.
bool ellipsis
bool implicit_union_copy_move
Public Attributes inherited from type2t
const type_ids type_id
 Instance of type_ids recording this types type.
std::atomic< size_t > crc_val
Public Attributes inherited from irep2t
std::atomic< unsigned int > refcount
std::atomic< std::uintptr_t > writer_thread

Static Public Attributes

static constexpr auto fields
static constexpr std::size_t excluded_field_bytes
static std::string field_names [esbmct::num_type_fields]

Additional Inherited Members

Public Types inherited from type2t
enum  type_ids { end_type_id }
 Enumeration identifying each sort of type. More...
typedef esbmct::function_ref< void(const type2tc &)> const_subtype_delegate
typedef esbmct::function_ref< void(type2tc &)> subtype_delegate
typedef type2tc container_type
typedef type2t base_type
Static Public Member Functions inherited from irep2t
static std::uintptr_t current_thread_tag () noexcept
Protected Member Functions inherited from type2t
 type2t (type_ids id)
 Primary constructor.
 type2t (const type2t &ref)
 Copy constructor.
void foreach_subtype_impl_const (const_subtype_delegate &t) const
void foreach_subtype_impl (subtype_delegate &t)

Detailed Description

Type of functions.

Constructor & Destructor Documentation

◆ code_type2t() [1/2]

code_type2t::code_type2t ( const std::vector< type2tc > & args,
const type2tc & ret,
const std::vector< irep_idt > & names,
bool e,
const std::vector< irep_idt > & base_names = {},
const std::vector< expr2tc > & defaults = {},
const irep_idt & exc_kind = irep_idt(),
const std::vector< irep_idt > & exc_types = {},
const irep_idt & ret_marker = irep_idt(),
bool implicit_union_copy_move = false,
const std::vector< type2tc > & exc_decl = {} )
inline

◆ code_type2t() [2/2]

code_type2t::code_type2t ( const code_type2t & ref)
default

Member Function Documentation

◆ get_width()

unsigned int code_type2t::get_width ( ) const

Member Data Documentation

◆ argument_base_names

std::vector<irep_idt> code_type2t::argument_base_names

The arguments' #base_names, carried across the migrate seam but not reflected: C11 6.7.6.3p15 makes a parameter's spelling no part of the function type, so two signatures differing only here are the same type and must hash and compare equal.

Kept because a consumer reads it back – clang_cpp_convert_vft.cpp's thunk argument loop does (docs/roadmap/frontends-to-irep2.md §44).

◆ argument_defaults

std::vector<expr2tc> code_type2t::argument_defaults

The arguments' #default_values, null where an argument has none, and empty when none has one.

Unreflected: a default is no part of the function's type. Carried because Python call lowering fills a missing argument from it (converter_funcall.cpp, function_call/expr.cpp).

◆ argument_names

std::vector<irep_idt> code_type2t::argument_names

◆ arguments

std::vector<type2tc> code_type2t::arguments

◆ ellipsis

bool code_type2t::ellipsis

◆ exception_decl

std::vector<type2tc> code_type2t::exception_decl

A dynamic specification's declared types before finalize_exception_specification resolves them to exception_types.

◆ exception_kind

irep_idt code_type2t::exception_kind

◆ exception_types

std::vector<irep_idt> code_type2t::exception_types

A resolved C++ exception specification, as exception_spec_kind and exception_spec_types record it (util/lang/exception_specification.h); empty when there is none.

Unreflected, like the fields above: two signatures differing only here still compare equal. Carried because goto_convert_functions decodes it from the function symbol's type.

◆ excluded_field_bytes

std::size_t code_type2t::excluded_field_bytes
staticconstexpr
Initial value:
=
2 * sizeof(std::vector<irep_idt>) + sizeof(std::vector<expr2tc>) +
sizeof(std::vector<type2tc>) + 2 * sizeof(irep_idt) + sizeof(bool)
Definition irep_idt.h:12
#define bool
Definition stdbool.h:9

◆ field_names

std::string code_type2t::field_names
static
Initial value:
=
{"arguments", "ret_type", "argument_names", "ellipsis", ""}

◆ fields

auto code_type2t::fields
staticconstexpr
Initial value:
= std::make_tuple(
std::vector< irep_idt > argument_names
Definition irep2_type.h:369
std::vector< type2tc > arguments
Definition irep2_type.h:367
type2tc ret_type
Definition irep2_type.h:368
bool ellipsis
Definition irep2_type.h:399

◆ implicit_union_copy_move

bool code_type2t::implicit_union_copy_move

◆ ret_type

type2tc code_type2t::ret_type

◆ return_marker

irep_idt code_type2t::return_marker

A C++ constructor's or destructor's pseudo return type ("constructor" / "destructor"), which ret_type models as empty; and whether it is an implicit copy/move constructor of a union.

Unreflected, like the fields above. Carried because vptr initialisation and the union copy/move synthesis read them (docs/roadmap/frontends-to-irep2.md §50.2, scope-clang-cpp-irep2.md §12).


The documentation for this class was generated from the following files: