Go to the documentation of this file.
50 message.
error() <<
"Linking not done, missing "
59 if(main_symbol.
mode!=ID_C)
61 message.
error() <<
"argc/argv modelling is C specific"
68 if(parameters.size()!=2 &&
71 message.
warning() <<
"main expected to take 2 or 3 arguments,"
72 <<
" argc/argv instrumentation skipped"
85 std::ostringstream oss;
90 <<
" unsigned next=0u;\n"
93 <<
" char arg_string[4096];\n"
95 <<
" for(int i=0; i<ARGC && i<" << max_argc <<
"; ++i)\n"
101 <<
" ARGV[i]=&(arg_string[next]);\n"
105 std::istringstream iss(oss.str());
111 ansi_c_language.
parse(iss,
"");
115 ansi_c_language.
typecheck(tmp_symbol_table,
"<built-in-library>");
122 for(
const auto &symbol_pair : tmp_symbol_table.
symbols)
131 value = symbol_pair.second.value;
155 instruction.source_location_nonconst().set_file(
"<built-in-library>");
157 goto_functionst::function_mapt::iterator start_entry=
163 start_entry->second.body_available(),
164 "entry point expected to have a body");
172 if(main_call->is_function_call())
174 const exprt &func = main_call->call_function();
175 if(func.
id()==ID_symbol &&
Class that provides messages with a built-in verbosity 'level'.
#define UNREACHABLE
This should be used to mark dead code.
bool has_symbol(const irep_idt &name) const
Check whether a symbol exists in the symbol table.
std::vector< parametert > parameterst
typet type
Type of symbol.
void remove_skip(goto_programt &goto_program, goto_programt::targett begin, goto_programt::targett end)
remove unnecessary skip statements
bool model_argc_argv(goto_modelt &goto_model, unsigned max_argc, message_handlert &message_handler)
Set up argv with up to max_argc pointers into an array of 4096 bytes.
void replace(const union_find_replacet &replace_map, string_not_contains_constraintt &constraint)
optionalt< std::string > main
Base class for all expressions.
struct configt::ansi_ct ansi_c
function_mapt function_map
Expression to hold a symbol (variable)
void goto_convert(const codet &code, symbol_table_baset &symbol_table, goto_programt &dest, message_handlert &message_handler, const irep_idt &mode)
A namespacet is essentially one or two symbol tables bound together, to allow for symbol lookups in t...
const codet & to_code(const exprt &expr)
bool lookup(const irep_idt &name, const symbolt *&symbol) const override
See documentation for namespace_baset::lookup().
const code_typet & to_code_type(const typet &type)
Cast a typet to a code_typet.
irep_idt mode
Language mode.
bool has_prefix(const std::string &s, const std::string &prefix)
#define DATA_INVARIANT(CONDITION, REASON)
This condition should be used to document that assumptions that are made on goto_functions,...
const std::string & id2string(const irep_idt &d)
preprocessort preprocessor
static optionalt< smt_termt > get_identifier(const exprt &expr, const std::unordered_map< exprt, smt_identifier_termt, irep_hash > &expression_handle_identifiers, const std::unordered_map< exprt, smt_identifier_termt, irep_hash > &expression_identifiers)
virtual void set_message_handler(message_handlert &_message_handler)
const symbol_exprt & to_symbol_expr(const exprt &expr)
Cast an exprt to a symbol_exprt.
const irep_idt & id() const
const parameterst & parameters() const
bool add(const symbolt &symbol)
Add a new symbol to the symbol table.
instructionst instructions
The list of instructions in the goto program.
#define POSTCONDITION(CONDITION)
goto_functionst goto_functions
GOTO functions.
bool parse(std::istream &instream, const std::string &path) override
const symbolst & symbols
Read-only field, used to look up symbols given their names.
A generic container class for the GOTO intermediate representation of one function.
static irep_idt entry_point()
Get the identifier of the entry point to a goto model.
bool typecheck(symbol_tablet &symbol_table, const std::string &module, const bool keep_file_local) override
typecheck without removing specified entries from the symbol table
void insert_before_swap(targett target)
Insertion that preserves jumps to "target".
mstreamt & warning() const
symbol_tablet symbol_table
Symbol table.
irep_idt name
The unique identifier.
instructionst::iterator targett