From 4d59fe9aef258c35212e5b7b9f6eb2e17b88d293 Mon Sep 17 00:00:00 2001 From: Daniel Schemmel Date: Fri, 24 Mar 2023 02:40:47 +0000 Subject: use unique_ptr in QueryLoggingSolver --- lib/Solver/QueryLoggingSolver.cpp | 4 ---- lib/Solver/QueryLoggingSolver.h | 6 +++--- 2 files changed, 3 insertions(+), 7 deletions(-) (limited to 'lib/Solver') diff --git a/lib/Solver/QueryLoggingSolver.cpp b/lib/Solver/QueryLoggingSolver.cpp index 4c3d9b30..c057751c 100644 --- a/lib/Solver/QueryLoggingSolver.cpp +++ b/lib/Solver/QueryLoggingSolver.cpp @@ -53,10 +53,6 @@ QueryLoggingSolver::QueryLoggingSolver(Solver *_solver, std::string path, assert(0 != solver); } -QueryLoggingSolver::~QueryLoggingSolver() { - delete solver; -} - void QueryLoggingSolver::flushBufferConditionally(bool writeToFile) { logBuffer.flush(); if (writeToFile) { diff --git a/lib/Solver/QueryLoggingSolver.h b/lib/Solver/QueryLoggingSolver.h index 65494498..76bba429 100644 --- a/lib/Solver/QueryLoggingSolver.h +++ b/lib/Solver/QueryLoggingSolver.h @@ -17,6 +17,8 @@ #include "llvm/Support/raw_ostream.h" +#include + using namespace klee; /// This abstract class represents a solver that is capable of logging @@ -26,7 +28,7 @@ using namespace klee; class QueryLoggingSolver : public SolverImpl { protected: - Solver *solver; + std::unique_ptr solver; std::unique_ptr os; // @brief Buffer used by logBuffer std::string BufferString; @@ -59,8 +61,6 @@ public: QueryLoggingSolver(Solver *_solver, std::string path, const std::string &commentSign, time::Span queryTimeToLog, bool logTimedOut); - virtual ~QueryLoggingSolver(); - /// implementation of the SolverImpl interface bool computeTruth(const Query &query, bool &isValid); bool computeValidity(const Query &query, Solver::Validity &result); -- cgit 1.4.1