CBMC
cpp_enum_type.cpp
Go to the documentation of this file.
1
/*******************************************************************\
2
3
Module: C++ Language Type Checking
4
5
Author: Daniel Kroening, kroening@cs.cmu.edu
6
7
\*******************************************************************/
8
11
12
#include "
cpp_enum_type.h
"
13
14
cpp_enum_typet::cpp_enum_typet
():
typet
(ID_c_enum)
15
{
16
}
17
18
irep_idt
cpp_enum_typet::generate_anon_tag
()
const
19
{
20
// This will only clash with anon enums that would have
21
// clashes on the enum constants anyway.
22
23
const
irept::subt
&b=
body
().
get_sub
();
24
25
std::string
result
=
"#anonE"
;
26
27
for
(
const
auto
&value : b)
28
{
29
result
+=
'#'
;
30
result
+=
id2string
(value.get(ID_name));
31
}
32
33
return
result
;
34
}
dstringt
dstringt has one field, an unsigned integer no which is an index into a static table of strings.
Definition:
dstring.h:36
typet
The type of an expression, extends irept.
Definition:
type.h:28
cpp_enum_typet::generate_anon_tag
irep_idt generate_anon_tag() const
Definition:
cpp_enum_type.cpp:18
messaget::result
mstreamt & result() const
Definition:
message.h:409
id2string
const std::string & id2string(const irep_idt &d)
Definition:
irep.h:47
cpp_enum_typet::body
const irept & body() const
Definition:
cpp_enum_type.h:39
sharing_treet< irept, forward_list_as_mapt< irep_idt, irept > >::subt
typename dt::subt subt
Definition:
irep.h:160
cpp_enum_type.h
cpp_enum_typet::cpp_enum_typet
cpp_enum_typet()
Definition:
cpp_enum_type.cpp:14
irept::get_sub
subt & get_sub()
Definition:
irep.h:456
src
cpp
cpp_enum_type.cpp
Generated by
1.8.17