Go to the documentation of this file.
51 for(
const auto &
object : objects)
53 if(
object.
id() == ID_symbol)
56 const std::set<irep_idt> &uninitialized=
58 if(uninitialized.find(identifier)!=uninitialized.end())
61 else if(
object.
id() == ID_dereference)
80 for(std::set<irep_idt>::const_iterator
140 const std::set<irep_idt> &uninitialized=
144 for(
const auto &
object : read)
146 if(
object.
id() == ID_symbol)
150 if(uninitialized.find(identifier)!=uninitialized.end())
161 "use of uninitialized local variable " +
id2string(identifier));
163 "uninitialized local");
172 for(
const auto &
object : written)
174 if(
object.
id() == ID_symbol)
203 uninitialized.
add_assertions(gf_entry.first, gf_entry.second.body);
215 if(gf_entry.second.body_available())
218 out <<
"//// Function: " << gf_entry.first <<
'\n';
221 uninitialized_analysis(gf_entry.first, gf_entry.second.body, ns);
222 uninitialized_analysis.
output(
223 ns, gf_entry.first, gf_entry.second.body, out);
#define Forall_goto_program_instructions(it, program)
void add_assertions(const irep_idt &function_identifer, goto_programt &goto_program)
dstringt has one field, an unsigned integer no which is an index into a static table of strings.
void set_comment(const irep_idt &comment)
source_locationt & source_location_nonconst()
typet type
Type of symbol.
void show_uninitialized(const goto_modelt &goto_model, std::ostream &out)
void add_uninitialized_locals_assertions(goto_modelt &goto_model)
irep_idt base_name
Base (non-scoped) name.
function_mapt function_map
Expression to hold a symbol (variable)
static instructiont make_decl(const symbol_exprt &symbol, const source_locationt &l=source_locationt::nil())
const symbol_exprt & decl_symbol() const
Get the declared symbol for DECL.
void get_tracking(goto_programt::const_targett i_it)
which variables need tracking, i.e., are uninitialized and may be read?
static instructiont make_assignment(const code_assignt &_code, const source_locationt &l=source_locationt::nil())
Create an assignment instruction.
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().
static instructiont make_assertion(const exprt &g, const source_locationt &l=source_locationt::nil())
irep_idt mode
Language mode.
const std::string & id2string(const irep_idt &d)
const source_locationt & source_location() const
const irep_idt & get_identifier() const
void objects_read(const exprt &src, std::list< exprt > &dest)
symbol_tablet & symbol_table
std::set< irep_idt > tracking
virtual std::pair< symbolt &, bool > insert(symbolt symbol) override
Author: Diffblue Ltd.
const symbol_exprt & to_symbol_expr(const exprt &expr)
Cast an exprt to a symbol_exprt.
uninitializedt(symbol_tablet &_symbol_table)
void objects_written(const exprt &src, std::list< exprt > &dest)
The Boolean constant false.
goto_functionst goto_functions
GOTO functions.
source_locationt location
Source code location of definition of symbol.
virtual void output(const namespacet &ns, const irep_idt &function_id, const goto_programt &goto_program, std::ostream &out) const
Output the abstract states for a single function.
A generic container class for the GOTO intermediate representation of one function.
targett insert_after(const_targett target)
Insertion after the instruction pointed-to by the given instruction iterator target.
uninitialized_analysist uninitialized_analysis
instructionst::const_iterator const_targett
void insert_before_swap(targett target)
Insertion that preserves jumps to "target".
The Boolean constant true.
irep_idt module
Name of module the symbol belongs to.
This class represents an instruction in the GOTO intermediate representation.
symbol_tablet symbol_table
Symbol table.
irep_idt name
The unique identifier.
instructionst::iterator targett
#define forall_goto_program_instructions(it, program)
void set_property_class(const irep_idt &property_class)