10 #ifndef CPROVER_UTIL_IREP_H 11 #define CPROVER_UTIL_IREP_H 62 #define forall_irep(it, irep) \ 63 for(irept::subt::const_iterator it=(irep).begin(); \ 64 it!=(irep).end(); ++it) 66 #define Forall_irep(it, irep) \ 67 for(irept::subt::iterator it=(irep).begin(); \ 68 it!=(irep).end(); ++it) 70 #define forall_named_irep(it, irep) \ 71 for(irept::named_subt::const_iterator it=(irep).begin(); \ 72 it!=(irep).end(); ++it) 74 #define Forall_named_irep(it, irep) \ 75 for(irept::named_subt::iterator it=(irep).begin(); \ 76 it!=(irep).end(); ++it) 91 typedef std::vector<irept>
subt;
98 typedef std::list<std::pair<irep_namet, irept> >
named_subt;
125 assert(
data->ref_count!=0);
128 std::cout <<
"COPY " <<
data <<
" " <<
data->ref_count <<
'\n';
140 std::cout <<
"COPY MOVE\n";
149 std::cout <<
"ASSIGN\n";
170 std::cout <<
"ASSIGN MOVE\n";
173 std::swap(
data, irep.data);
215 {
add(name).
id(value); }
218 void set(
const irep_namet &name,
const long long value);
228 return !(*
this==other);
252 std::size_t
hash()
const;
257 std::string
pretty(
unsigned indent=0,
unsigned max_indent=0)
const;
261 {
return !name.
empty() && name[0]==
'#'; }
280 mutable std::size_t hash_code;
301 std::swap(d.hash_code, hash_code);
392 #endif // CPROVER_UTIL_IREP_H
const std::string & id2string(const irep_idt &d)
int compare(const irept &i) const
defines ordering on the internal representation
std::string pretty(unsigned indent=0, unsigned max_indent=0) const
std::vector< irept > subt
void move_to_sub(irept &irep)
bool full_eq(const irept &other) const
signed int get_int(const irep_namet &name) const
void id(const irep_idt &_data)
const irept & get_nil_irep()
bool get_bool(const irep_namet &name) const
const char * as_string(coverage_criteriont c)
bool operator!=(const irept &other) const
const irep_idt & id() const
const std::string & name2string(const irep_namet &n)
std::size_t operator()(const irept &irep) const
irept & operator=(const irept &irep)
std::size_t operator()(const irept &irep) const
dstring_hash irep_id_hash
static void nonrecursive_destructor(dt *old_data)
Does the same as remove_ref, but using an explicit stack instead of recursion.
named_subt & get_comments()
Base class for tree-like data structures with sharing.
std::map< irep_namet, irept > named_subt
irept & operator=(irept &&irep)
const named_subt & get_comments() const
bool operator<(const irept &other) const
defines ordering on the internal representation
static void remove_ref(dt *old_data)
named_subt & get_named_sub()
const named_subt & get_named_sub() const
bool ordering(const irept &other) const
defines ordering on the internal representation
static bool is_comment(const irep_namet &name)
std::size_t full_hash() const
bool operator()(const irept &i1, const irept &i2) const
irept & add(const irep_namet &name)
const std::string & get_string(const irep_namet &name) const
const std::string & id_string() const
unsigned int get_unsigned_int(const irep_namet &name) const
long long get_long_long(const irep_namet &name) const
bool operator==(const irept &other) const
irept(const irep_idt &_id)
std::size_t get_size_t(const irep_namet &name) const
const irept & find(const irep_namet &name) const
const subt & get_sub() const
void move_to_named_sub(const irep_namet &name, irept &irep)