CBMC
remove_returns.h
Go to the documentation of this file.
1 /*******************************************************************\
2 
3 Module: Remove function returns
4 
5 Author: Daniel Kroening
6 
7 Date: September 2009
8 
9 \*******************************************************************/
10 
13 
70 
71 #ifndef CPROVER_GOTO_PROGRAMS_REMOVE_RETURNS_H
72 #define CPROVER_GOTO_PROGRAMS_REMOVE_RETURNS_H
73 
74 #include <util/irep.h>
75 
76 #include <functional>
77 
78 #include "goto_function.h"
79 
81 class goto_functionst;
83 class goto_modelt;
84 class namespacet;
85 class symbol_table_baset;
86 class symbol_exprt;
87 
89 
90 typedef std::function<bool(const irep_idt &)> function_is_stubt;
91 
93 
95 
96 // reverse the above operations
98 
100 
104 
108 
111 bool is_return_value_identifier(const irep_idt &id);
112 
115 bool is_return_value_symbol(const symbol_exprt &symbol_expr);
116 
121  const goto_programt::instructiont &function_call);
122 
123 #endif // CPROVER_GOTO_PROGRAMS_REMOVE_RETURNS_H
return_value_identifier
irep_idt return_value_identifier(const irep_idt &)
produces the identifier that is used to store the return value of the function with the given identif...
Definition: remove_returns.cpp:403
dstringt
dstringt has one field, an unsigned integer no which is an index into a static table of strings.
Definition: dstring.h:36
goto_modelt
Definition: goto_model.h:25
function_is_stubt
std::function< bool(const irep_idt &)> function_is_stubt
Definition: remove_returns.h:90
symbol_exprt
Expression to hold a symbol (variable)
Definition: std_expr.h:112
namespacet
A namespacet is essentially one or two symbol tables bound together, to allow for symbol lookups in t...
Definition: namespace.h:90
is_return_value_symbol
bool is_return_value_symbol(const symbol_exprt &symbol_expr)
Returns true if symbol_expr is a special return-value symbol produced by return_value_symbol.
Definition: remove_returns.cpp:421
code_function_callt
goto_instruction_codet representation of a function call statement.
Definition: goto_instruction_code.h:271
symbol_table_baset
The symbol table base class interface.
Definition: symbol_table_base.h:21
is_return_value_identifier
bool is_return_value_identifier(const irep_idt &id)
Returns true if id is a special return-value symbol produced by return_value_identifier.
Definition: remove_returns.cpp:416
remove_returns
void remove_returns(symbol_table_baset &, goto_functionst &)
removes returns
Definition: remove_returns.cpp:255
goto_functionst
A collection of goto functions.
Definition: goto_functions.h:24
does_function_call_return
bool does_function_call_return(const goto_programt::instructiont &function_call)
Check if the function_call returns anything.
Definition: remove_returns.cpp:426
restore_returns
void restore_returns(symbol_table_baset &, goto_functionst &)
goto_programt::instructiont
This class represents an instruction in the GOTO intermediate representation.
Definition: goto_program.h:180
goto_function.h
return_value_symbol
symbol_exprt return_value_symbol(const irep_idt &, const namespacet &)
produces the symbol that is used to store the return value of the function with the given identifier
Definition: remove_returns.cpp:409
goto_model_functiont
Interface providing access to a single function in a GOTO model, plus its associated symbol table.
Definition: goto_model.h:182
irep.h