Go to the documentation of this file.
38 codet new_code(ID_decl_block);
46 declarator.
name()=cpp_name;
51 cpp_declarator_converter.
convert(declaration, declarator);
56 error() <<
"anonymous union is not POD" <<
eom;
70 if(c.type().id() == ID_code)
74 <<
"' shall not have function members" <<
eom;
78 const irep_idt &base_name = c.get_base_name();
83 error() <<
"identifier `" << base_name <<
"' already in scope"
90 id.identifier = c.get_name();
91 id.class_identifier=union_symbol.
name;
107 typet &declaration_type=declaration.
type();
132 if(final_type.
id()!=ID_union)
135 error() <<
"top-level declaration does not declare anything"
152 cpp_declarator_converter.
is_typedef=is_typedef;
161 symbol.
type.
set(ID_C_template, declaration.
find(ID_C_template));
163 ID_C_template_arguments,
164 declaration.
find(ID_C_template_arguments));
180 if(constructor.has_value())
181 symbol.
value = constructor.value();
void convert(cpp_linkage_spect &)
const componentst & components() const
dstringt has one field, an unsigned integer no which is an index into a static table of strings.
void convert_non_template_declaration(cpp_declarationt &declaration)
const cpp_storage_spect & storage_spec() const
void move_to_operands(exprt &expr)
Move the given argument to the end of exprt's operands.
void elaborate_class_template(const typet &type)
elaborate class template instances
The type of an expression, extends irept.
typet type
Type of symbol.
const irept & find(const irep_namet &name) const
A codet representing the declaration of a local variable.
void convert_anonymous_union(cpp_declarationt &declaration, codet &new_code)
symbolt & convert(const typet &type, const cpp_storage_spect &storage_spec, const cpp_member_spect &member_spec, cpp_declaratort &declarator)
Base class for all expressions.
optionalt< codet > cpp_constructor(const source_locationt &source_location, const exprt &object, const exprt::operandst &operands)
irep_idt base_name
Base (non-scoped) name.
std::string to_string(const string_not_contains_constraintt &expr)
Used for debug printing.
void name_anon_struct_union()
bool contains(const irep_idt &base_name_to_lookup)
const declaratorst & declarators() const
const cpp_member_spect & member_spec() const
bool cpp_is_pod(const typet &type) const
typet & type()
Return the type of the expression.
void typecheck_type(typet &) override
bool get_bool(const irep_namet &name) const
bool has_operands() const
Return true if there is at least one operand.
symbolt & get_writeable_ref(const irep_idt &name)
Find a symbol in the symbol table for read-write access.
cpp_scopet & current_scope()
source_locationt source_location
const source_locationt & source_location() const
symbol_exprt cpp_symbol_expr(const symbolt &symbol)
void make_already_typechecked(typet &dest)
symbol_tablet & symbol_table
const irep_idt & id() const
void convert_template_declaration(cpp_declarationt &declaration)
virtual symbolt * get_writeable(const irep_idt &name) override
Find a symbol in the symbol table for read-write access.
exprt value
Initial value of symbol.
const typet & follow(const typet &) const
Resolve type symbol to the type it points to.
const irep_idt & get(const irep_namet &name) const
source_locationt location
Source code location of definition of symbol.
void set(const irep_namet &name, const irep_idt &value)
static bool has_auto(const typet &type)
const union_typet & to_union_type(const typet &type)
Cast a typet to a union_typet.
void reserve_operands(operandst::size_type n)
const source_locationt & source_location() const
irep_idt name
The unique identifier.
cpp_idt & insert(const irep_idt &_base_name)
Data structure for representing an arbitrary statement in a program.