cprover
cpp_storage_spec.h
Go to the documentation of this file.
1 /*******************************************************************\
2 
3 Module:
4 
5 Author: Daniel Kroening, kroening@cs.cmu.edu
6 
7 \*******************************************************************/
8 
9 
10 #ifndef CPROVER_CPP_CPP_STORAGE_SPEC_H
11 #define CPROVER_CPP_CPP_STORAGE_SPEC_H
12 
13 #include <util/source_location.h>
14 
16 {
17 public:
18  cpp_storage_spect():irept(ID_cpp_storage_spec)
19  {
20  }
21 
23  {
24  return static_cast<source_locationt &>(add(ID_C_source_location));
25  }
26 
27  const source_locationt &location() const
28  {
29  return static_cast<const source_locationt &>(find(ID_C_source_location));
30  }
31 
32  bool is_static() const { return get_bool(ID_static); }
33  bool is_extern() const { return get_bool(ID_extern); }
34  bool is_auto() const { return get_bool(ID_auto); }
35  bool is_register() const { return get_bool(ID_register); }
36  bool is_mutable() const { return get_bool(ID_mutable); }
37  bool is_thread_local() const { return get_bool(ID_thread_local); }
38  bool is_asm() const { return get_bool(ID_asm); }
39 
40  void set_static() { set(ID_static, true); }
41  void set_extern() { set(ID_extern, true); }
42  void set_auto() { set(ID_auto, true); }
43  void set_register() { set(ID_register, true); }
44  void set_mutable() { set(ID_mutable, true); }
45  void set_thread_local() { set(ID_thread_local, true); }
46  void set_asm() { set(ID_asm, true); }
47 
48  bool is_empty() const
49  {
50  return !is_static() && !is_extern() && !is_auto() &&
51  !is_register() && !is_mutable() && !is_thread_local() &&
52  !is_asm();
53  }
54 };
55 
56 #endif // CPROVER_CPP_CPP_STORAGE_SPEC_H
bool is_mutable() const
bool is_asm() const
bool is_auto() const
bool is_register() const
bool get_bool(const irep_namet &name) const
Definition: irep.cpp:239
bool is_empty() const
source_locationt & location()
bool is_extern() const
bool is_static() const
Base class for tree-like data structures with sharing.
Definition: irep.h:156
bool is_thread_local() const
irept & add(const irep_namet &name)
Definition: irep.cpp:305
const irept & find(const irep_namet &name) const
Definition: irep.cpp:284
void set(const irep_namet &name, const irep_idt &value)
Definition: irep.h:286
const source_locationt & location() const