cprover
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/std_expr.h>
16 #include <util/symbol_table.h>
17 #include <util/namespace.h>
18 
20 
21 #include <set>
22 
23 #include "cone_of_influence.h"
24 
26 {
27  public:
29  const exprt &_overflow_var,
30  symbol_tablet &_symbol_table) :
31  program(_program),
32  symbol_table(_symbol_table),
33  overflow_var(_overflow_var),
35  {
36  }
37 
38  void add_overflow_checks();
43 
44  void overflow_expr(const exprt &expr, expr_sett &cases);
45  void overflow_expr(const exprt &expr, exprt &overflow);
46 
47  protected:
50 
53 
54  void fix_types(binary_exprt &overflow);
55 
59 
61  std::set<unsigned> checked;
62 };
63 
64 #endif // CPROVER_GOTO_INSTRUMENT_ACCELERATE_OVERFLOW_INSTRUMENTER_H
A base class for binary expressions.
Definition: std_expr.h:551
Base class for all expressions.
Definition: expr.h:54
A generic container class for the GOTO intermediate representation of one function.
Definition: goto_program.h:74
instructionst::iterator targett
Definition: goto_program.h:550
std::list< targett > targetst
Definition: goto_program.h:552
A namespacet is essentially one or two symbol tables bound together, to allow for symbol lookups in t...
Definition: namespace.h:92
overflow_instrumentert(goto_programt &_program, const exprt &_overflow_var, symbol_tablet &_symbol_table)
std::set< unsigned > checked
void fix_types(binary_exprt &overflow)
void accumulate_overflow(goto_programt::targett t, const exprt &expr, goto_programt::targetst &added)
void overflow_expr(const exprt &expr, expr_sett &cases)
The symbol table.
Definition: symbol_table.h:20
Loop Acceleration.
std::unordered_set< exprt, irep_hash > expr_sett
Concrete Goto Program.
API to expression classes.
Author: Diffblue Ltd.