Go to the documentation of this file.
24 "msc_try_finally expects two arguments",
62 "msc_try_except expects three arguments",
93 "try_catch expects at least two arguments",
122 for(std::size_t i=1; i<code.
operands().size(); i++)
127 exception_list.push_back(
132 catch_push_instruction->targets.push_back(tmp.
instructions.begin());
139 catch_push_instruction->code_nonconst() = push_catch_code;
152 "CPROVER_try_catch expects two arguments",
219 "CPROVER_try_finally expects two arguments",
240 symbol_tablet::symbolst::const_iterator s_it=
252 new_symbol.
mode = mode;
321 codet copied_instruction = *destructor;
323 convert(copied_instruction, dest, mode);
dstringt has one field, an unsigned integer no which is an index into a static table of strings.
void convert_msc_try_finally(const codet &code, goto_programt &dest, const irep_idt &mode)
goto_programt::targett leave_target
void descend_tree()
Walks the current node down to its child.
void convert(const codet &code, goto_programt &dest, const irep_idt &mode)
converts 'code' and appends the result to 'dest'
typet type
Type of symbol.
void convert_CPROVER_try_finally(const codet &code, goto_programt &dest, const irep_idt &mode)
void convert_try_catch(const codet &code, goto_programt &dest, const irep_idt &mode)
goto_programt::targett throw_target
targett add(instructiont &&instruction)
Adds a given instruction at the end.
optionalt< codet > & get_destructor(node_indext index)
Fetches the destructor value for the passed-in node index.
irep_idt base_name
Base (non-scoped) name.
Pushes an exception handler, of the form: exception_tag1 -> label1 exception_tag2 -> label2 ....
Expression to hold a symbol (variable)
Pops an exception handler from the stack of active handlers (i.e.
codet representation of an if-then-else statement.
static instructiont make_assignment(const code_assignt &_code, const source_locationt &l=source_locationt::nil())
Create an assignment instruction.
static instructiont make_goto(targett _target, const source_locationt &l=source_locationt::nil())
const irep_idt & get(const irep_idt &name) const
#define INVARIANT_WITH_DIAGNOSTICS(CONDITION, REASON,...)
Same as invariant, with one or more diagnostics attached Diagnostics can be of any type that has a sp...
void set_leave(goto_programt::targett _leave_target)
const codet & to_code(const exprt &expr)
symbol_exprt exception_flag(const irep_idt &mode)
struct goto_convertt::targetst targets
irep_idt mode
Language mode.
void add(const codet &destructor)
Adds a destructor to the current stack, attaching itself to the current node.
void unwind_destructor_stack(const source_locationt &source_location, goto_programt &dest, const irep_idt &mode, optionalt< node_indext > destructor_start_point={}, optionalt< node_indext > destructor_end_point={})
Unwinds the destructor stack and creates destructors for each node between destructor_start_point and...
void convert_CPROVER_try_catch(const codet &code, goto_programt &dest, const irep_idt &mode)
static instructiont make_skip(const source_locationt &l=source_locationt::nil())
void convert_CPROVER_throw(const codet &code, goto_programt &dest, const irep_idt &mode)
const source_locationt & find_source_location() const
Get a source_locationt from the expression or from its operands (non-recursively).
exception_listt & exception_list()
void set_throw(goto_programt::targett _throw_target)
nonstd::optional< T > optionalt
void destructive_append(goto_programt &p)
Appends the given program p to *this. p is destroyed.
instructionst instructions
The list of instructions in the goto program.
void set_current_node(optionalt< node_indext > val)
Sets the current node.
void convert_msc_leave(const codet &code, goto_programt &dest, const irep_idt &mode)
destructor_treet destructor_stack
std::vector< exception_list_entryt > exception_listt
void convert_msc_try_except(const codet &code, goto_programt &dest, const irep_idt &mode)
const symbolst & symbols
Read-only field, used to look up symbols given their names.
node_indext get_current_node() const
Gets the node that the next addition will be added to as a child.
A generic container class for the GOTO intermediate representation of one function.
virtual std::pair< symbolt &, bool > insert(symbolt symbol)=0
Move or copy a new symbol to the symbol table.
symbol_table_baset & symbol_table
source_locationt & add_source_location()
node_indext leave_stack_node
The Boolean constant true.
const source_locationt & source_location() const
irep_idt name
The unique identifier.
instructionst::iterator targett
node_indext throw_stack_node
static instructiont make_catch(const source_locationt &l=source_locationt::nil())
Data structure for representing an arbitrary statement in a program.
goto_programt::targett return_target