cprover
generate_function_bodiest Class Referenceabstract

Base class for replace_function_body implementations. More...

#include <generate_function_bodies.h>

Inheritance diagram for generate_function_bodiest:
[legend]

Public Member Functions

virtual ~generate_function_bodiest ()=default
 
void generate_function_body (goto_functiont &function, symbol_tablet &symbol_table, const irep_idt &function_name) const
 Replace the function body with one based on the replace_function_body class being used. More...
 

Protected Member Functions

virtual void generate_function_body_impl (goto_functiont &function, const symbol_tablet &symbol_table, const irep_idt &function_name) const =0
 Produce a body for the passed function At this point the body of function is always empty, and all function parameters have identifiers. More...
 

Private Member Functions

void generate_parameter_names (goto_functiont &function, symbol_tablet &symbol_table, const irep_idt &function_name) const
 Generate parameter names for unnamed parameters. More...
 

Detailed Description

Base class for replace_function_body implementations.

Definition at line 23 of file generate_function_bodies.h.

Constructor & Destructor Documentation

◆ ~generate_function_bodiest()

virtual generate_function_bodiest::~generate_function_bodiest ( )
virtualdefault

Member Function Documentation

◆ generate_function_body()

void generate_function_bodiest::generate_function_body ( goto_functiont function,
symbol_tablet symbol_table,
const irep_idt function_name 
) const

Replace the function body with one based on the replace_function_body class being used.

Parameters
functionwhose body to replace
symbol_tableof the current goto program
function_nameIdentifier of function

Definition at line 18 of file generate_function_bodies.cpp.

References generate_function_body_impl(), generate_parameter_names(), and PRECONDITION.

Referenced by generate_function_bodies().

◆ generate_function_body_impl()

virtual void generate_function_bodiest::generate_function_body_impl ( goto_functiont function,
const symbol_tablet symbol_table,
const irep_idt function_name 
) const
protectedpure virtual

Produce a body for the passed function At this point the body of function is always empty, and all function parameters have identifiers.

Parameters
functionwhose body to generate
symbol_tableof the current goto program
function_nameIdentifier of function

Implemented in havoc_generate_function_bodiest, assert_false_then_assume_false_generate_function_bodiest, assert_false_generate_function_bodiest, and assume_false_generate_function_bodiest.

Referenced by generate_function_body().

◆ generate_parameter_names()

void generate_function_bodiest::generate_parameter_names ( goto_functiont function,
symbol_tablet symbol_table,
const irep_idt function_name 
) const
private

Generate parameter names for unnamed parameters.

CBMC expect functions to have parameter names if they are called and have a body

Definition at line 28 of file generate_function_bodies.cpp.

References symbol_table_baset::add(), symbolt::base_name, symbol_table_baset::get_writeable_ref(), id2string(), symbolt::location, symbol_table_baset::lookup_ref(), symbolt::mode, symbolt::module, symbolt::name, to_string(), and symbolt::type.

Referenced by generate_function_body().


The documentation for this class was generated from the following files: