saved_diagnostic::saved_diagnostic (const state_machine *sm,
const exploded_node *enode,
const supernode *snode, const gimple *stmt,
- stmt_finder *stmt_finder,
+ const stmt_finder *stmt_finder,
tree var,
const svalue *sval,
state_machine::state_t state,
saved_diagnostic::~saved_diagnostic ()
{
- delete m_stmt_finder;
delete m_best_epath;
delete m_problem;
}
diagnostic_manager::add_diagnostic (const state_machine *sm,
exploded_node *enode,
const supernode *snode, const gimple *stmt,
- stmt_finder *finder,
+ const stmt_finder *finder,
tree var,
const svalue *sval,
state_machine::state_t state,
bool
diagnostic_manager::add_diagnostic (exploded_node *enode,
const supernode *snode, const gimple *stmt,
- stmt_finder *finder,
+ const stmt_finder *finder,
std::unique_ptr<pending_diagnostic> d)
{
gcc_assert (enode);
saved_diagnostic (const state_machine *sm,
const exploded_node *enode,
const supernode *snode, const gimple *stmt,
- stmt_finder *stmt_finder,
+ const stmt_finder *stmt_finder,
tree var, const svalue *sval,
state_machine::state_t state,
std::unique_ptr<pending_diagnostic> d,
const exploded_node *m_enode;
const supernode *m_snode;
const gimple *m_stmt;
- stmt_finder *m_stmt_finder;
+ std::unique_ptr<stmt_finder> m_stmt_finder;
tree m_var;
const svalue *m_sval;
state_machine::state_t m_state;
bool add_diagnostic (const state_machine *sm,
exploded_node *enode,
const supernode *snode, const gimple *stmt,
- stmt_finder *finder,
+ const stmt_finder *finder,
tree var,
const svalue *sval,
state_machine::state_t state,
bool add_diagnostic (exploded_node *enode,
const supernode *snode, const gimple *stmt,
- stmt_finder *finder,
+ const stmt_finder *finder,
std::unique_ptr<pending_diagnostic> d);
void add_note (std::unique_ptr<pending_note> pn);
const sm_state_map *old_smap,
sm_state_map *new_smap,
path_context *path_ctxt,
- stmt_finder *stmt_finder = NULL,
+ const stmt_finder *stmt_finder = NULL,
bool unknown_side_effects = false)
: sm_context (sm_idx, sm),
m_logger (eg.get_logger ()),
const sm_state_map *m_old_smap;
sm_state_map *m_new_smap;
path_context *m_path_ctxt;
- stmt_finder *m_stmt_finder;
+ const stmt_finder *m_stmt_finder;
/* Are we handling an external function with unknown side effects? */
bool m_unknown_side_effects;
leak_stmt_finder (const exploded_graph &eg, tree var)
: m_eg (eg), m_var (var) {}
- stmt_finder *clone () const final override
+ std::unique_ptr<stmt_finder> clone () const final override
{
- return new leak_stmt_finder (m_eg, m_var);
+ return make_unique<leak_stmt_finder> (m_eg, m_var);
}
const gimple *find_stmt (const exploded_path &epath)
{
public:
virtual ~stmt_finder () {}
- virtual stmt_finder *clone () const = 0;
+ virtual std::unique_ptr<stmt_finder> clone () const = 0;
virtual const gimple *find_stmt (const exploded_path &epath) = 0;
};