about summary refs log tree commit diff homepage
path: root/lib/Solver/AssignmentValidatingSolver.cpp
diff options
context:
space:
mode:
authorDaniel Schemmel <daniel@schemmel.net>2023-03-24 15:05:43 +0000
committerCristian Cadar <c.cadar@imperial.ac.uk>2023-04-21 13:07:31 +0100
commitac0fa15ab0679fe1b5067b07647b0701ae3bc347 (patch)
treef2294eb5f0795ee9ce0f92d527242b7b7a507e79 /lib/Solver/AssignmentValidatingSolver.cpp
parente9d77be6c688836d68a2be5f3f0a02e63f392bb8 (diff)
downloadklee-ac0fa15ab0679fe1b5067b07647b0701ae3bc347.tar.gz
use unique_ptr all throughout the solver chain
Diffstat (limited to 'lib/Solver/AssignmentValidatingSolver.cpp')
-rw-r--r--lib/Solver/AssignmentValidatingSolver.cpp10
1 files changed, 7 insertions, 3 deletions
diff --git a/lib/Solver/AssignmentValidatingSolver.cpp b/lib/Solver/AssignmentValidatingSolver.cpp
index f18f43a8..d90cf6b2 100644
--- a/lib/Solver/AssignmentValidatingSolver.cpp
+++ b/lib/Solver/AssignmentValidatingSolver.cpp
@@ -13,6 +13,7 @@
 #include "klee/Solver/SolverImpl.h"
 
 #include <memory>
+#include <utility>
 #include <vector>
 
 namespace klee {
@@ -23,7 +24,8 @@ private:
   void dumpAssignmentQuery(const Query &query, const Assignment &assignment);
 
 public:
-  AssignmentValidatingSolver(Solver *_solver) : solver(_solver) {}
+  AssignmentValidatingSolver(std::unique_ptr<Solver> solver)
+      : solver(std::move(solver)) {}
 
   bool computeValidity(const Query &, Solver::Validity &result);
   bool computeTruth(const Query &, bool &isValid);
@@ -148,7 +150,9 @@ void AssignmentValidatingSolver::setCoreSolverTimeout(time::Span timeout) {
   return solver->impl->setCoreSolverTimeout(timeout);
 }
 
-Solver *createAssignmentValidatingSolver(Solver *s) {
-  return new Solver(new AssignmentValidatingSolver(s));
+std::unique_ptr<Solver>
+createAssignmentValidatingSolver(std::unique_ptr<Solver> s) {
+  return std::make_unique<Solver>(
+      std::make_unique<AssignmentValidatingSolver>(std::move(s)));
 }
 }