cprover
Loading...
Searching...
No Matches
value_set_domain_fi.cpp
Go to the documentation of this file.
1/*******************************************************************\
2
3Module: Value Set Domain (Flow Insensitive)
4
5Author: Daniel Kroening, kroening@kroening.com
6 CM Wintersteiger
7
8\*******************************************************************/
9
12
13#include "value_set_domain_fi.h"
14
15#include <util/std_code.h>
16
18 const namespacet &ns,
19 const irep_idt &function_from,
20 locationt from_l,
21 const irep_idt &function_to,
22 locationt to_l)
23{
24 value_set.changed = false;
25
26 value_set.set_from(function_from, from_l->location_number);
27 value_set.set_to(function_to, to_l->location_number);
28
29 // std::cout << "transforming: " <<
30 // from_l->function << " " << from_l->location_number << " to " <<
31 // to_l->function << " " << to_l->location_number << '\n';
32
33 switch(from_l->type())
34 {
35 case GOTO:
36 // ignore for now
37 break;
38
39 case END_FUNCTION:
41 break;
42
44 case OTHER:
45 case ASSIGN:
46 value_set.apply_code(from_l->get_code(), ns);
47 break;
48
49 case FUNCTION_CALL:
50 value_set.do_function_call(function_to, from_l->call_arguments(), ns);
51 break;
52
53 case CATCH:
54 case THROW:
55 case DECL:
56 case DEAD:
57 case ATOMIC_BEGIN:
58 case ATOMIC_END:
59 case START_THREAD:
60 case END_THREAD:
61 case LOCATION:
62 case SKIP:
63 case ASSERT:
64 case ASSUME:
65 case INCOMPLETE_GOTO:
67 // do nothing
68 break;
69 }
70
71 return (value_set.changed);
72}
dstringt has one field, an unsigned integer no which is an index into a static table of strings.
Definition dstring.h:37
A namespacet is essentially one or two symbol tables bound together, to allow for symbol lookups in t...
Definition namespace.h:91
bool transform(const namespacet &ns, const irep_idt &function_from, locationt from_l, const irep_idt &function_to, locationt to_l) override
void set_from(const irep_idt &function, unsigned inx)
void set_to(const irep_idt &function, unsigned inx)
void apply_code(const codet &code, const namespacet &ns)
void do_end_function(const exprt &lhs, const namespacet &ns)
void do_function_call(const irep_idt &function, const exprt::operandst &arguments, const namespacet &ns)
@ FUNCTION_CALL
@ ATOMIC_END
@ DEAD
@ LOCATION
@ END_FUNCTION
@ ASSIGN
@ ASSERT
@ SET_RETURN_VALUE
@ ATOMIC_BEGIN
@ CATCH
@ END_THREAD
@ SKIP
@ NO_INSTRUCTION_TYPE
@ START_THREAD
@ THROW
@ DECL
@ OTHER
@ GOTO
@ INCOMPLETE_GOTO
@ ASSUME
Value Set (Flow Insensitive)