GCC Middle and Back End API Reference
ana::diagnostic_manager Class Reference

#include <diagnostic-manager.h>

Inheritance diagram for ana::diagnostic_manager:
Collaboration diagram for ana::diagnostic_manager:

Public Member Functions

 diagnostic_manager (logger *logger, engine *eng, int verbosity)
 
engineget_engine () const
 
std::unique_ptr< json::objectto_json () const
 
bool add_diagnostic (const state_machine *sm, const pending_location &ploc, tree var, const svalue *sval, state_machine::state_t state, std::unique_ptr< pending_diagnostic > d)
 
bool add_diagnostic (const pending_location &ploc, std::unique_ptr< pending_diagnostic > d)
 
void add_note (std::unique_ptr< pending_note > pn)
 
void add_event (std::unique_ptr< checker_event > event)
 
void emit_saved_diagnostics (const exploded_graph &eg)
 
void emit_saved_diagnostic (const exploded_graph &eg, saved_diagnostic &sd)
 
unsigned get_num_diagnostics () const
 
saved_diagnosticget_saved_diagnostic (unsigned idx)
 
const saved_diagnosticget_saved_diagnostic (unsigned idx) const
 
loggerget_logger () const
 
void set_logger (logger *logger)
 
void log (const char *fmt,...) const ATTRIBUTE_GCC_DIAG(2
 
void void start_log_line () const
 
void end_log_line () const
 
void enter_scope (const char *scope_name)
 
void exit_scope (const char *scope_name)
 
pretty_printerget_logger_pp () const
 
FILE * get_logger_file () const
 

Private Member Functions

void build_emission_path (const path_builder &pb, const exploded_path &epath, checker_path *emission_path) const
 
void add_event_on_final_node (const path_builder &pb, const exploded_node *final_enode, checker_path *emission_path, interesting_t *interest) const
 
void add_events_for_eedge (const path_builder &pb, const exploded_edge &eedge, checker_path *emission_path, interesting_t *interest) const
 
bool significant_edge_p (const path_builder &pb, const exploded_edge &eedge) const
 
void add_events_for_superedge (const path_builder &pb, const exploded_edge &eedge, checker_path *emission_path) const
 
void prune_path (checker_path *path, const state_machine *sm, const svalue *sval, state_machine::state_t state) const
 
void prune_for_sm_diagnostic (checker_path *path, const state_machine *sm, tree var, state_machine::state_t state) const
 
void prune_for_sm_diagnostic (checker_path *path, const state_machine *sm, const svalue *sval, state_machine::state_t state) const
 
void update_for_unsuitable_sm_exprs (tree *expr) const
 
void prune_interproc_events (checker_path *path) const
 
void prune_system_headers (checker_path *path) const
 
void consolidate_conditions (checker_path *path) const
 
void finish_pruning (checker_path *path) const
 
 DISABLE_COPY_AND_ASSIGN (log_user)
 

Private Attributes

enginem_eng
 
auto_delete_vec< saved_diagnosticm_saved_diagnostics
 
const int m_verbosity
 
int m_num_disabled_diagnostics
 
loggerm_logger
 

Detailed Description

A class with responsibility for saving pending diagnostics, so that
they can be emitted after the exploded_graph is complete.
This lets us de-duplicate diagnostics, and find the shortest path
for each similar diagnostic, potentially using edges that might
not have been found when each diagnostic was first saved.

This also lets us compute shortest_paths once, rather than
per-diagnostic.   

Constructor & Destructor Documentation

◆ diagnostic_manager()

ana::diagnostic_manager::diagnostic_manager ( logger * logger,
engine * eng,
int verbosity )

Member Function Documentation

◆ add_diagnostic() [1/2]

bool ana::diagnostic_manager::add_diagnostic ( const pending_location & ploc,
std::unique_ptr< pending_diagnostic > d )

◆ add_diagnostic() [2/2]

bool ana::diagnostic_manager::add_diagnostic ( const state_machine * sm,
const pending_location & ploc,
tree var,
const svalue * sval,
state_machine::state_t state,
std::unique_ptr< pending_diagnostic > d )

◆ add_event()

void ana::diagnostic_manager::add_event ( std::unique_ptr< checker_event > event)

◆ add_event_on_final_node()

void ana::diagnostic_manager::add_event_on_final_node ( const path_builder & pb,
const exploded_node * final_enode,
checker_path * emission_path,
interesting_t * interest ) const
private

◆ add_events_for_eedge()

void ana::diagnostic_manager::add_events_for_eedge ( const path_builder & pb,
const exploded_edge & eedge,
checker_path * emission_path,
interesting_t * interest ) const
private

◆ add_events_for_superedge()

void ana::diagnostic_manager::add_events_for_superedge ( const path_builder & pb,
const exploded_edge & eedge,
checker_path * emission_path ) const
private

◆ add_note()

void ana::diagnostic_manager::add_note ( std::unique_ptr< pending_note > pn)

◆ build_emission_path()

void ana::diagnostic_manager::build_emission_path ( const path_builder & pb,
const exploded_path & epath,
checker_path * emission_path ) const
private

◆ consolidate_conditions()

void ana::diagnostic_manager::consolidate_conditions ( checker_path * path) const
private

◆ DISABLE_COPY_AND_ASSIGN()

ana::log_user::DISABLE_COPY_AND_ASSIGN ( log_user )
privateinherited

◆ emit_saved_diagnostic()

void ana::diagnostic_manager::emit_saved_diagnostic ( const exploded_graph & eg,
saved_diagnostic & sd )

◆ emit_saved_diagnostics()

void ana::diagnostic_manager::emit_saved_diagnostics ( const exploded_graph & eg)

◆ end_log_line()

void ana::log_user::end_log_line ( ) const
inlineinherited
A shortcut for ending a log line from a log_user,
handling the common case where the underlying logger is NULL via
a no-op.   

References ana::logger::end_log_line(), and ana::log_user::m_logger.

◆ enter_scope()

void ana::log_user::enter_scope ( const char * scope_name)
inlineinherited
A shortcut for recording entry into a scope from a log_user,
handling the common case where the underlying logger is NULL via
a no-op.   

References ana::logger::enter_scope(), and ana::log_user::m_logger.

◆ exit_scope()

void ana::log_user::exit_scope ( const char * scope_name)
inlineinherited
A shortcut for recording exit from a scope from a log_user,
handling the common case where the underlying logger is NULL via
a no-op.   

References ana::logger::exit_scope(), and ana::log_user::m_logger.

◆ finish_pruning()

void ana::diagnostic_manager::finish_pruning ( checker_path * path) const
private

◆ get_engine()

engine * ana::diagnostic_manager::get_engine ( ) const
inline

References m_eng.

◆ get_logger()

logger * ana::log_user::get_logger ( ) const
inlineinherited

◆ get_logger_file()

FILE * ana::log_user::get_logger_file ( ) const
inlineinherited

◆ get_logger_pp()

pretty_printer * ana::log_user::get_logger_pp ( ) const
inlineinherited

◆ get_num_diagnostics()

unsigned ana::diagnostic_manager::get_num_diagnostics ( ) const
inline

References m_saved_diagnostics.

◆ get_saved_diagnostic() [1/2]

saved_diagnostic * ana::diagnostic_manager::get_saved_diagnostic ( unsigned idx)
inline

References m_saved_diagnostics.

◆ get_saved_diagnostic() [2/2]

const saved_diagnostic * ana::diagnostic_manager::get_saved_diagnostic ( unsigned idx) const
inline

References m_saved_diagnostics.

◆ log()

void ana::log_user::log ( const char * fmt,
... ) const
inlineinherited
A shortcut for calling log from a log_user, handling the common
case where the underlying logger is NULL via a no-op.   

References ap, ana::logger::log_va(), and ana::log_user::m_logger.

◆ prune_for_sm_diagnostic() [1/2]

void ana::diagnostic_manager::prune_for_sm_diagnostic ( checker_path * path,
const state_machine * sm,
const svalue * sval,
state_machine::state_t state ) const
private

◆ prune_for_sm_diagnostic() [2/2]

void ana::diagnostic_manager::prune_for_sm_diagnostic ( checker_path * path,
const state_machine * sm,
tree var,
state_machine::state_t state ) const
private

◆ prune_interproc_events()

void ana::diagnostic_manager::prune_interproc_events ( checker_path * path) const
private

◆ prune_path()

void ana::diagnostic_manager::prune_path ( checker_path * path,
const state_machine * sm,
const svalue * sval,
state_machine::state_t state ) const
private

◆ prune_system_headers()

void ana::diagnostic_manager::prune_system_headers ( checker_path * path) const
private

◆ set_logger()

void ana::log_user::set_logger ( logger * logger)
inherited

◆ significant_edge_p()

bool ana::diagnostic_manager::significant_edge_p ( const path_builder & pb,
const exploded_edge & eedge ) const
private

◆ start_log_line()

void ana::log_user::start_log_line ( ) const
inlineinherited
A shortcut for starting a log line from a log_user,
handling the common case where the underlying logger is NULL via
a no-op.   

References ana::log_user::m_logger, and ana::logger::start_log_line().

◆ to_json()

std::unique_ptr< json::object > ana::diagnostic_manager::to_json ( ) const

◆ update_for_unsuitable_sm_exprs()

void ana::diagnostic_manager::update_for_unsuitable_sm_exprs ( tree * expr) const
private

Field Documentation

◆ m_eng

engine* ana::diagnostic_manager::m_eng
private

Referenced by get_engine().

◆ m_logger

◆ m_num_disabled_diagnostics

int ana::diagnostic_manager::m_num_disabled_diagnostics
private

◆ m_saved_diagnostics

auto_delete_vec<saved_diagnostic> ana::diagnostic_manager::m_saved_diagnostics
private

◆ m_verbosity

const int ana::diagnostic_manager::m_verbosity
private

The documentation for this class was generated from the following file: