Go to the documentation of this file.
37 const irep_idt &component_name)
const
43 if(c.get_name() == component_name)
54 const irep_idt &component_name)
const
58 if(c.get_name() == component_name)
84 :
exprt(ID_base, std::move(base))
95 for(
const auto &b :
bases())
112 if(ot_components.size()<
113 tt_components.size())
116 componentst::const_iterator
117 ot_it=ot_components.begin();
119 for(
const auto &tt_c : tt_components)
121 if(ot_it->type() != tt_c.type() || ot_it->get_name() != tt_c.get_name())
135 return type.
id()==ID_pointer &&
142 return type.
id()==ID_pointer &&
143 type.
get_bool(ID_C_rvalue_reference);
206 const auto has_constant_components = [&ns](
const typet &
subtype) ->
bool {
210 for(
const auto &
component : struct_union_type.components())
234 if(type.
id() == ID_pointer)
235 return type.
get_bool(ID_C_constant);
242 if(type.
id() == ID_struct_tag || type.
id() == ID_union_tag)
244 const auto &resolved_type = ns.
follow(type);
245 return has_constant_components(resolved_type);
const irep_idt & get_identifier() const
#define UNREACHABLE
This should be used to mark dead code.
const componentst & components() const
dstringt has one field, an unsigned integer no which is an index into a static table of strings.
optionalt< baset > get_base(const irep_idt &id) const
Return the base with the given name, if exists.
const typet & subtype() const
const componentt & get_component(const irep_idt &component_name) const
Get the reference to a component with given name.
mp_integer smallest() const
Return the smallest value that can be represented using this type.
const struct_union_typet & to_struct_union_type(const typet &type)
Cast a typet to a struct_union_typet.
#define CHECK_RETURN(CONDITION)
constant_exprt largest_expr() const
Return an expression representing the largest value of this type.
The type of an expression, extends irept.
std::size_t get_f() const
irept & add(const irep_namet &name)
const mp_integer string2integer(const std::string &n, unsigned base)
void add_base(const struct_tag_typet &base)
Add a base class/struct.
const irept & find(const irep_namet &name) const
bool is_prefix_of(const struct_typet &other) const
Returns true if the struct is a prefix of other, i.e., if this struct has n components then the compo...
const type_with_subtypet & to_type_with_subtype(const typet &type)
const typet & component_type(const irep_idt &component_name) const
Base class for all expressions.
std::vector< componentt > componentst
A struct tag type, i.e., struct_typet with an identifier.
auto component(T &struct_expr, const irep_idt &name, const namespacet &ns) -> decltype(struct_expr.op0())
Type with a single subtype.
std::size_t component_number(const irep_idt &component_name) const
Return the sequence number of the component with given name.
constant_exprt zero_expr() const
Return an expression representing the zero value of this type.
constant_exprt smallest_expr() const
Return an expression representing the smallest value of this type.
A namespacet is essentially one or two symbol tables bound together, to allow for symbol lookups in t...
typet & type()
Return the type of the expression.
bool get_bool(const irep_namet &name) const
#define DATA_INVARIANT(CONDITION, REASON)
This condition should be used to document that assumptions that are made on goto_functions,...
const std::string & id2string(const irep_idt &d)
mp_integer get_from() const
const basest & bases() const
Get the collection of base classes/structs.
mp_integer get_to() const
const irep_idt & id() const
const struct_tag_typet & to_struct_tag_type(const typet &type)
Cast a typet to a struct_tag_typet.
tree_implementationt baset
nonstd::optional< T > optionalt
const constant_exprt & size() const
struct_tag_typet & type()
const std::string & get_string(const irep_namet &name) const
vector_typet(const typet &_subtype, const constant_exprt &_size)
void set_to(const mp_integer &to)
Structure type, corresponds to C style structs.
const typet & follow(const typet &) const
Resolve type symbol to the type it points to.
bool is_reference(const typet &type)
Returns true if the type is a reference.
const irep_idt & get(const irep_namet &name) const
void set(const irep_namet &name, const irep_idt &value)
std::size_t get_integer_bits() const
bool is_constant_or_has_constant_components(const typet &type, const namespacet &ns)
Identify whether a given type is constant itself or contains constant components.
unsigned unsafe_string2unsigned(const std::string &str, int base)
bool is_rvalue_reference(const typet &type)
Returns if the type is an R value reference.
mp_integer largest() const
Return the largest value that can be represented using this type.
const irept & get_nil_irep()
mp_integer min_value() const
A constant literal expression.
API to expression classes.
mp_integer max_value() const
void set_from(const mp_integer &_from)
const std::string integer2string(const mp_integer &n, unsigned base)