aboutsummaryrefslogtreecommitdiff
path: root/gcc/analyzer/engine.cc
diff options
context:
space:
mode:
authorDavid Malcolm <dmalcolm@redhat.com>2022-11-03 13:47:01 -0400
committerDavid Malcolm <dmalcolm@redhat.com>2022-11-03 13:47:01 -0400
commite031c5a17a33f19ccae1e0e7972c97d2b2eb8250 (patch)
treed0fbbfc10c53d3123782d8fff72061e7d2c4b3ea /gcc/analyzer/engine.cc
parentca5ff10546e612eff3d5e225b62b44ddf656cfbf (diff)
downloadgcc-e031c5a17a33f19ccae1e0e7972c97d2b2eb8250.zip
gcc-e031c5a17a33f19ccae1e0e7972c97d2b2eb8250.tar.gz
gcc-e031c5a17a33f19ccae1e0e7972c97d2b2eb8250.tar.bz2
analyzer: use std::unique_ptr for feasibility_problems and exploded_path
gcc/analyzer/ChangeLog: * diagnostic-manager.cc: Include "make-unique.h". Use std::unique_ptr for feasibility_problems and exploded_path. Delete explicit saved_diagnostic dtor. * diagnostic-manager.h: Likewise. * engine.cc: Likewise. * exploded-graph.h: Likewise. * feasible-graph.cc: Likewise. * feasible-graph.h: Likewise. Signed-off-by: David Malcolm <dmalcolm@redhat.com>
Diffstat (limited to 'gcc/analyzer/engine.cc')
-rw-r--r--gcc/analyzer/engine.cc9
1 files changed, 5 insertions, 4 deletions
diff --git a/gcc/analyzer/engine.cc b/gcc/analyzer/engine.cc
index c7bc63e..a727553 100644
--- a/gcc/analyzer/engine.cc
+++ b/gcc/analyzer/engine.cc
@@ -4599,8 +4599,9 @@ exploded_path::get_final_enode () const
feasibility_problem to *OUT. */
bool
-exploded_path::feasible_p (logger *logger, feasibility_problem **out,
- engine *eng, const exploded_graph *eg) const
+exploded_path::feasible_p (logger *logger,
+ std::unique_ptr<feasibility_problem> *out,
+ engine *eng, const exploded_graph *eg) const
{
LOG_SCOPE (logger);
@@ -4627,8 +4628,8 @@ exploded_path::feasible_p (logger *logger, feasibility_problem **out,
const program_point &src_point = src_enode.get_point ();
const gimple *last_stmt
= src_point.get_supernode ()->get_last_stmt ();
- *out = new feasibility_problem (edge_idx, *eedge,
- last_stmt, rc);
+ *out = make_unique<feasibility_problem> (edge_idx, *eedge,
+ last_stmt, rc);
}
else
delete rc;