20 if(instruction.is_start_thread())
49 source_location.
set_comment(
"mutexes must not be locked on thread exit");
56 std::set<irep_idt> thread_fkts;
64 for(
const auto &instruction : gf_entry.second.body.instructions)
65 if(instruction.is_function_call())
67 const exprt &
function = instruction.call_function();
68 if(
function.
id()==ID_symbol)
75 for(
const auto &fkt : thread_fkts)
85 symbol_tablet::symbolst::const_iterator f_it =
88 if(f_it==symbol_table.
symbols.end())
95 if(it->assign_lhs().type() == lock_type)
98 f_it->second.symbol_expr(),
99 {address_of_exprt(it->assign_lhs()),
100 address_of_exprt(string_constantt(
"mutex-init"))});
113 symbol_tablet::symbolst::const_iterator lock_entry =
126 if(lock_type.
id()!=ID_pointer)
133 gf_entry.second.body,
pointer_typet pointer_type(const typet &subtype)
Operator to return the address of an object.
A base class for expressions that are predicates, i.e., Boolean-typed, and that take exactly two argu...
goto_instruction_codet representation of a function call statement.
const parameterst & parameters() const
Base class for all expressions.
const source_locationt & source_location() const
function_mapt function_map
symbol_tablet symbol_table
Symbol table.
goto_functionst goto_functions
GOTO functions.
A generic container class for the GOTO intermediate representation of one function.
instructionst instructions
The list of instructions in the goto program.
void insert_before_swap(targett target)
Insertion that preserves jumps to "target".
instructionst::iterator targett
targett insert_after(const_targett target)
Insertion after the instruction pointed-to by the given instruction iterator target.
static instructiont make_function_call(const code_function_callt &_code, const source_locationt &l=source_locationt::nil())
Create a function call instruction.
static instructiont make_assertion(const exprt &g, const source_locationt &l=source_locationt::nil())
const irep_idt & id() const
The null pointer constant.
void set_comment(const irep_idt &comment)
const symbolst & symbols
Read-only field, used to look up symbols given their names.
The type of an expression, extends irept.
#define Forall_goto_program_instructions(it, program)
API to expression classes for Pointers.
const pointer_typet & to_pointer_type(const typet &type)
Cast a typet to a pointer_typet.
#define DATA_INVARIANT(CONDITION, REASON)
This condition should be used to document that assumptions that are made on goto_functions,...
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.
void thread_exit_instrumentation(goto_programt &goto_program)
void mutex_init_instrumentation(const symbol_tablet &symbol_table, goto_programt &goto_program, typet lock_type)
static bool has_start_thread(const goto_programt &goto_program)