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;
91 <<
" unsigned next=0u;\n"
96 <<
" for(int i=0; i<ARGC && i<" << max_argc <<
"; ++i)\n"
107 std::istringstream iss(oss.str());
112 ansi_c_language.
parse(iss,
"", message_handler);
117 tmp_symbol_table,
"<built-in-library>", message_handler);
124 for(
const auto &symbol_pair : tmp_symbol_table.
symbols)
136 value = symbol_pair.second.value;
160 instruction.source_location_nonconst().set_file(
"<built-in-library>");
162 goto_functionst::function_mapt::iterator start_entry=
168 start_entry->second.body_available(),
169 "entry point expected to have a body");
177 if(main_call->is_function_call())
179 const exprt &func = main_call->call_function();
180 if(func.
id()==ID_symbol &&
bool typecheck(symbol_table_baset &symbol_table, const std::string &module, message_handlert &message_handler, const bool keep_file_local) override
typecheck without removing specified entries from the symbol table
bool parse(std::istream &instream, const std::string &path, message_handlert &message_handler) override
std::vector< parametert > parameterst
const parameterst & parameters() const
std::optional< std::string > main
struct configt::ansi_ct ansi_c
Base class for all expressions.
function_mapt function_map
static irep_idt entry_point()
Get the identifier of the entry point to a goto model.
symbol_tablet symbol_table
Symbol table.
goto_functionst goto_functions
GOTO functions.
A generic container class for the GOTO intermediate representation of one function.
instructionst instructions
The list of instructions in the goto program.
void insert_before_swap(targett target)
Insertion that preserves jumps to "target".
instructionst::iterator targett
const irep_idt & id() const
Class that provides messages with a built-in verbosity 'level'.
mstreamt & warning() const
A namespacet is essentially one or two symbol tables bound together, to allow for symbol lookups in t...
bool lookup(const irep_idt &name, const symbolt *&symbol) const override
See documentation for namespace_baset::lookup().
Expression to hold a symbol (variable)
const symbolst & symbols
Read-only field, used to look up symbols given their names.
bool has_symbol(const irep_idt &name) const
Check whether a symbol exists in the symbol table.
bool add(const symbolt &symbol)
Add a new symbol to the symbol table.
typet type
Type of symbol.
irep_idt name
The unique identifier.
irep_idt mode
Language mode.
bool has_prefix(const std::string &s, const std::string &prefix)
void goto_convert(const codet &code, symbol_table_baset &symbol_table, goto_programt &dest, message_handlert &message_handler, const irep_idt &mode)
const std::string & id2string(const irep_idt &d)
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.
Initialize command line arguments.
void remove_skip(goto_programt &goto_program, goto_programt::targett begin, goto_programt::targett end)
remove unnecessary skip statements
#define UNREACHABLE
This should be used to mark dead code.
#define DATA_INVARIANT(CONDITION, REASON)
This condition should be used to document that assumptions that are made on goto_functions,...
#define POSTCONDITION(CONDITION)
const codet & to_code(const exprt &expr)
const symbol_exprt & to_symbol_expr(const exprt &expr)
Cast an exprt to a symbol_exprt.
const code_typet & to_code_type(const typet &type)
Cast a typet to a code_typet.
void replace(const union_find_replacet &replace_map, string_not_contains_constraintt &constraint)
preprocessort preprocessor