25 std::set<dereference_exprt> &dest)
28 if(e.
id() == ID_dereference)
39 for(goto_programt::instructionst::iterator it=
40 goto_function.body.instructions.begin();
41 it!=goto_function.body.instructions.end();
44 std::set<dereference_exprt> deref_expr_w, deref_expr_r;
48 auto a = it->get_assign();
53 if(deref_expr_r.size()==1)
73 goto_function.body.insert_before_swap(it);
81 if(a.lhs().id()==ID_dereference)
96 goto_function.body.insert_before_swap(it);
115 auto maybe_symbol=symbol_table.
lookup(id_r);
117 mm_io_r=maybe_symbol->symbol_expr();
119 maybe_symbol=symbol_table.
lookup(id_w);
124 mm_io(mm_io_r, mm_io_w, f.second, ns);
codet representation of a function call statement.
const parameterst & parameters() const
Operator to dereference a pointer.
dstringt has one field, an unsigned integer no which is an index into a static table of strings.
Base class for all expressions.
void visit_pre(std::function< void(exprt &)>)
typet & type()
Return the type of the expression.
A collection of goto functions.
function_mapt function_map
::goto_functiont goto_functiont
symbol_tablet symbol_table
Symbol table.
goto_functionst goto_functions
GOTO functions.
static instructiont make_function_call(const code_function_callt &_code, const source_locationt &l=source_locationt::nil())
Create a function call instruction.
The trinary if-then-else operator.
const irep_idt & id() const
A namespacet is essentially one or two symbol tables bound together, to allow for symbol lookups in t...
const irep_idt & get_identifier() const
const symbolt * lookup(const irep_idt &name) const
Find a symbol in the symbol table for read-only access.
class symbol_exprt symbol_expr() const
Produces a symbol_exprt for a symbol.
Semantic type conversion.
The type of an expression, extends irept.
void mm_io(const exprt &mm_io_r, const exprt &mm_io_w, goto_functionst::goto_functiont &goto_function, const namespacet &ns)
void collect_deref_expr(const exprt &src, std::set< dereference_exprt > &dest)
Perform Memory-mapped I/O instrumentation.
API to expression classes for Pointers.
const dereference_exprt & to_dereference_expr(const exprt &expr)
Cast an exprt to a dereference_exprt.
optionalt< exprt > size_of_expr(const typet &type, const namespacet &ns)
exprt integer_address(const exprt &pointer)
Various predicates over pointers in programs.
symbol_exprt return_value_symbol(const irep_idt &identifier, const namespacet &ns)
produces the symbol that is used to store the return value of the function with the given identifier
Replace function returns by assignments to global variables.
bool replace_expr(const exprt &what, const exprt &by, exprt &dest)
#define CHECK_RETURN(CONDITION)
const symbol_exprt & to_symbol_expr(const exprt &expr)
Cast an exprt to a symbol_exprt.
const code_typet & to_code_type(const typet &type)
Cast a typet to a code_typet.