Skip to content

Commit e6a2c61

Browse files
committed
Remove util_make_unique
With the move to C++ 17 we can use std::make_unique instead.
1 parent b48a835 commit e6a2c61

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

53 files changed

+160
-228
lines changed

jbmc/src/janalyzer/janalyzer_parse_options.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -395,7 +395,7 @@ int janalyzer_parse_optionst::doit()
395395
lazy_goto_model.initialize(cmdline.args, options);
396396

397397
class_hierarchy =
398-
util_make_unique<class_hierarchyt>(lazy_goto_model.symbol_table);
398+
std::make_unique<class_hierarchyt>(lazy_goto_model.symbol_table);
399399

400400
log.status() << "Generating GOTO Program" << messaget::eom;
401401
lazy_goto_model.load_all_functions();

jbmc/src/java_bytecode/java_bytecode_language.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1521,7 +1521,7 @@ void java_bytecode_languaget::show_parse(std::ostream &out)
15211521

15221522
std::unique_ptr<languaget> new_java_bytecode_language()
15231523
{
1524-
return util_make_unique<java_bytecode_languaget>();
1524+
return std::make_unique<java_bytecode_languaget>();
15251525
}
15261526

15271527
bool java_bytecode_languaget::from_expr(

jbmc/src/java_bytecode/java_bytecode_language.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ Author: Daniel Kroening, [email protected]
2222
#include <memory>
2323

2424
#include <util/json.h>
25-
#include <util/make_unique.h>
2625
#include <util/prefix_filter.h>
2726

2827
#include <langapi/language.h>
@@ -333,7 +332,7 @@ class java_bytecode_languaget:public languaget
333332
const namespacet &ns) override;
334333

335334
std::unique_ptr<languaget> new_language() override
336-
{ return util_make_unique<java_bytecode_languaget>(); }
335+
{ return std::make_unique<java_bytecode_languaget>(); }
337336

338337
std::string id() const override { return "java"; }
339338
std::string description() const override { return "Java Bytecode"; }

jbmc/src/java_bytecode/java_qualifiers.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@
88
#include <sstream>
99
#include <iterator>
1010

11-
#include <util/make_unique.h>
12-
1311
#include "expr2java.h"
1412

1513
java_qualifierst &java_qualifierst::operator=(const java_qualifierst &other)
@@ -24,7 +22,7 @@ java_qualifierst &java_qualifierst::operator=(const java_qualifierst &other)
2422

2523
std::unique_ptr<qualifierst> java_qualifierst::clone() const
2624
{
27-
auto other = util_make_unique<java_qualifierst>(ns);
25+
auto other = std::make_unique<java_qualifierst>(ns);
2826
*other = *this;
2927
return std::move(other);
3028
}

jbmc/src/jbmc/jbmc_parse_options.cpp

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ Author: Daniel Kroening, [email protected]
1414
#include <util/config.h>
1515
#include <util/exit_codes.h>
1616
#include <util/invariant.h>
17-
#include <util/make_unique.h>
1817
#include <util/version.h>
1918
#include <util/xml.h>
2019

@@ -523,7 +522,7 @@ int jbmc_parse_optionst::doit()
523522
options.get_bool_option("stop-on-fail") && options.get_bool_option("paths"))
524523
{
525524
verifier =
526-
util_make_unique<stop_on_fail_verifiert<java_single_path_symex_checkert>>(
525+
std::make_unique<stop_on_fail_verifiert<java_single_path_symex_checkert>>(
527526
options, ui_message_handler, *goto_model_ptr);
528527
}
529528
else if(
@@ -533,13 +532,13 @@ int jbmc_parse_optionst::doit()
533532
if(options.get_bool_option("localize-faults"))
534533
{
535534
verifier =
536-
util_make_unique<stop_on_fail_verifier_with_fault_localizationt<
535+
std::make_unique<stop_on_fail_verifier_with_fault_localizationt<
537536
java_multi_path_symex_checkert>>(
538537
options, ui_message_handler, *goto_model_ptr);
539538
}
540539
else
541540
{
542-
verifier = util_make_unique<
541+
verifier = std::make_unique<
543542
stop_on_fail_verifiert<java_multi_path_symex_checkert>>(
544543
options, ui_message_handler, *goto_model_ptr);
545544
}
@@ -548,7 +547,7 @@ int jbmc_parse_optionst::doit()
548547
!options.get_bool_option("stop-on-fail") &&
549548
options.get_bool_option("paths"))
550549
{
551-
verifier = util_make_unique<all_properties_verifier_with_trace_storaget<
550+
verifier = std::make_unique<all_properties_verifier_with_trace_storaget<
552551
java_single_path_symex_checkert>>(
553552
options, ui_message_handler, *goto_model_ptr);
554553
}
@@ -559,13 +558,13 @@ int jbmc_parse_optionst::doit()
559558
if(options.get_bool_option("localize-faults"))
560559
{
561560
verifier =
562-
util_make_unique<all_properties_verifier_with_fault_localizationt<
561+
std::make_unique<all_properties_verifier_with_fault_localizationt<
563562
java_multi_path_symex_checkert>>(
564563
options, ui_message_handler, *goto_model_ptr);
565564
}
566565
else
567566
{
568-
verifier = util_make_unique<all_properties_verifier_with_trace_storaget<
567+
verifier = std::make_unique<all_properties_verifier_with_trace_storaget<
569568
java_multi_path_symex_checkert>>(
570569
options, ui_message_handler, *goto_model_ptr);
571570
}
@@ -591,7 +590,7 @@ int jbmc_parse_optionst::get_goto_program(
591590
lazy_goto_model.initialize(cmdline.args, options);
592591

593592
class_hierarchy =
594-
util_make_unique<class_hierarchyt>(lazy_goto_model.symbol_table);
593+
std::make_unique<class_hierarchyt>(lazy_goto_model.symbol_table);
595594

596595
// Show the class hierarchy
597596
if(cmdline.isset("show-class-hierarchy"))
@@ -650,7 +649,7 @@ int jbmc_parse_optionst::get_goto_program(
650649
}
651650

652651
goto_model_ptr =
653-
util_make_unique<lazy_goto_modelt>(std::move(lazy_goto_model));
652+
std::make_unique<lazy_goto_modelt>(std::move(lazy_goto_model));
654653
}
655654

656655
log.status() << config.object_bits_info() << messaget::eom;

src/analyses/ai.h

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,6 @@ Author: Daniel Kroening, [email protected]
5050

5151
#include <util/deprecate.h>
5252
#include <util/json.h>
53-
#include <util/make_unique.h>
5453
#include <util/message.h>
5554
#include <util/xml.h>
5655

@@ -566,20 +565,20 @@ class ait : public ai_recursive_interproceduralt
566565
// constructor
567566
ait()
568567
: ai_recursive_interproceduralt(
569-
util_make_unique<
568+
std::make_unique<
570569
ai_history_factory_default_constructort<ahistoricalt>>(),
571-
util_make_unique<ai_domain_factory_default_constructort<domainT>>(),
572-
util_make_unique<location_sensitive_storaget>(),
570+
std::make_unique<ai_domain_factory_default_constructort<domainT>>(),
571+
std::make_unique<location_sensitive_storaget>(),
573572
no_logging)
574573
{
575574
}
576575

577576
explicit ait(std::unique_ptr<ai_domain_factory_baset> &&df)
578577
: ai_recursive_interproceduralt(
579-
util_make_unique<
578+
std::make_unique<
580579
ai_history_factory_default_constructort<ahistoricalt>>(),
581580
std::move(df),
582-
util_make_unique<location_sensitive_storaget>(),
581+
std::make_unique<location_sensitive_storaget>(),
583582
no_logging)
584583
{
585584
}

src/analyses/ai_domain.h

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@ Author: Daniel Kroening, [email protected]
4141
#define CPROVER_ANALYSES_AI_DOMAIN_H
4242

4343
#include <util/json.h>
44-
#include <util/make_unique.h>
4544
#include <util/xml.h>
4645

4746
#include "ai_history.h"
@@ -202,7 +201,7 @@ class ai_domain_factoryt : public ai_domain_factory_baset
202201

203202
std::unique_ptr<statet> copy(const statet &s) const override
204203
{
205-
return util_make_unique<domainT>(static_cast<const domainT &>(s));
204+
return std::make_unique<domainT>(static_cast<const domainT &>(s));
206205
}
207206

208207
bool merge(statet &dest, const statet &src, trace_ptrt from, trace_ptrt to)
@@ -225,7 +224,7 @@ class ai_domain_factory_default_constructort
225224

226225
std::unique_ptr<statet> make(locationt l) const override
227226
{
228-
auto d = util_make_unique<domainT>();
227+
auto d = std::make_unique<domainT>();
229228
CHECK_RETURN(d->is_bottom());
230229
return std::unique_ptr<statet>(d.release());
231230
}

src/analyses/dependence_graph.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -349,7 +349,7 @@ class dep_graph_domain_factoryt : public ai_domain_factoryt<dep_graph_domaint>
349349
{
350350
auto node_id = dg.add_node();
351351
dg.nodes[node_id].PC = l;
352-
auto p = util_make_unique<dep_graph_domaint>(node_id);
352+
auto p = std::make_unique<dep_graph_domaint>(node_id);
353353
CHECK_RETURN(p->is_bottom());
354354

355355
return std::unique_ptr<statet>(p.release());
@@ -360,7 +360,7 @@ class dep_graph_domain_factoryt : public ai_domain_factoryt<dep_graph_domaint>
360360
};
361361

362362
dependence_grapht::dependence_grapht(const namespacet &_ns)
363-
: ait<dep_graph_domaint>(util_make_unique<dep_graph_domain_factoryt>(*this)),
363+
: ait<dep_graph_domaint>(std::make_unique<dep_graph_domain_factoryt>(*this)),
364364
ns(_ns),
365365
rd(ns)
366366
{

src/analyses/goto_rw.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ Date: April 2010
1717
#include <util/byte_operators.h>
1818
#include <util/endianness_map.h>
1919
#include <util/expr_util.h>
20-
#include <util/make_unique.h>
2120
#include <util/pointer_expr.h>
2221
#include <util/pointer_offset_size.h>
2322
#include <util/simplify_expr.h>
@@ -529,7 +528,7 @@ void rw_range_sett::add(
529528
.first;
530529

531530
if(entry->second==nullptr)
532-
entry->second=util_make_unique<range_domaint>();
531+
entry->second=std::make_unique<range_domaint>();
533532

534533
static_cast<range_domaint&>(*entry->second).push_back(
535534
{range_start, range_end});
@@ -767,7 +766,7 @@ void rw_guarded_range_set_value_sett::add(
767766
.first;
768767

769768
if(entry->second==nullptr)
770-
entry->second=util_make_unique<guarded_range_domaint>();
769+
entry->second=std::make_unique<guarded_range_domaint>();
771770

772771
static_cast<guarded_range_domaint&>(*entry->second).insert(
773772
{range_start, {range_end, guard.as_expr()}});

src/analyses/invariant_propagation.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ class invariant_set_domain_factoryt
2525

2626
std::unique_ptr<statet> make(locationt l) const override
2727
{
28-
auto p = util_make_unique<invariant_set_domaint>(
28+
auto p = std::make_unique<invariant_set_domaint>(
2929
ip.value_sets, ip.object_store, ip.ns);
3030
CHECK_RETURN(p->is_bottom());
3131

@@ -40,7 +40,7 @@ invariant_propagationt::invariant_propagationt(
4040
const namespacet &_ns,
4141
value_setst &_value_sets)
4242
: ait<invariant_set_domaint>(
43-
util_make_unique<invariant_set_domain_factoryt>(*this)),
43+
std::make_unique<invariant_set_domain_factoryt>(*this)),
4444
ns(_ns),
4545
value_sets(_value_sets),
4646
object_store(_ns)

0 commit comments

Comments
 (0)