25 for(
const auto &symbol_pair : symbol_table.
symbols)
27 if(symbol_pair.second.is_type && symbol_pair.second.type.id() == ID_struct)
32 bool first_time_seen_in_struct =
true;
34 for(struct_typet::componentst::const_iterator it_mem = components.begin();
35 it_mem != components.end();
39 bool first_time_seen_from =
true;
44 if(it_mem->get_is_padding())
48 for(struct_typet::componentst::const_iterator it_next = it_mem;
49 it_next != components.end();
52 const typet &it_type = it_next->type();
57 throw "type of unknown size:\n" + it_type.
pretty();
59 cumulated_length += size;
65 if(!first_time_seen_from)
70 if(it_mem != it_next && !it_next->get_is_padding())
72 if(first_time_seen_in_struct)
74 first_time_seen_in_struct =
false;
75 first_time_seen_from =
false;
78 <<
"declaration of structure " 80 << symbol_pair.second.location <<
'\n';
83 out <<
"members " << it_mem->get_pretty_name() <<
" and " 84 << it_next->get_pretty_name() <<
" might interfere\n";
89 else if(symbol_pair.second.type.id() == ID_array)
99 throw "type of unknown size:\n"+it_type.pretty();
104 <<
"declaration of an array at " 105 << symbol_pair.second.location <<
106 <<
"\nmight be concurrently accessed\n";
The type of an expression.
struct configt::ansi_ct ansi_c
std::string pretty(unsigned indent=0, unsigned max_indent=0) const
void print_struct_alignment_problems(const symbol_tablet &symbol_table, std::ostream &out)
std::vector< componentt > componentst
const componentst & components() const
mp_integer pointer_offset_size(const typet &type, const namespacet &ns)
Compute the size of a type in bytes, rounding up to full bytes.
const struct_typet & to_struct_type(const typet &type)
Cast a generic typet to a struct_typet.
const array_typet & to_array_type(const typet &type)
Cast a generic typet to an array_typet.
const typet & find_type(const irep_namet &name) const
std::size_t memory_operand_size
const typet & subtype() const