14 const exprt &expression,
24 type_try_dynamic_cast<pointer_typet>(sub_expression.
type()))
26 const auto find_result = type_size_map.find(pointer_type->base_type());
27 if(find_result != type_size_map.cend())
29 exprt pointer_size_expr;
35 if(is_void_pointer(*pointer_type))
37 pointer_size_expr = from_integer(1, size_type());
41 auto pointer_size_opt = size_of_expr(pointer_type->base_type(), ns);
42 PRECONDITION(pointer_size_opt.has_value());
43 pointer_size_expr = pointer_size_opt.value();
51 type_size_map.emplace_hint(
pointer_typet pointer_type(const typet &subtype)
Base class for all expressions.
void visit_pre(std::function< void(exprt &)>)
typet & type()
Return the type of the expression.
A namespacet is essentially one or two symbol tables bound together, to allow for symbol lookups in t...
const typet & base_type() const
The type of the data what we point to.
static smt_termt convert_expr_to_smt(const symbol_exprt &symbol_expr)
std::unordered_map< exprt, decision_procedure_objectt, irep_hash > smt_object_mapt
Mapping from an object's base expression to the set of information about it which we track.
API to expression classes for Pointers.
exprt object_size(const exprt &pointer)
void associate_pointer_sizes(const exprt &expression, const namespacet &ns, type_size_mapt &type_size_map, const smt_object_mapt &object_map, const smt_object_sizet::make_applicationt &object_size, const smt_is_dynamic_objectt::make_applicationt &is_dynamic_object)
This function populates the (pointer) type -> size map.
Utilities for making a map of types to associated sizes.
std::unordered_map< typet, smt_termt, irep_hash > type_size_mapt