20 if(instruction->incoming_edges.size() != 1)
25 in_t->is_goto() && !
in_t->is_backwards_goto() &&
26 in_t->condition().is_true())
35 return a.get_file() ==
b.get_file() &&
a.get_line() ==
b.get_line();
84 !it->source_location().is_nil() &&
85 !it->source_location().get_file().empty() &&
86 !it->source_location().get_line().empty() &&
87 !it->source_location().is_built_in() &&
91 block_info.source_location = it->source_location();
106std::optional<goto_programt::const_targett>
143 msg.warning() <<
"Ignoring block " << (
block_nr + 1) <<
" location "
144 << it->location_number <<
" " << it->source_location()
145 <<
" (bytecode-index already instrumented)"
152 msg.warning() <<
"Ignoring block " << (
block_nr + 1) <<
" location "
153 << it->location_number <<
" " << function_id
173 const irep_idt &line = location.get_line();
180 instruction.
code().visit_pre([&](
const exprt &expr) {
182 if(!location.get_function().empty())
183 add_location(location);
192 const auto &location = it->source_location();
211 const auto &
bytecode_index = t->source_location().get_java_bytecode_index();
217std::optional<goto_programt::const_targett>
ait supplies three of the four components needed: an abstract interpreter (in this case handling func...
cover_basic_blocks_javat(const goto_programt &_goto_program)
std::vector< goto_programt::const_targett > block_infos
const source_locationt & source_location_of(std::size_t block_number) const override
std::vector< source_locationt > block_locations
void output(std::ostream &out) const override
Outputs the list of blocks.
std::size_t block_of(goto_programt::const_targett t) const override
const source_linest & source_lines_of(std::size_t block_number) const override
std::vector< source_linest > block_source_lines
std::optional< goto_programt::const_targett > instruction_of(std::size_t block_number) const override
std::unordered_map< irep_idt, std::size_t > index_to_block
void output(std::ostream &out) const override
Outputs the list of blocks.
std::optional< goto_programt::const_targett > instruction_of(std::size_t block_nr) const override
static std::optional< std::size_t > continuation_of_block(const goto_programt::const_targett &instruction, block_mapt &block_map)
If this block is a continuation of a previous block through unconditional forward gotos,...
cover_basic_blockst(const goto_programt &goto_program)
std::map< goto_programt::const_targett, std::size_t, goto_programt::target_less_than > block_mapt
std::vector< block_infot > block_infos
map block numbers to block information
void report_block_anomalies(const irep_idt &function_id, const goto_programt &goto_program, message_handlert &message_handler) override
Output warnings about ignored blocks.
const source_linest & source_lines_of(std::size_t block_nr) const override
std::size_t block_of(goto_programt::const_targett t) const override
static void add_block_lines(cover_basic_blockst::block_infot &block, const goto_programt::instructiont &instruction)
Adds the lines which instruction spans to block.
const source_locationt & source_location_of(std::size_t block_nr) const override
block_mapt block_map
map program locations to block numbers
dstringt has one field, an unsigned integer no which is an index into a static table of strings.
Base class for all expressions.
const source_locationt & source_location() const
This class represents an instruction in the GOTO intermediate representation.
const goto_instruction_codet & code() const
Get the code represented by this instruction.
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.
instructionst::iterator targett
instructionst::const_iterator const_targett
Class that provides messages with a built-in verbosity 'level'.
void insert(const source_locationt &loc)
Insert a line (a source location) into the set of lines.
static const source_locationt & nil()
static bool same_source_line(const source_locationt &a, const source_locationt &b)
Basic blocks detection for Coverage Instrumentation.
#define forall_goto_program_instructions(it, program)
#define PRECONDITION(CONDITION)
#define INVARIANT(CONDITION, REASON)
This macro uses the wrapper function 'invariant_violated_string'.
source_linest source_lines
the set of source code lines belonging to this block