Go to the documentation of this file.
19 if(instruction.is_start_thread())
35 assert(end->is_end_function());
51 end->source_location.set_comment(
"mutexes must not be locked on thread exit");
57 std::set<irep_idt> thread_fkts;
65 for(
const auto &instruction : f_it->second.body.instructions)
66 if(instruction.is_function_call())
68 const exprt &
function=
70 if(
function.
id()==ID_symbol)
77 for(
const auto &fkt : thread_fkts)
87 symbol_tablet::symbolst::const_iterator f_it =
100 if(code_assign.
lhs().
type()==lock_type)
103 f_it->second.symbol_expr(),
104 {address_of_exprt(code_assign.lhs()),
105 address_of_exprt(string_constantt(
"mutex-init"))});
118 symbol_tablet::symbolst::const_iterator lock_entry =
131 if(lock_type.
id()!=ID_pointer)
#define Forall_goto_program_instructions(it, program)
void mutex_init_instrumentation(const symbol_tablet &symbol_table, goto_programt &goto_program, typet lock_type)
The type of an expression, extends irept.
Base class for all expressions.
function_mapt function_map
static bool has_start_thread(const goto_programt &goto_program)
static instructiont make_function_call(const code_function_callt &_code, const source_locationt &l=source_locationt::nil())
Create a function call instruction.
typet & type()
Return the type of the expression.
codet representation of a function call statement.
const code_typet & to_code_type(const typet &type)
Cast a typet to a code_typet.
static instructiont make_assertion(const exprt &g, const source_locationt &l=source_locationt::nil())
The null pointer constant.
A base class for expressions that are predicates, i.e., Boolean-typed, and that take exactly two argu...
pointer_typet pointer_type(const typet &subtype)
const symbol_exprt & to_symbol_expr(const exprt &expr)
Cast an exprt to a symbol_exprt.
const irep_idt & id() const
const code_function_callt & to_code_function_call(const codet &code)
const parameterst & parameters() const
const pointer_typet & to_pointer_type(const typet &type)
Cast a typet to a pointer_typet.
#define Forall_goto_functions(it, functions)
instructionst instructions
The list of instructions in the goto program.
goto_functionst goto_functions
GOTO functions.
const code_assignt & to_code_assign(const codet &code)
const symbolst & symbols
Read-only field, used to look up symbols given their names.
A generic container class for the GOTO intermediate representation of one function.
targett insert_after(const_targett target)
Insertion after the instruction pointed-to by the given instruction iterator target.
#define forall_goto_functions(it, functions)
Operator to return the address of an object.
void insert_before_swap(targett target)
Insertion that preserves jumps to "target".
A codet representing an assignment in the program.
void thread_exit_instrumentation(goto_programt &goto_program)
const source_locationt & source_location() const
symbol_tablet symbol_table
Symbol table.
instructionst::iterator targett