CBMC
Loading...
Searching...
No Matches
Typedefs | Functions
remove_returns.h File Reference

Replace function returns by assignments to global variables. More...

#include <util/irep.h>
#include "goto_program.h"
#include <functional>
+ Include dependency graph for remove_returns.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Typedefs

 

Functions

  removes returns
 
  Removes returns from a single function.
 
  removes returns
 
 
  restores return statements
 
  produces the identifier that is used to store the return value of the function with the given identifier
 
  produces the symbol that is used to store the return value of the function with the given identifier
 
  Returns true if id is a special return-value symbol produced by return_value_identifier.
 
  Returns true if symbol_expr is a special return-value symbol produced by return_value_symbol.
 
  Check if the function_call returns anything.
 

Detailed Description

Replace function returns by assignments to global variables.

Definition in file remove_returns.h.

Typedef Documentation

◆  function_is_stubt

Definition at line 88 of file remove_returns.h.

Function Documentation

◆  does_function_call_return()

bool does_function_call_return ( const goto_programt::instructiontfunction_call )

Check if the function_call returns anything.

Parameters
function_call the function call to be investigated
Returns
true if non-void return type and non-nil lhs

Definition at line 430 of file remove_returns.cpp.

◆  is_return_value_identifier()

bool is_return_value_identifier ( const irep_idtid )

Returns true if id is a special return-value symbol produced by return_value_identifier.

Definition at line 420 of file remove_returns.cpp.

◆  is_return_value_symbol()

bool is_return_value_symbol ( const symbol_exprtsymbol_expr )

Returns true if symbol_expr is a special return-value symbol produced by return_value_symbol.

Definition at line 425 of file remove_returns.cpp.

◆  remove_returns() [1/3]

void remove_returns ( goto_model_functiontgoto_model_function,
function_is_stubt  function_is_stub 
)

Removes returns from a single function.

Only usable with Java programs at the moment; to use it with other languages, they must annotate their stub functions with ID_C_incomplete as currently done in java_bytecode_convert_method.cpp.

This will generate #return_value variables, if not already present, for both the function being altered and any callees.

Parameters
goto_model_function function to transform
function_is_stub function that will be used to test whether a given callee has been or will be given a body. It should return true if so, or false if the function will remain a bodyless stub.

Definition at line 278 of file remove_returns.cpp.

◆  remove_returns() [2/3]

void remove_returns ( goto_modeltgoto_model )

removes returns

Definition at line 287 of file remove_returns.cpp.

◆  remove_returns() [3/3]

void remove_returns ( symbol_table_basetsymbol_table,
goto_functionstgoto_functions 
)

removes returns

Definition at line 259 of file remove_returns.cpp.

◆  restore_returns() [1/2]

void restore_returns ( goto_modeltgoto_model )

restores return statements

Definition at line 401 of file remove_returns.cpp.

◆  restore_returns() [2/2]

void restore_returns ( symbol_table_baset &  ,
)

◆  return_value_identifier()

irep_idt return_value_identifier ( const irep_idtidentifier )

produces the identifier that is used to store the return value of the function with the given identifier

Definition at line 407 of file remove_returns.cpp.

◆  return_value_symbol()

symbol_exprt return_value_symbol ( const irep_idtidentifier,
const namespacetns 
)

produces the symbol that is used to store the return value of the function with the given identifier

Definition at line 413 of file remove_returns.cpp.

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