From 9953e9901ff9cf68e26745c2aa6ef10de610c66d Mon Sep 17 00:00:00 2001 From: Daniel Schemmel Date: Fri, 24 Mar 2023 00:56:01 +0000 Subject: use unique_ptr in Z3SolverImpl --- lib/Solver/Z3Solver.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/Solver/Z3Solver.cpp b/lib/Solver/Z3Solver.cpp index 8319e5f3..f3e8f92b 100644 --- a/lib/Solver/Z3Solver.cpp +++ b/lib/Solver/Z3Solver.cpp @@ -27,6 +27,8 @@ #include "llvm/Support/CommandLine.h" #include "llvm/Support/raw_ostream.h" +#include + namespace { // NOTE: Very useful for debugging Z3 behaviour. These files can be given to // the z3 binary to replay all Z3 API calls using its `-log` option. @@ -57,7 +59,7 @@ namespace klee { class Z3SolverImpl : public SolverImpl { private: - Z3Builder *builder; + std::unique_ptr builder; time::Span timeout; SolverRunStatus runStatusCode; std::unique_ptr dumpedQueriesFile; @@ -135,7 +137,6 @@ Z3SolverImpl::Z3SolverImpl() Z3SolverImpl::~Z3SolverImpl() { Z3_params_dec_ref(builder->ctx, solverParameters); - delete builder; } Z3Solver::Z3Solver() : Solver(new Z3SolverImpl()) {} -- cgit 1.4.1