23 error() <<
"msc_try_finally expects two arguments" <<
eom;
61 error() <<
"msc_try_except expects three arguments" <<
eom;
77 error() <<
"leave without target" <<
eom;
104 catch_instruction->make_catch();
105 catch_instruction->code.set_statement(ID_catch);
110 const irept exceptions=code.
op0().
find(ID_exception_list);
115 catch_instruction->code.add(ID_exception_list).get_sub();
116 exception_list.resize(exceptions_sub.size());
117 for(
size_t i=0; i<exceptions_sub.size(); ++i)
118 exception_list[i].
id(exceptions_sub[i].
id());
127 catch_instruction->code.add(ID_label).get_sub();
128 handlers_list.resize(handlers_sub.size());
129 for(
size_t i=0; i<handlers_sub.size(); ++i)
130 handlers_list[i].
id(handlers_sub[i].
id());
136 catch_instruction->code.get_sub().resize(1);
137 catch_instruction->code.get_sub()[0]=code.
op0().
op0();
143 end_target->make_skip();
159 catch_push_instruction->make_catch();
160 catch_push_instruction->code.set_statement(ID_catch);
166 catch_push_instruction->code.
add(ID_exception_list).
get_sub();
171 end_target->make_skip();
178 catch_pop_instruction->make_catch();
179 catch_pop_instruction->code.set_statement(ID_catch);
184 for(
unsigned i=1; i<code.
operands().size(); i++)
189 exception_list.push_back(
irept(block.
get(ID_exception_id)));
193 catch_push_instruction->targets.push_back(tmp.
instructions.begin());
211 error() <<
"CPROVER_try_catch expects two arguments" <<
eom;
285 error() <<
"CPROVER_try_finally expects two arguments" <<
eom;
306 symbol_tablet::symbolst::const_iterator s_it=
326 std::size_t final_stack_size,
338 std::size_t final_stack_size,
347 while(destructor_stack.size()>final_stack_size)
349 codet d_code=destructor_stack.back();
353 destructor_stack.pop_back();
359 old_stack.swap(destructor_stack);
irep_idt name
The unique identifier.
const codet & then_case() const
targett add_instruction()
Adds an instruction at the end.
void convert(const codet &code, goto_programt &dest)
converts 'code' and appends the result to 'dest'
symbol_tablet & symbol_table
goto_programt::targett return_target
void unwind_destructor_stack(const source_locationt &, std::size_t stack_size, goto_programt &dest)
std::vector< irept > subt
struct goto_convertt::targetst targets
const exprt & cond() const
instructionst instructions
The list of instructions in the goto program.
const irep_idt & get_function() const
Symbol table entry.This is a symbol in the symbol table, stored in an object of type symbol_tablet...
static mstreamt & eom(mstreamt &m)
goto_programt::targett throw_target
destructor_stackt destructor_stack
The boolean constant true.
void convert_msc_try_finally(const codet &code, goto_programt &dest)
symbol_exprt exception_flag()
goto_programt::targett leave_target
const source_locationt & find_source_location() const
source_locationt source_location
API to expression classes.
const irep_idt & get(const irep_namet &name) const
void convert_CPROVER_try_finally(const codet &code, goto_programt &dest)
std::size_t throw_stack_size
Base class for tree-like data structures with sharing.
void convert_msc_leave(const codet &code, goto_programt &dest)
bool move(symbolt &symbol, symbolt *&new_symbol)
Move a symbol into the symbol table.
bool has_operands() const
A specialization of goto_program_templatet over goto programs in which instructions have codet type...
void convert_CPROVER_try_catch(const codet &code, goto_programt &dest)
void convert_java_try_catch(const codet &code, goto_programt &dest)
typet type
Type of symbol.
std::vector< codet > destructor_stackt
void convert_try_catch(const codet &code, goto_programt &dest)
void set_leave(goto_programt::targett _leave_target)
irep_idt base_name
Base (non-scoped) name.
void set_throw(goto_programt::targett _throw_target)
std::size_t leave_stack_size
const source_locationt & source_location() const
irept & add(const irep_namet &name)
source_locationt & add_source_location()
const codet & to_code(const exprt &expr)
Expression to hold a symbol (variable)
void destructive_append(goto_program_templatet< codeT, guardT > &p)
Appends the given program, which is destroyed.
A statement in a programming language.
void convert_msc_try_except(const codet &code, goto_programt &dest)
const irept & find(const irep_namet &name) const
void convert_CPROVER_throw(const codet &code, goto_programt &dest)
instructionst::iterator targett