cprover
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
#include <
util/c_types.h
>
15
16
cpp_enum_typet::cpp_enum_typet
():
typet
(ID_c_enum)
17
{
18
}
19
20
irep_idt
cpp_enum_typet::generate_anon_tag
()
const
21
{
22
// This will only clash with anon enums that would have
23
// clashes on the enum constants anyway.
24
25
const
irept::subt
&b=
body
().
get_sub
();
26
27
std::string
result
=
"#anonE"
;
28
29
forall_irep
(it, b)
30
{
31
result
+=
'#'
;
32
result
+=
id2string
(it->get(ID_name));
33
}
34
35
return
result
;
36
}
dstringt
dstringt has one field, an unsigned integer no which is an index into a static table of strings.
Definition:
dstring.h:37
typet
The type of an expression, extends irept.
Definition:
type.h:29
cpp_enum_typet::generate_anon_tag
irep_idt generate_anon_tag() const
Definition:
cpp_enum_type.cpp:20
messaget::result
mstreamt & result() const
Definition:
message.h:409
id2string
const std::string & id2string(const irep_idt &d)
Definition:
irep.h:44
cpp_enum_typet::body
const irept & body() const
Definition:
cpp_enum_type.h:41
sharing_treet< irept, std::map< irep_namet, irept > >::subt
typename dt::subt subt
Definition:
irep.h:182
cpp_enum_type.h
C++ Language Type Checking.
forall_irep
#define forall_irep(it, irep)
Definition:
irep.h:62
cpp_enum_typet::cpp_enum_typet
cpp_enum_typet()
Definition:
cpp_enum_type.cpp:16
irept::get_sub
subt & get_sub()
Definition:
irep.h:477
c_types.h
cpp
cpp_enum_type.cpp
Generated by
1.8.20