34 error() <<
"expected type as initializer for `" 52 <<
"' is declared as reference but is not initialized" 78 if(symbol.
type.
id() == ID_pointer &&
80 symbol.
value.
id() == ID_address_of &&
92 for(code_typet::parameterst::const_iterator
97 exprt new_object(
"new_object");
98 new_object.
set(ID_C_lvalue,
true);
99 new_object.
type() =
ait->type();
101 if(
ait->get(ID_C_base_name)==ID_this)
104 new_object.
type() =
ait->type().subtype();
107 fargs.
operands.push_back(new_object);
116 if(resolved_expr.
id()==ID_symbol)
121 else if(resolved_expr.
id()==ID_member)
125 lookup(resolved_expr.
get(ID_component_name)).symbol_expr());
135 error() <<
"conversion from `" 149 if(symbol.
value.
id()==ID_initializer_list ||
150 symbol.
value.
id()==ID_string_constant)
181 ops.push_back(symbol.
value);
198 if(final_type.
id()==ID_struct)
202 const exprt &component=
static_cast<const exprt &
>(*cit);
204 if(component.
type().
id()==ID_code)
210 if(component.
get_bool(ID_is_static))
219 else if(final_type.
id()==ID_array &&
223 const exprt &size_expr=array_type.
size();
225 if(size_expr.
id()==ID_infinity)
242 else if(final_type.
id()==ID_union)
251 const exprt &component=
static_cast<const exprt &
>(*it);
255 if(component.
type().
id()==ID_code)
263 if(size_int>max_comp_size)
265 max_comp_size=size_int;
274 name.
set(ID_identifier, comp.
get(ID_base_name));
275 name.
set(ID_C_source_location, source_location);
280 exprt member(ID_member);
282 member.
set(ID_component_cpp_name, cpp_name);
286 else if(final_type.
id()==ID_c_enum)
292 zero.make_typecast(type);
301 assign.
lhs().
type().
set(ID_C_constant,
false);
305 ops.push_back(assign);
307 else if(final_type.
id()==ID_incomplete_struct ||
308 final_type.
id()==ID_incomplete_union)
311 error() <<
"cannot zero-initialize incomplete compound" <<
eom;
326 assign.
lhs().
type().
set(ID_C_constant,
false);
330 ops.push_back(assign);
The type of an expression.
irep_idt name
The unique identifier.
exprt size_of_expr(const typet &type, const namespacet &ns)
Fixed-width bit-vector with unsigned binary interpretation.
void typecheck_type(typet &type)
static bool has_auto(const typet &type)
const bitvector_typet & to_bitvector_type(const typet &type)
Cast a generic typet to a bitvector_typet.
void move_to_sub(irept &irep)
const code_typet & to_code_type(const typet &type)
Cast a generic typet to a code_typet.
exprt::operandst operands
void copy_to_operands(const exprt &expr)
cpp_namet & to_cpp_name(irept &cpp_name)
void already_typechecked(irept &irep)
virtual void typecheck_code(codet &code)
exprt value
Initial value of symbol.
virtual void implicit_typecast(exprt &expr, const typet &type)
Symbol table entry.This is a symbol in the symbol table, stored in an object of type symbol_tablet...
#define CHECK_RETURN(CONDITION)
static mstreamt & eom(mstreamt &m)
bool get_bool(const irep_namet &name) const
virtual void typecheck_expr(exprt &expr)
Extract member of struct or union.
Expression Initialization.
const irep_idt & id() const
void cpp_convert_auto(typet &dest, const typet &src)
source_locationt source_location
bool cpp_is_pod(const typet &type) const
bool is_reference(const typet &type)
TO_BE_DOCUMENTED.
const irep_idt & get(const irep_namet &name) const
void convert_initializer(symbolt &symbol)
Initialize an object with a value.
const exprt & size() const
Base class for tree-like data structures with sharing.
C++ Language Type Checking.
const typet & follow(const typet &) const
bitvector_typet index_type()
Operator to return the address of an object.
void zero_initializer(const exprt &object, const typet &type, const source_locationt &source_location, exprt::operandst &ops)
exprt resolve(const cpp_namet &cpp_name, const cpp_typecheck_resolvet::wantt want, const cpp_typecheck_fargst &fargs, bool fail_with_exception=true)
std::vector< exprt > operandst
typet type
Type of symbol.
source_locationt location
Source code location of definition of symbol.
message_handlert & get_message_handler()
const array_typet & to_array_type(const typet &type)
Cast a generic typet to an array_typet.
Base class for all expressions.
const parameterst & parameters() const
irep_idt base_name
Base (non-scoped) name.
const source_locationt & source_location() const
irept & add(const irep_namet &name)
virtual std::string to_string(const typet &type)
source_locationt & add_source_location()
Expression to hold a symbol (variable)
virtual void do_initializer(exprt &initializer, const typet &type, bool force_constant)
const typet & subtype() const
const irept & find(const irep_namet &name) const
codet cpp_constructor(const source_locationt &source_location, const exprt &object, const exprt::operandst &operands)
bool lookup(const irep_idt &name, const symbolt *&symbol) const override
See namespace_baset::lookup().
void set(const irep_namet &name, const irep_idt &value)
void reference_initializer(exprt &expr, const typet &type)
A reference to type "cv1 T1" is initialized by an expression of type "cv2 T2" as follows: ...
bool simplify(exprt &expr, const namespacet &ns)
#define forall_irep(it, irep)