cprover
std_code.h File Reference
#include <cassert>
#include "expr.h"
Include dependency graph for std_code.h:

Go to the source code of this file.

Classes

class  codet
 A statement in a programming language. More...
 
class  code_blockt
 Sequential composition. More...
 
class  code_skipt
 Skip. More...
 
class  code_assignt
 Assignment. More...
 
class  code_declt
 A declaration of a local variable. More...
 
class  code_deadt
 A removal of a local variable. More...
 
class  code_assumet
 An assumption. More...
 
class  code_assertt
 An assertion. More...
 
class  code_ifthenelset
 An if-then-else. More...
 
class  code_switcht
 A ‘switch’ instruction. More...
 
class  code_whilet
 A ‘while’ instruction. More...
 
class  code_dowhilet
 A ‘do while’ instruction. More...
 
class  code_fort
 A ‘for’ instruction. More...
 
class  code_gotot
 A ‘goto’ instruction. More...
 
class  code_function_callt
 A function call. More...
 
class  code_returnt
 Return from a function. More...
 
class  code_labelt
 A label for branch targets. More...
 
class  code_switch_caset
 A switch-case. More...
 
class  code_breakt
 A break for ‘for’ and ‘while’ loops. More...
 
class  code_continuet
 A continue for ‘for’ and ‘while’ loops. More...
 
class  code_asmt
 An inline assembler statement. More...
 
class  code_expressiont
 An expression statement. More...
 
class  side_effect_exprt
 An expression containing a side effect. More...
 
class  side_effect_expr_nondett
 A side effect that returns a non-deterministically chosen value. More...
 
class  side_effect_expr_function_callt
 A function call side effect. More...
 
class  side_effect_expr_throwt
 A side effect that throws an exception. More...
 
class  side_effect_expr_catcht
 A side effect that pushes/pops a catch handler. More...
 
class  code_try_catcht
 A try/catch block. More...
 

Functions

const codetto_code (const exprt &expr)
 
codetto_code (exprt &expr)
 
const code_blocktto_code_block (const codet &code)
 
code_blocktto_code_block (codet &code)
 
const code_assigntto_code_assign (const codet &code)
 
code_assigntto_code_assign (codet &code)
 
const code_decltto_code_decl (const codet &code)
 
code_decltto_code_decl (codet &code)
 
const code_deadtto_code_dead (const codet &code)
 
code_deadtto_code_dead (codet &code)
 
const code_assumetto_code_assume (const codet &code)
 
code_assumetto_code_assume (codet &code)
 
const code_asserttto_code_assert (const codet &code)
 
code_asserttto_code_assert (codet &code)
 
const code_ifthenelsetto_code_ifthenelse (const codet &code)
 
code_ifthenelsetto_code_ifthenelse (codet &code)
 
const code_switchtto_code_switch (const codet &code)
 
code_switchtto_code_switch (codet &code)
 
const code_whiletto_code_while (const codet &code)
 
code_whiletto_code_while (codet &code)
 
const code_dowhiletto_code_dowhile (const codet &code)
 
code_dowhiletto_code_dowhile (codet &code)
 
const code_fortto_code_for (const codet &code)
 
code_fortto_code_for (codet &code)
 
const code_gototto_code_goto (const codet &code)
 
code_gototto_code_goto (codet &code)
 
const code_function_calltto_code_function_call (const codet &code)
 
code_function_calltto_code_function_call (codet &code)
 
const code_returntto_code_return (const codet &code)
 
code_returntto_code_return (codet &code)
 
const code_labeltto_code_label (const codet &code)
 
code_labeltto_code_label (codet &code)
 
const code_switch_casetto_code_switch_case (const codet &code)
 
code_switch_casetto_code_switch_case (codet &code)
 
const code_breaktto_code_break (const codet &code)
 
code_breaktto_code_break (codet &code)
 
const code_continuetto_code_continue (const codet &code)
 
code_continuetto_code_continue (codet &code)
 
code_asmtto_code_asm (codet &code)
 
const code_asmtto_code_asm (const codet &code)
 
code_expressiontto_code_expression (codet &code)
 
const code_expressiontto_code_expression (const codet &code)
 
side_effect_exprtto_side_effect_expr (exprt &expr)
 
const side_effect_exprtto_side_effect_expr (const exprt &expr)
 
side_effect_expr_function_calltto_side_effect_expr_function_call (exprt &expr)
 
const side_effect_expr_function_calltto_side_effect_expr_function_call (const exprt &expr)
 
side_effect_expr_throwtto_side_effect_expr_throw (exprt &expr)
 
const side_effect_expr_throwtto_side_effect_expr_throw (const exprt &expr)
 
static side_effect_expr_catchtto_side_effect_expr_catch (exprt &expr)
 
static const side_effect_expr_catchtto_side_effect_expr_catch (const exprt &expr)
 
const code_try_catchtto_code_try_catch (const codet &code)
 
code_try_catchtto_code_try_catch (codet &code)
 

Function Documentation

◆ to_code() [1/2]

const codet& to_code ( const exprt expr)
inline

Definition at line 49 of file std_code.h.

References irept::id().

Referenced by code_blockt::append(), invariant_sett::apply_code(), value_sett::apply_code(), code_switcht::body(), code_whilet::body(), code_dowhilet::body(), code_fort::body(), goto_program2codet::cleanup_code(), goto_program2codet::cleanup_code_block(), goto_program2codet::cleanup_code_ifthenelse(), dump_ct::cleanup_expr(), goto_convertt::convert(), goto_convertt::convert_block(), goto_convertt::convert_bp_enforce(), jsil_convertt::convert_code(), expr2ct::convert_code_block(), expr2ct::convert_code_decl_block(), expr2ct::convert_code_ifthenelse(), expr2ct::convert_code_switch(), goto_convertt::convert_cpp_delete(), goto_convertt::convert_CPROVER_try_catch(), goto_convertt::convert_CPROVER_try_finally(), goto_convertt::convert_dowhile(), goto_convertt::convert_for(), goto_convert_functionst::convert_function(), cpp_typecheckt::convert_function(), goto_convertt::convert_gcc_switch_case_range(), goto_program2codet::convert_goto_if(), goto_program2codet::convert_goto_switch(), goto_program2codet::convert_goto_while(), goto_convertt::convert_ifthenelse(), java_bytecode_convert_methodt::convert_instructions(), goto_convertt::convert_label(), goto_program2codet::convert_labels(), goto_convertt::convert_msc_try_except(), goto_convertt::convert_msc_try_finally(), goto_program2codet::convert_start_thread(), goto_convertt::convert_start_thread(), expr2ct::convert_statement_expression(), goto_convertt::convert_switch(), goto_convertt::convert_try_catch(), expr2ct::convert_with_precedence(), copy_parent(), cpp_typecheckt::cpp_constructor(), goto_convertt::cpp_new_initializer(), goto_program_dereferencet::dereference_instruction(), flow_insensitive_analysis_baset::do_function_call(), goto_convertt::do_printf(), find_block_position_rec(), code_blockt::find_last_statement(), find_used_functions(), codet::first_statement(), gather_virtual_callsites(), code_try_catcht::get_catch_code(), code_try_catcht::get_catch_decl(), java_bytecode_convert_methodt::get_or_create_block_for_pcrange(), flow_insensitive_abstract_domain_baset::get_return_lhs(), goto_convert(), has_labels(), insert_at_label(), mm2cppt::instruction2cpp(), java_static_lifetime_init(), codet::last_statement(), model_argc_argv(), move_label_ifthenelse(), cpp_typecheckt::move_member_initializers(), mm2cppt::operator()(), jsil_convertt::operator()(), memory_model_tsot::program_order(), goto_convertt::remove_assignment(), goto_convertt::remove_statement_expression(), goto_convertt::remove_temporary_object(), java_bytecode_convert_methodt::replace_goto_target(), static_lifetime_init(), goto_symext::symex_dead(), goto_symext::symex_decl(), goto_symext::symex_other(), jsil_typecheckt::typecheck_block(), c_typecheck_baset::typecheck_block(), java_bytecode_typecheckt::typecheck_code(), c_typecheck_baset::typecheck_code(), java_bytecode_typecheckt::typecheck_expr(), c_typecheck_baset::typecheck_expr_operands(), c_typecheck_baset::typecheck_for(), c_typecheck_baset::typecheck_function_body(), c_typecheck_baset::typecheck_gcc_switch_case_range(), jsil_typecheckt::typecheck_ifthenelse(), c_typecheck_baset::typecheck_ifthenelse(), cpp_typecheckt::typecheck_ifthenelse(), jsil_typecheckt::typecheck_non_type_symbol(), c_typecheck_baset::typecheck_side_effect_statement_expression(), c_typecheck_baset::typecheck_start_thread(), cpp_typecheckt::typecheck_switch(), cpp_typecheckt::typecheck_try_catch(), cpp_typecheckt::typecheck_while(), flow_insensitive_analysis_baset::visit(), and yyjsilparse().

◆ to_code() [2/2]

codet& to_code ( exprt expr)
inline

Definition at line 55 of file std_code.h.

References irept::id().

◆ to_code_asm() [1/2]

◆ to_code_asm() [2/2]

const code_asmt& to_code_asm ( const codet code)
inline

Definition at line 949 of file std_code.h.

References codet::get_statement().

◆ to_code_assert() [1/2]

const code_assertt& to_code_assert ( const codet code)
inline

Definition at line 336 of file std_code.h.

References codet::get_statement().

Referenced by goto_convertt::convert().

◆ to_code_assert() [2/2]

code_assertt& to_code_assert ( codet code)
inline

Definition at line 342 of file std_code.h.

References codet::get_statement().

◆ to_code_assign() [1/2]

const code_assignt& to_code_assign ( const codet code)
inline

Definition at line 178 of file std_code.h.

References codet::get_statement(), and exprt::operands().

Referenced by string_abstractiont::abstract_assign(), string_abstractiont::abstract_char_assign(), string_abstractiont::abstract_pointer_assign(), overflow_instrumentert::add_overflow_checks(), local_may_aliast::build(), local_bitvector_analysist::build(), cone_of_influencet::cone_of_influence(), polynomial_acceleratort::cone_of_influence(), goto_convertt::convert(), goto_program2codet::convert_assign(), goto_program2codet::convert_assign_varargs(), jsil_convertt::convert_code(), expr2ct::convert_code(), goto_program2codet::convert_decl(), goto_convertt::convert_init(), interpretert::execute_assign(), expressions_read(), expressions_written(), filter_out(), acceleration_utilst::find_modified(), scratch_programt::fix_types(), acceleration_utilst::gather_array_assignments(), get_modifies(), function_modifiest::get_modifies(), havoc_loopst::get_modifies(), goto_checkt::goto_check(), goto_rw(), implicit(), goto_inlinet::insert_function_body(), concurrency_instrumentationt::instrument(), escape_analysist::instrument(), mm_io(), mutex_init_instrumentation(), nondet_static(), nondet_volatile(), path_symext::operator()(), does_remove_constt::operator()(), acceleration_utilst::precondition(), polynomial_acceleratort::precondition(), const_function_pointer_propagationt::propagate(), goto_convertt::remove_assignment(), goto_convertt::remove_statement_expression(), constant_propagator_ait::replace(), remove_returnst::restore_returns(), goto_program2codet::scan_for_varargs(), slice_global_inits(), goto_symext::symex_step(), constant_propagator_domaint::transform(), custom_bitvector_domaint::transform(), global_may_alias_domaint::transform(), escape_domaint::transform(), interval_domaint::transform(), invariant_set_domaint::transform(), java_bytecode_typecheckt::typecheck_code(), jsil_typecheckt::typecheck_code(), remove_returnst::undo_function_calls(), and wp().

◆ to_code_assign() [2/2]

code_assignt& to_code_assign ( codet code)
inline

Definition at line 184 of file std_code.h.

References codet::get_statement(), and exprt::operands().

◆ to_code_assume() [1/2]

const code_assumet& to_code_assume ( const codet code)
inline

Definition at line 298 of file std_code.h.

References codet::get_statement().

Referenced by value_sett::apply_code(), goto_convertt::convert(), and wp().

◆ to_code_assume() [2/2]

code_assumet& to_code_assume ( codet code)
inline

Definition at line 304 of file std_code.h.

References codet::get_statement().

◆ to_code_block() [1/2]

◆ to_code_block() [2/2]

code_blockt& to_code_block ( codet code)
inline

Definition at line 126 of file std_code.h.

References codet::get_statement().

◆ to_code_break() [1/2]

const code_breakt& to_code_break ( const codet code)
inline

Definition at line 884 of file std_code.h.

References codet::get_statement().

Referenced by goto_convertt::convert().

◆ to_code_break() [2/2]

code_breakt& to_code_break ( codet code)
inline

Definition at line 890 of file std_code.h.

References codet::get_statement().

◆ to_code_continue() [1/2]

const code_continuet& to_code_continue ( const codet code)
inline

Definition at line 906 of file std_code.h.

References codet::get_statement().

Referenced by goto_convertt::convert().

◆ to_code_continue() [2/2]

code_continuet& to_code_continue ( codet code)
inline

Definition at line 912 of file std_code.h.

References codet::get_statement().

◆ to_code_dead() [1/2]

◆ to_code_dead() [2/2]

code_deadt& to_code_dead ( codet code)
inline

Definition at line 266 of file std_code.h.

References codet::get_statement(), and exprt::operands().

◆ to_code_decl() [1/2]

◆ to_code_decl() [2/2]

code_declt& to_code_decl ( codet code)
inline

Definition at line 225 of file std_code.h.

References codet::get_statement(), and exprt::operands().

◆ to_code_dowhile() [1/2]

const code_dowhilet& to_code_dowhile ( const codet code)
inline

◆ to_code_dowhile() [2/2]

code_dowhilet& to_code_dowhile ( codet code)
inline

Definition at line 538 of file std_code.h.

References codet::get_statement(), and exprt::operands().

◆ to_code_expression() [1/2]

code_expressiont& to_code_expression ( codet code)
inline

◆ to_code_expression() [2/2]

const code_expressiont& to_code_expression ( const codet code)
inline

Definition at line 988 of file std_code.h.

References codet::get_statement(), and exprt::operands().

◆ to_code_for() [1/2]

const code_fort& to_code_for ( const codet code)
inline

Definition at line 597 of file std_code.h.

References codet::get_statement(), and exprt::operands().

Referenced by goto_convertt::convert(), and expr2ct::convert_code().

◆ to_code_for() [2/2]

code_fort& to_code_for ( codet code)
inline

Definition at line 604 of file std_code.h.

References codet::get_statement(), and exprt::operands().

◆ to_code_function_call() [1/2]

const code_function_callt& to_code_function_call ( const codet code)
inline

Definition at line 700 of file std_code.h.

References codet::get_statement().

Referenced by string_abstractiont::abstract_function_call(), call_grapht::add(), const_function_pointer_propagationt::arg_stackt::add_args(), code_contractst::apply_contract(), local_may_aliast::build(), local_bitvector_analysist::build(), goto_program2codet::cleanup_code(), dump_ct::cleanup_expr(), goto_checkt::collect_allocations(), _rw_set_loct::compute(), compute_called_functions(), cfg_baset< cfg_nodet >::compute_edges_function_call(), procedure_local_cfg_baset< nodet, goto_programt, goto_programt::targett >::compute_edges_function_call(), goto_convertt::convert(), expr2javat::convert_code(), expr2ct::convert_code(), goto_program2codet::convert_decl(), goto_program2codet::convert_start_thread(), goto_program_dereferencet::dereference_instruction(), string_instrumentationt::do_function_call(), flow_insensitive_analysis_baset::do_function_call(), parameter_assignmentst::do_function_calls(), remove_returnst::do_function_calls(), path_searcht::drop_state(), const_function_pointer_propagationt::dup_caller_and_inline_callee(), interpretert::execute_function_call(), expressions_read(), expressions_written(), fence_all_shared_aegt::fence_all_shared_aeg_explore(), find_used_functions(), gather_virtual_callsites(), goto_inlinet::get_call(), get_modifies(), function_modifiest::get_modifies(), havoc_loopst::get_modifies(), flow_insensitive_abstract_domain_baset::get_return_lhs(), static_analysis_baset::get_return_lhs(), goto_checkt::goto_check(), goto_rw(), concurrency_instrumentationt::instrument(), taint_analysist::instrument(), instrument_cover_goals(), remove_exceptionst::instrument_function_call(), is_fence(), is_lwfence(), list_calls_and_arguments(), nondet_static(), nondet_volatile(), path_symext::operator()(), check_call_sequencet::operator()(), const_function_pointer_propagationt::propagate(), remove_function_pointerst::remove_function_pointer(), remove_function_pointerst::remove_function_pointers(), remove_virtual_functionst::remove_virtual_function(), remove_virtual_functionst::remove_virtual_functions(), constant_propagator_ait::replace(), replace_async(), show_call_sequences(), goto_symext::symex_step(), thread_exit_instrumentation(), constant_propagator_domaint::transform(), custom_bitvector_domaint::transform(), escape_domaint::transform(), interval_domaint::transform(), value_set_domain_fivrt::transform(), value_set_domain_fivrnst::transform(), value_set_domain_fit::transform(), value_set_domaint::transform(), rd_range_domaint::transform(), rd_range_domaint::transform_end_function(), rd_range_domaint::transform_function_call(), java_bytecode_typecheckt::typecheck_code(), jsil_typecheckt::typecheck_code(), c_typecheck_baset::typecheck_side_effect_statement_expression(), jsil_typecheckt::typecheck_try_catch(), undefined_function_abort_path(), remove_returnst::undo_function_calls(), flow_insensitive_analysis_baset::visit(), static_analysis_baset::visit(), ai_baset::visit(), instrumentert::cfg_visitort::visit_cfg_function_call(), and shared_bufferst::cfg_visitort::weak_memory().

◆ to_code_function_call() [2/2]

code_function_callt& to_code_function_call ( codet code)
inline

Definition at line 706 of file std_code.h.

References codet::get_statement().

◆ to_code_goto() [1/2]

const code_gotot& to_code_goto ( const codet code)
inline

◆ to_code_goto() [2/2]

code_gotot& to_code_goto ( codet code)
inline

Definition at line 643 of file std_code.h.

References codet::get_statement(), and exprt::operands().

◆ to_code_ifthenelse() [1/2]

◆ to_code_ifthenelse() [2/2]

code_ifthenelset& to_code_ifthenelse ( codet code)
inline

Definition at line 403 of file std_code.h.

References codet::get_statement(), and exprt::operands().

◆ to_code_label() [1/2]

◆ to_code_label() [2/2]

code_labelt& to_code_label ( codet code)
inline

Definition at line 809 of file std_code.h.

References codet::get_statement(), and exprt::operands().

◆ to_code_return() [1/2]

◆ to_code_return() [2/2]

code_returnt& to_code_return ( codet code)
inline

Definition at line 752 of file std_code.h.

References codet::get_statement().

◆ to_code_switch() [1/2]

const code_switcht& to_code_switch ( const codet code)
inline

◆ to_code_switch() [2/2]

code_switcht& to_code_switch ( codet code)
inline

Definition at line 448 of file std_code.h.

References codet::get_statement(), and exprt::operands().

◆ to_code_switch_case() [1/2]

◆ to_code_switch_case() [2/2]

code_switch_caset& to_code_switch_case ( codet code)
inline

Definition at line 868 of file std_code.h.

References codet::get_statement(), and exprt::operands().

◆ to_code_try_catch() [1/2]

const code_try_catcht& to_code_try_catch ( const codet code)
inline

Definition at line 1210 of file std_code.h.

References codet::get_statement(), and exprt::operands().

Referenced by jsil_typecheckt::typecheck_code().

◆ to_code_try_catch() [2/2]

code_try_catcht& to_code_try_catch ( codet code)
inline

Definition at line 1216 of file std_code.h.

References codet::get_statement(), and exprt::operands().

◆ to_code_while() [1/2]

const code_whilet& to_code_while ( const codet code)
inline

◆ to_code_while() [2/2]

code_whilet& to_code_while ( codet code)
inline

Definition at line 493 of file std_code.h.

References codet::get_statement(), and exprt::operands().

◆ to_side_effect_expr() [1/2]

◆ to_side_effect_expr() [2/2]

const side_effect_exprt& to_side_effect_expr ( const exprt expr)
inline

Definition at line 1029 of file std_code.h.

References irept::id().

◆ to_side_effect_expr_catch() [1/2]

static side_effect_expr_catcht& to_side_effect_expr_catch ( exprt expr)
inlinestatic

Definition at line 1143 of file std_code.h.

References irept::get(), and irept::id().

◆ to_side_effect_expr_catch() [2/2]

static const side_effect_expr_catcht& to_side_effect_expr_catch ( const exprt expr)
inlinestatic

Definition at line 1150 of file std_code.h.

References irept::get(), and irept::id().

◆ to_side_effect_expr_function_call() [1/2]

◆ to_side_effect_expr_function_call() [2/2]

const side_effect_expr_function_callt& to_side_effect_expr_function_call ( const exprt expr)
inline

Definition at line 1091 of file std_code.h.

References irept::get(), and irept::id().

◆ to_side_effect_expr_throw() [1/2]

side_effect_expr_throwt& to_side_effect_expr_throw ( exprt expr)
inline

Definition at line 1114 of file std_code.h.

References irept::get(), and irept::id().

Referenced by jsil_typecheckt::typecheck_expr_main().

◆ to_side_effect_expr_throw() [2/2]

const side_effect_expr_throwt& to_side_effect_expr_throw ( const exprt expr)
inline

Definition at line 1121 of file std_code.h.

References irept::get(), and irept::id().