CBMC
Loading...
Searching...
No Matches
Classes | Functions
remove_function_pointers.cpp File Reference

Program Transformation. More...

#include "remove_function_pointers.h"
#include <util/arith_tools.h>
#include <util/byte_operators.h>
#include <util/c_types.h>
#include <util/fresh_symbol.h>
#include <util/invariant.h>
#include <util/message.h>
#include <util/pointer_expr.h>
#include <util/pointer_offset_size.h>
#include <util/source_location.h>
#include <util/std_code.h>
#include <util/std_expr.h>
#include <util/string_utils.h>
#include <analyses/does_remove_const.h>
#include "compute_called_functions.h"
#include "goto_model.h"
#include "remove_const_function_pointers.h"
#include "remove_skip.h"
+ Include dependency graph for remove_function_pointers.cpp:

Go to the source code of this file.

Classes

 

Functions

 
  Returns true iff call_type can be converted to produce a function call of the same type as function_type.
 
 
 
 
void  remove_function_pointer (message_handlert &message_handler, symbol_tablet &symbol_table, goto_programt &goto_program, const irep_idt &function_id, goto_programt::targett target, const std::unordered_set< symbol_exprt, irep_hash > &functions_set)
  Replace a call to a dynamic function at location target in the given goto-program by a case-split over a given set of functions.
 
 
 
  returns true iff any of the given goto functions has function calls via a function pointer
 
  returns true iff the given goto model has function calls via a function pointer
 

Detailed Description

Program Transformation.

Definition in file remove_function_pointers.cpp.

Function Documentation

◆  arg_is_type_compatible()

static bool arg_is_type_compatible ( const typetcall_type,
const typetfunction_type,
const namespacetns 
)
static

Definition at line 102 of file remove_function_pointers.cpp.

◆  fix_argument_types()

static void fix_argument_types ( code_function_calltfunction_call )
static

Definition at line 180 of file remove_function_pointers.cpp.

◆  fix_return_type()

static void fix_return_type ( const irep_idtin_function_id,
code_function_calltfunction_call,
const source_locationtsource_location,
symbol_tabletsymbol_table,
goto_programtdest 
)
static

Definition at line 205 of file remove_function_pointers.cpp.

◆  function_is_type_compatible()

bool function_is_type_compatible ( bool  return_value_used,
const code_typetcall_type,
const code_typetfunction_type,
const namespacetns 
)

Returns true iff call_type can be converted to produce a function call of the same type as function_type.

Definition at line 129 of file remove_function_pointers.cpp.

◆  function_pointer_assertion_comment()

static std::string function_pointer_assertion_comment ( const std::vector< symbol_exprt > &  candidates )
static

Definition at line 348 of file remove_function_pointers.cpp.

◆  has_function_pointers() [1/3]

bool has_function_pointers ( const goto_functionstgoto_functions )

returns true iff any of the given goto functions has function calls via a function pointer

Definition at line 562 of file remove_function_pointers.cpp.

◆  has_function_pointers() [2/3]

bool has_function_pointers ( const goto_modeltgoto_model )

returns true iff the given goto model has function calls via a function pointer

Definition at line 571 of file remove_function_pointers.cpp.

◆  has_function_pointers() [3/3]

bool has_function_pointers ( const goto_programtgoto_program )

Definition at line 549 of file remove_function_pointers.cpp.

◆  remove_function_pointer()

void remove_function_pointer ( message_handlertmessage_handler,
symbol_tabletsymbol_table,
goto_programtgoto_program,
const irep_idtfunction_id,
const std::unordered_set< symbol_exprt, irep_hash > &  functions 
)

Replace a call to a dynamic function at location target in the given goto-program by a case-split over a given set of functions.

Parameters
message_handler Message handler to print warnings
symbol_table Symbol table
goto_program The goto program that contains target
function_id Name of function containing the target
target location with function call with function pointer
functions The set of functions to consider

Definition at line 379 of file remove_function_pointers.cpp.

◆  remove_function_pointers()

void remove_function_pointers ( message_handlert_message_handler,
goto_modeltgoto_model,
bool  only_remove_const_fps 
)

Definition at line 535 of file remove_function_pointers.cpp.

AltStyle によって変換されたページ (->オリジナル) /