Skip to content

Commit 6475b3c

Browse files
authored
Merge pull request #8032 from tautschnig/cleanup/make_unique
Remove util_make_unique
2 parents 2228fe9 + 096f454 commit 6475b3c

File tree

58 files changed

+188
-253
lines changed

Some content is hidden

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

58 files changed

+188
-253
lines changed

jbmc/src/janalyzer/janalyzer_parse_options.cpp

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

398398
class_hierarchy =
399-
util_make_unique<class_hierarchyt>(lazy_goto_model.symbol_table);
399+
std::make_unique<class_hierarchyt>(lazy_goto_model.symbol_table);
400400

401401
log.status() << "Generating GOTO Program" << messaget::eom;
402402
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
@@ -1517,7 +1517,7 @@ void java_bytecode_languaget::show_parse(std::ostream &out)
15171517

15181518
std::unique_ptr<languaget> new_java_bytecode_language()
15191519
{
1520-
return util_make_unique<java_bytecode_languaget>();
1520+
return std::make_unique<java_bytecode_languaget>();
15211521
}
15221522

15231523
bool java_bytecode_languaget::from_expr(

jbmc/src/java_bytecode/java_bytecode_language.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ Author: Daniel Kroening, [email protected]
1111
#define CPROVER_JAVA_BYTECODE_JAVA_BYTECODE_LANGUAGE_H
1212

1313
#include <util/json.h>
14-
#include <util/make_unique.h>
1514
#include <util/prefix_filter.h>
1615
#include <util/symbol.h> // IWYU pragma: keep
1716

@@ -319,7 +318,9 @@ class java_bytecode_languaget:public languaget
319318
const namespacet &ns) override;
320319

321320
std::unique_ptr<languaget> new_language() override
322-
{ return util_make_unique<java_bytecode_languaget>(); }
321+
{
322+
return std::make_unique<java_bytecode_languaget>();
323+
}
323324

324325
std::string id() const override { return "java"; }
325326
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
@@ -15,7 +15,6 @@ Author: Daniel Kroening, [email protected]
1515
#include <util/exit_codes.h>
1616
#include <util/help_formatter.h>
1717
#include <util/invariant.h>
18-
#include <util/make_unique.h>
1918
#include <util/version.h>
2019
#include <util/xml.h>
2120

@@ -535,7 +534,7 @@ int jbmc_parse_optionst::doit()
535534
options.get_bool_option("stop-on-fail") && options.get_bool_option("paths"))
536535
{
537536
verifier =
538-
util_make_unique<stop_on_fail_verifiert<java_single_path_symex_checkert>>(
537+
std::make_unique<stop_on_fail_verifiert<java_single_path_symex_checkert>>(
539538
options, ui_message_handler, *goto_model_ptr);
540539
}
541540
else if(
@@ -545,13 +544,13 @@ int jbmc_parse_optionst::doit()
545544
if(options.get_bool_option("localize-faults"))
546545
{
547546
verifier =
548-
util_make_unique<stop_on_fail_verifier_with_fault_localizationt<
547+
std::make_unique<stop_on_fail_verifier_with_fault_localizationt<
549548
java_multi_path_symex_checkert>>(
550549
options, ui_message_handler, *goto_model_ptr);
551550
}
552551
else
553552
{
554-
verifier = util_make_unique<
553+
verifier = std::make_unique<
555554
stop_on_fail_verifiert<java_multi_path_symex_checkert>>(
556555
options, ui_message_handler, *goto_model_ptr);
557556
}
@@ -560,7 +559,7 @@ int jbmc_parse_optionst::doit()
560559
!options.get_bool_option("stop-on-fail") &&
561560
options.get_bool_option("paths"))
562561
{
563-
verifier = util_make_unique<all_properties_verifier_with_trace_storaget<
562+
verifier = std::make_unique<all_properties_verifier_with_trace_storaget<
564563
java_single_path_symex_checkert>>(
565564
options, ui_message_handler, *goto_model_ptr);
566565
}
@@ -571,13 +570,13 @@ int jbmc_parse_optionst::doit()
571570
if(options.get_bool_option("localize-faults"))
572571
{
573572
verifier =
574-
util_make_unique<all_properties_verifier_with_fault_localizationt<
573+
std::make_unique<all_properties_verifier_with_fault_localizationt<
575574
java_multi_path_symex_checkert>>(
576575
options, ui_message_handler, *goto_model_ptr);
577576
}
578577
else
579578
{
580-
verifier = util_make_unique<all_properties_verifier_with_trace_storaget<
579+
verifier = std::make_unique<all_properties_verifier_with_trace_storaget<
581580
java_multi_path_symex_checkert>>(
582581
options, ui_message_handler, *goto_model_ptr);
583582
}
@@ -603,7 +602,7 @@ int jbmc_parse_optionst::get_goto_program(
603602
lazy_goto_model.initialize(cmdline.args, options);
604603

605604
class_hierarchy =
606-
util_make_unique<class_hierarchyt>(lazy_goto_model.symbol_table);
605+
std::make_unique<class_hierarchyt>(lazy_goto_model.symbol_table);
607606

608607
// Show the class hierarchy
609608
if(cmdline.isset("show-class-hierarchy"))
@@ -662,7 +661,7 @@ int jbmc_parse_optionst::get_goto_program(
662661
}
663662

664663
goto_model_ptr =
665-
util_make_unique<lazy_goto_modelt>(std::move(lazy_goto_model));
664+
std::make_unique<lazy_goto_modelt>(std::move(lazy_goto_model));
666665
}
667666

668667
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

@@ -565,20 +564,20 @@ class ait : public ai_recursive_interproceduralt
565564
// constructor
566565
ait()
567566
: ai_recursive_interproceduralt(
568-
util_make_unique<
567+
std::make_unique<
569568
ai_history_factory_default_constructort<ahistoricalt>>(),
570-
util_make_unique<ai_domain_factory_default_constructort<domainT>>(),
571-
util_make_unique<location_sensitive_storaget>(),
569+
std::make_unique<ai_domain_factory_default_constructort<domainT>>(),
570+
std::make_unique<location_sensitive_storaget>(),
572571
no_logging)
573572
{
574573
}
575574

576575
explicit ait(std::unique_ptr<ai_domain_factory_baset> &&df)
577576
: ai_recursive_interproceduralt(
578-
util_make_unique<
577+
std::make_unique<
579578
ai_history_factory_default_constructort<ahistoricalt>>(),
580579
std::move(df),
581-
util_make_unique<location_sensitive_storaget>(),
580+
std::make_unique<location_sensitive_storaget>(),
582581
no_logging)
583582
{
584583
}

src/analyses/ai_domain.h

Lines changed: 3 additions & 4 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"
@@ -206,7 +205,7 @@ class ai_domain_factoryt : public ai_domain_factory_baset
206205

207206
std::unique_ptr<statet> copy(const statet &s) const override
208207
{
209-
return util_make_unique<domainT>(static_cast<const domainT &>(s));
208+
return std::make_unique<domainT>(static_cast<const domainT &>(s));
210209
}
211210

212211
bool merge(statet &dest, const statet &src, trace_ptrt from, trace_ptrt to)
@@ -229,7 +228,7 @@ class ai_domain_factory_default_constructort
229228

230229
std::unique_ptr<statet> make(locationt l) const override
231230
{
232-
auto d = util_make_unique<domainT>();
231+
auto d = std::make_unique<domainT>();
233232
CHECK_RETURN(d->is_bottom());
234233
return std::unique_ptr<statet>(d.release());
235234
}
@@ -246,7 +245,7 @@ class ai_domain_factory_location_constructort
246245

247246
std::unique_ptr<statet> make(locationt l) const override
248247
{
249-
auto d = util_make_unique<domainT>(l);
248+
auto d = std::make_unique<domainT>(l);
250249
CHECK_RETURN(d->is_bottom());
251250
return std::unique_ptr<statet>(d.release());
252251
}

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
@@ -15,7 +15,6 @@ Date: April 2010
1515
#include <util/byte_operators.h>
1616
#include <util/endianness_map.h>
1717
#include <util/expr_util.h>
18-
#include <util/make_unique.h>
1918
#include <util/namespace.h>
2019
#include <util/pointer_expr.h>
2120
#include <util/pointer_offset_size.h>
@@ -528,7 +527,7 @@ void rw_range_sett::add(
528527
.first;
529528

530529
if(entry->second==nullptr)
531-
entry->second=util_make_unique<range_domaint>();
530+
entry->second = std::make_unique<range_domaint>();
532531

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

768767
if(entry->second==nullptr)
769-
entry->second=util_make_unique<guarded_range_domaint>();
768+
entry->second = std::make_unique<guarded_range_domaint>();
770769

771770
static_cast<guarded_range_domaint&>(*entry->second).insert(
772771
{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)