33 std::set<std::string> &)
69 bool should_generate_stubs)
85 for(
auto &symbol_entry : symbol_table.
symbols)
98 if(return_symbol_id!=ID_nil)
100 symbol.
type.
set(
"opaque_method_capture_symbol", return_symbol_id);
130 const symbolt &function_symbol,
131 size_t parameter_index,
135 <<
" doesn't implement build_stub_parameter_symbol. " 136 <<
"This means cannot use opaque functions." <<
eom;
148 std::ostringstream return_symbol_name_builder;
149 return_symbol_name_builder <<
"to_return_" << function_id;
150 return return_symbol_name_builder.str();
161 std::set<std::string> headers;
169 symbol.
type.
id()==ID_code &&
183 for(std::size_t i=0; i<parameters.size(); ++i)
192 symbol_table.
add(param_symbol);
The type of an expression.
irep_idt name
The unique identifier.
bool is_symbol_opaque_function(const symbolt &symbol)
To identify if a given symbol is an opaque function and hence needs to be stubbed.
Symbol table entry of function parameterThis is a symbol generated as part of type checking...
std::string pretty(unsigned indent=0, unsigned max_indent=0) const
bool is_symbol_internal_symbol(const symbolt &symbol, std::set< std::string > &out_system_headers) const
To find out if a symbol is an internal symbol.
const code_typet & to_code_type(const typet &type)
Cast a generic typet to a code_typet.
std::vector< parametert > parameterst
exprt value
Initial value of symbol.
virtual bool type_to_name(const typet &type, std::string &name, const namespacet &ns)
Encodes the given type in a language-specific way.
Symbol table entry.This is a symbol in the symbol table, stored in an object of type symbol_tablet...
static mstreamt & eom(mstreamt &m)
void set_base_name(const irep_idt &name)
virtual symbolt * get_writeable(const irep_idt &name) override
Find a symbol in the symbol table for read-write access.
virtual irep_idt generate_opaque_stub_body(symbolt &symbol, symbol_tablet &symbol_table)
To generate the stub function for the opaque function in question.
const irep_idt & id() const
static irep_idt get_stub_return_symbol_name(const irep_idt &function_id)
To get the name of the symbol to be used for the return value of the function.
virtual bool final(symbol_table_baset &symbol_table)
Final adjustments, e.g.
virtual bool interfaces(symbol_tablet &symbol_table)
virtual std::string id() const
Abstract interface to support a programming language.
dstringt has one field, an unsigned integer no which is an index into a static table of strings...
void generate_opaque_parameter_symbols(symbolt &function_symbol, symbol_tablet &symbol_table)
To create stub parameter symbols for each parameter the function has and assign their IDs into the pa...
virtual bool from_type(const typet &type, std::string &code, const namespacet &ns)
Formats the given type in a language-specific way.
typet type
Type of symbol.
void set_identifier(const irep_idt &identifier)
Base class for all expressions.
virtual void dependencies(const std::string &module, std::set< std::string > &modules)
const parameterst & parameters() const
irep_idt base_name
Base (non-scoped) name.
The symbol table base class interface.
virtual parameter_symbolt build_stub_parameter_symbol(const symbolt &function_symbol, size_t parameter_index, const code_typet::parametert ¶meter)
To build the parameter symbol and choose its name.
bool generate_opaque_stubs
bool add(const symbolt &symbol)
Add a new symbol to the symbol table.
virtual bool from_expr(const exprt &expr, std::string &code, const namespacet &ns)
Formats the given expression in a language-specific way.
system_library_symbolst system_symbols
void generate_opaque_method_stubs(symbol_tablet &symbol_table)
When there are opaque methods (e.g.
void set(const irep_namet &name, const irep_idt &value)
void set_should_generate_opaque_method_stubs(bool should_generate_stubs)
Turn on or off stub generation.