CBMC
overflow_instrumenter.h
Go to the documentation of this file.
1 /*******************************************************************\
2 
3 Module: Loop Acceleration
4 
5 Author: Matt Lewis
6 
7 \*******************************************************************/
8 
11 
12 #ifndef CPROVER_GOTO_INSTRUMENT_ACCELERATE_OVERFLOW_INSTRUMENTER_H
13 #define CPROVER_GOTO_INSTRUMENT_ACCELERATE_OVERFLOW_INSTRUMENTER_H
14 
15 #include <util/symbol_table.h>
16 #include <util/namespace.h>
17 
19 
20 #include <set>
21 
22 #include "cone_of_influence.h"
23 
25 {
26  public:
28  const exprt &_overflow_var,
29  symbol_tablet &_symbol_table) :
30  program(_program),
31  symbol_table(_symbol_table),
32  overflow_var(_overflow_var),
34  {
35  }
36 
37  void add_overflow_checks();
42 
43  void overflow_expr(const exprt &expr, expr_sett &cases);
44  void overflow_expr(const exprt &expr, exprt &overflow);
45 
46  protected:
49 
52 
53  void fix_types(binary_exprt &overflow);
54 
58 
60  std::set<unsigned> checked;
61 };
62 
63 #endif // CPROVER_GOTO_INSTRUMENT_ACCELERATE_OVERFLOW_INSTRUMENTER_H
symbol_tablet
The symbol table.
Definition: symbol_table.h:13
overflow_instrumentert::ns
namespacet ns
Definition: overflow_instrumenter.h:59
overflow_instrumentert::overflow_instrumentert
overflow_instrumentert(goto_programt &_program, const exprt &_overflow_var, symbol_tablet &_symbol_table)
Definition: overflow_instrumenter.h:27
exprt
Base class for all expressions.
Definition: expr.h:55
binary_exprt
A base class for binary expressions.
Definition: std_expr.h:582
namespace.h
goto_programt::targetst
std::list< targett > targetst
Definition: goto_program.h:588
namespacet
A namespacet is essentially one or two symbol tables bound together, to allow for symbol lookups in t...
Definition: namespace.h:90
overflow_instrumentert::accumulate_overflow
void accumulate_overflow(goto_programt::targett t, const exprt &expr, goto_programt::targetst &added)
Definition: overflow_instrumenter.cpp:277
overflow_instrumentert::fix_types
void fix_types(binary_exprt &overflow)
Definition: overflow_instrumenter.cpp:260
overflow_instrumentert::symbol_table
symbol_tablet & symbol_table
Definition: overflow_instrumenter.h:56
expr_sett
std::unordered_set< exprt, irep_hash > expr_sett
Definition: cone_of_influence.h:21
overflow_instrumentert
Definition: overflow_instrumenter.h:24
goto_program.h
overflow_instrumentert::overflow_var
const exprt & overflow_var
Definition: overflow_instrumenter.h:57
overflow_instrumentert::checked
std::set< unsigned > checked
Definition: overflow_instrumenter.h:60
cone_of_influence.h
goto_programt
A generic container class for the GOTO intermediate representation of one function.
Definition: goto_program.h:72
symbol_table.h
Author: Diffblue Ltd.
overflow_instrumentert::program
goto_programt & program
Definition: overflow_instrumenter.h:55
overflow_instrumentert::overflow_expr
void overflow_expr(const exprt &expr, expr_sett &cases)
Definition: overflow_instrumenter.cpp:93
overflow_instrumentert::add_overflow_checks
void add_overflow_checks()
Definition: overflow_instrumenter.cpp:29
goto_programt::targett
instructionst::iterator targett
Definition: goto_program.h:586