CBMC
write_stack_entry.h
Go to the documentation of this file.
1 /*******************************************************************\
2 
3  Module: Analyses Variable Sensitivity
4 
5  Author: DiffBlue Limited.
6 
7 \*******************************************************************/
8 
11 
12 #ifndef CPROVER_ANALYSES_VARIABLE_SENSITIVITY_WRITE_STACK_ENTRY_H
13 #define CPROVER_ANALYSES_VARIABLE_SENSITIVITY_WRITE_STACK_ENTRY_H
14 
15 #include "abstract_object.h"
16 
18 class namespacet;
19 
21 {
22 public:
23  virtual ~write_stack_entryt() = default;
24  virtual std::pair<exprt, bool> get_access_expr() const = 0;
25  virtual bool try_squash_in(
26  std::shared_ptr<const write_stack_entryt> new_entry,
27  const abstract_environmentt &enviroment,
28  const namespacet &ns);
29 };
30 
32 {
33 public:
34  explicit simple_entryt(exprt expr);
35  std::pair<exprt, bool> get_access_expr() const override;
36 
37 private:
39 };
40 
42 {
43 public:
44  explicit offset_entryt(abstract_object_pointert offset_value);
45  std::pair<exprt, bool> get_access_expr() const override;
46  bool try_squash_in(
47  std::shared_ptr<const write_stack_entryt> new_entry,
48  const abstract_environmentt &enviroment,
49  const namespacet &ns) override;
50 
51 private:
53 };
54 
55 #endif // CPROVER_ANALYSES_VARIABLE_SENSITIVITY_WRITE_STACK_ENTRY_H
simple_entryt
Definition: write_stack_entry.h:31
write_stack_entryt::try_squash_in
virtual bool try_squash_in(std::shared_ptr< const write_stack_entryt > new_entry, const abstract_environmentt &enviroment, const namespacet &ns)
Try to combine a new stack element with the current top of the stack.
Definition: write_stack_entry.cpp:22
abstract_object_pointert
sharing_ptrt< class abstract_objectt > abstract_object_pointert
Definition: abstract_object.h:69
offset_entryt::offset
abstract_object_pointert offset
Definition: write_stack_entry.h:52
offset_entryt
Definition: write_stack_entry.h:41
write_stack_entryt
Definition: write_stack_entry.h:20
abstract_environmentt
Definition: abstract_environment.h:40
exprt
Base class for all expressions.
Definition: expr.h:55
abstract_object.h
namespacet
A namespacet is essentially one or two symbol tables bound together, to allow for symbol lookups in t...
Definition: namespace.h:90
write_stack_entryt::~write_stack_entryt
virtual ~write_stack_entryt()=default
simple_entryt::simple_entry
exprt simple_entry
Definition: write_stack_entry.h:38
simple_entryt::get_access_expr
std::pair< exprt, bool > get_access_expr() const override
Get the expression part needed to read this stack entry.
Definition: write_stack_entry.cpp:43
simple_entryt::simple_entryt
simple_entryt(exprt expr)
Build a simple entry based off a single expression.
Definition: write_stack_entry.cpp:32
offset_entryt::try_squash_in
bool try_squash_in(std::shared_ptr< const write_stack_entryt > new_entry, const abstract_environmentt &enviroment, const namespacet &ns) override
Try to combine a new stack element with the current top of the stack.
Definition: write_stack_entry.cpp:73
offset_entryt::offset_entryt
offset_entryt(abstract_object_pointert offset_value)
Definition: write_stack_entry.cpp:48
offset_entryt::get_access_expr
std::pair< exprt, bool > get_access_expr() const override
Get the expression part needed to read this stack entry.
Definition: write_stack_entry.cpp:61
write_stack_entryt::get_access_expr
virtual std::pair< exprt, bool > get_access_expr() const =0