cprover
Loading...
Searching...
No Matches
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
}
cpp_enum_typet::cpp_enum_typet
cpp_enum_typet()
Definition
cpp_enum_type.cpp:14
cpp_enum_typet::body
const irept & body() const
Definition
cpp_enum_type.h:39
cpp_enum_typet::generate_anon_tag
irep_idt generate_anon_tag() const
Definition
cpp_enum_type.cpp:18
irept::get_sub
subt & get_sub()
Definition
irep.h:448
sharing_treet< irept, forward_list_as_mapt< irep_idt, irept > >::subt
typename dt::subt subt
Definition
irep.h:152
typet::typet
typet()
Definition
type.h:31
cpp_enum_type.h
C++ Language Type Checking.
id2string
const std::string & id2string(const irep_idt &d)
Definition
irep.h:44
irep_idt
dstringt irep_idt
Definition
verification_result.h:16
cpp
cpp_enum_type.cpp
Generated by
1.13.2