22 if(expr.
operands().size()!=components.size())
25 error() <<
"struct: wrong number of arguments" <<
eom;
34 exprt::operandst::const_iterator op_it=expr.
operands().begin();
35 for(
const auto &comp : components)
37 const typet &subtype=comp.type();
38 const exprt &op=*op_it;
43 error() <<
"struct: component type does not match: " 44 << subtype.
pretty() <<
" vs. " 56 assert(op_bv.size()==subtype_width);
57 assert(offset+op_bv.size()<=width);
59 for(std::size_t j=0; j<op_bv.size(); j++)
60 bv[offset+j]=op_bv[j];
68 assert(offset==width);
The type of an expression.
const typet & follow(const typet &src) const
std::string pretty(unsigned indent=0, unsigned max_indent=0) const
bool base_type_eq(const typet &type1, const typet &type2, const namespacet &ns)
boolbv_widtht boolbv_width
std::vector< componentt > componentst
virtual bvt convert_struct(const struct_exprt &expr)
const componentst & components() const
static mstreamt & eom(mstreamt &m)
virtual const bvt & convert_bv(const exprt &expr)
const source_locationt & find_source_location() const
source_locationt source_location
const struct_typet & to_struct_type(const typet &type)
Cast a generic typet to a struct_typet.
Base class for all expressions.
struct constructor from list of elements
std::vector< literalt > bvt