Go to the documentation of this file.
39 codet new_code(ID_decl_block);
47 declarator.
name()=cpp_name;
52 cpp_declarator_converter.
convert(declaration, declarator);
57 error() <<
"anonymous union is not POD" <<
eom;
69 if(c.type().id() == ID_code)
73 <<
"' shall not have function members" <<
eom;
77 const irep_idt &base_name = c.get_base_name();
82 error() <<
"identifier '" << base_name <<
"' already in scope" <<
eom;
88 id.identifier = c.get_name();
89 id.class_identifier=union_symbol.
name;
105 typet &declaration_type=declaration.
type();
130 if(final_type.
id()!=ID_union)
133 error() <<
"top-level declaration does not declare anything"
149 cpp_declarator_converter.
is_typedef=is_typedef;
158 error() <<
"void-typed symbol not permitted" <<
eom;
165 symbol.
type.
set(ID_C_template, declaration.
find(ID_C_template));
167 ID_C_template_arguments,
168 declaration.
find(ID_C_template_arguments));
184 if(constructor.has_value())
185 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.
const union_typet & to_union_type(const typet &type)
Cast a typet to a union_typet.
void convert_non_template_declaration(cpp_declarationt &declaration)
const cpp_storage_spect & storage_spec() const
void elaborate_class_template(const typet &type)
elaborate class template instances
The type of an expression, extends irept.
const irept & find(const irep_idt &name) const
typet type
Type of symbol.
symbolt & convert(const typet &type, const cpp_storage_spect &storage_spec, const cpp_member_spect &member_spec, cpp_declaratort &declarator)
A codet representing the declaration of a local variable.
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
const irep_idt & get(const irep_idt &name) const
bool cpp_is_pod(const typet &type) const
typet & type()
Return the type of the expression.
void typecheck_type(typet &) override
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
void set(const irep_idt &name, const irep_idt &value)
const source_locationt & source_location() const
symbol_exprt cpp_symbol_expr(const symbolt &symbol)
symbol_tablet & symbol_table
const irep_idt & id() const
void convert_template_declaration(cpp_declarationt &declaration)
exprt value
Initial value of symbol.
const typet & follow(const typet &) const
Resolve type symbol to the type it points to.
source_locationt location
Source code location of definition of symbol.
static bool has_auto(const typet &type)
codet convert_anonymous_union(cpp_declarationt &declaration)
void add_to_operands(const exprt &expr)
Add the given argument to the end of exprt's operands.
static void make_already_typechecked(typet &type)
void reserve_operands(operandst::size_type n)
const source_locationt & source_location() const
irep_idt name
The unique identifier.
bool get_bool(const irep_idt &name) const
cpp_idt & insert(const irep_idt &_base_name)
Data structure for representing an arbitrary statement in a program.