36 :
log(message_handler)
68 for(goto_programt::instructionst::iterator
69 it=goto_function.body.instructions.begin();
70 it!=goto_function.body.instructions.end();
85 std::set<irep_idt> identifiers;
87 identifiers.insert(identifier);
95 std::string suffix = std::string(
100 for(
const auto &p : parents)
101 identifiers.insert(
id2string(p) + suffix);
107 for(
const auto &i : identifiers)
110 i ==
rule.function_identifier ||
122 log.
debug() <<
"MATCH " <<
rule.id <<
" on " << identifier
156 "`this` implies at least one argument in function call");
209 if(!insert_before.
empty())
211 goto_function.body.insert_before_swap(it, insert_before);
213 while(!it->is_function_call()) ++it;
216 if(!insert_after.
empty())
218 goto_function.body.destructive_insert(
219 std::next(it), insert_after);
249 taint.output(mstream);
250 mstream << messaget::eom;
273 <<
"we will consider the heads of all functions as reachable"
322 if(!
gf_entry.second.body.has_assertion())
327 if(
gf_entry.first ==
"__actual_thread_spawn")
334 if(!
i_it->is_assert())
354 <<
"******** Function " << symbol.
display_name() <<
'\n';
369 std::cout <<
i_it->source_location();
370 if(!
i_it->source_location().get_comment().empty())
371 std::cout <<
": " <<
i_it->source_location().get_comment();
373 if(!
i_it->source_location().get_property_class().empty())
374 std::cout <<
" (" <<
i_it->source_location().get_property_class()
393 log.
status() <<
"Analysis result is written to '"
413 log.
error() <<
"Caught unexpected error in taint_analysist::operator()"
Operator to return the address of an object.
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.
ait supplies three of the four components needed: an abstract interpreter (in this case handling func...
A base class for expressions that are predicates, i.e., Boolean-typed, and that take exactly two argu...
Non-graph-based representation of the class hierarchy.
idst get_parents_trans(const irep_idt &id) const
std::vector< irep_idt > idst
goto_instruction_codet representation of a function call statement.
Data structure for representing an arbitrary statement in a program.
static bool has_get_must_or_may(const exprt &)
dstringt has one field, an unsigned integer no which is an index into a static table of strings.
Base class for all expressions.
typet & type()
Return the type of the expression.
A collection of goto functions.
function_mapt function_map
::goto_functiont goto_functiont
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.
This class represents an instruction in the GOTO intermediate representation.
const exprt::operandst & call_arguments() const
Get the arguments of a FUNCTION_CALL.
const exprt & call_function() const
Get the function that is called for FUNCTION_CALL.
bool is_function_call() const
const source_locationt & source_location() const
A generic container class for the GOTO intermediate representation of one function.
instructionst instructions
The list of instructions in the goto program.
static instructiont make_end_function(const source_locationt &l=source_locationt::nil())
instructionst::iterator targett
void destructive_append(goto_programt &p)
Appends the given program p to *this. p is destroyed.
static instructiont make_function_call(const code_function_callt &_code, const source_locationt &l=source_locationt::nil())
Create a function call instruction.
static instructiont make_other(const goto_instruction_codet &_code, const source_locationt &l=source_locationt::nil())
targett add(instructiont &&instruction)
Adds a given instruction at the end.
static instructiont make_goto(targett _target, const source_locationt &l=source_locationt::nil())
bool empty() const
Is the program empty?
static instructiont make_assertion(const exprt &g, const source_locationt &l=source_locationt::nil())
const irep_idt & get(const irep_idt &name) const
const irep_idt & id() const
Class that provides messages with a built-in verbosity 'level'.
message_handlert & get_message_handler()
void conditional_output(mstreamt &mstream, const std::function< void(mstreamt &)> &output_generator) const
Generate output to message_stream using output_generator if the configured verbosity is at least as h...
mstreamt & status() 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().
A side_effect_exprt that returns a non-deterministically chosen value.
source_locationt location
Source code location of definition of symbol.
class symbol_exprt symbol_expr() const
Produces a symbol_exprt for a symbol.
const irep_idt & display_name() const
Return language specific display name if present.
bool operator()(const std::string &taint_file_name, const symbol_tablet &, goto_functionst &, bool show_full, const std::optional< std::string > &json_file_name)
void instrument(const namespacet &, goto_functionst &)
taint_analysist(message_handlert &message_handler)
class_hierarchyt class_hierarchy
The Boolean constant true.
bool has_prefix(const std::string &s, const std::string &prefix)
Field-insensitive, location-sensitive bitvector analysis.
#define forall_goto_program_instructions(it, program)
const std::string & id2string(const irep_idt &d)
bool is_true(const literalt &l)
API to expression classes for Pointers.
static void json(json_objectT &result, const irep_idt &property_id, const property_infot &property_info)
symbol_exprt return_value_symbol(const irep_idt &identifier, const namespacet &ns)
produces the symbol that is used to store the return value of the function with the given identifier
exprt simplify_expr(exprt src, const namespacet &ns)
#define DATA_INVARIANT(CONDITION, REASON)
This condition should be used to document that assumptions that are made on goto_functions,...
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.
bool taint_analysis(goto_modelt &goto_model, const std::string &taint_file_name, message_handlert &message_handler, bool show_full, const std::optional< std::string > &json_file_name)
bool taint_parser(const std::string &file_name, taint_parse_treet &dest, message_handlert &message_handler)