aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorDavid Malcolm <dmalcolm@redhat.com>2025-04-28 18:21:23 -0400
committerDavid Malcolm <dmalcolm@redhat.com>2025-04-28 18:21:23 -0400
commitcf5fb8f156b68b8a01e79a9471eeabebd499ea61 (patch)
tree76aede1f3629c95187c581c3a641fa72daaf52f8 /gcc
parent6f9764571d2dd1b03e41be18b0bcd4fa445b958f (diff)
downloadgcc-cf5fb8f156b68b8a01e79a9471eeabebd499ea61.zip
gcc-cf5fb8f156b68b8a01e79a9471eeabebd499ea61.tar.gz
gcc-cf5fb8f156b68b8a01e79a9471eeabebd499ea61.tar.bz2
Eliminate make-unique.h and ::make_unique
C++11 does not provide a std::make_unique so in r13-3627-g00d7c8ff16e683 I added a make-unique.h declaring a ::make_unique. As of r15-4719-ga9ec1bc06bd3cc we can use C++14, so make-unique.h is no longer needed: we can use simply use std::make_unique instead. This patch removes make-unique.h and updates every place using it to use std::make_unique. No functional change intended. gcc/analyzer/ChangeLog: * access-diagram.cc: Replace uses of ::make_unique with std::make_unique. * analyzer.cc: Likewise. * bounds-checking.cc: Likewise. * call-details.cc: Likewise. * call-info.cc: Likewise. * call-string.cc: Likewise. * checker-path.cc: Likewise. * common.h: Drop include of "make-unique.h". * constraint-manager.cc: Replace uses of ::make_unique with std::make_unique. * diagnostic-manager.cc: Likewise. * engine.cc: Likewise. * infinite-loop.cc: Likewise. * infinite-recursion.cc: Likewise. * kf-analyzer.cc: Likewise. * kf-lang-cp.cc: Likewise. * kf.cc: Likewise. * pending-diagnostic.cc: Likewise. * program-point.cc: Likewise; drop #include. * program-state.cc: Likewise. * ranges.cc: Likewise. * region-model.cc: Likewise. * region.cc: Likewise; drop #include. * sm-fd.cc: Likewise. * sm-file.cc: Likewise. * sm-malloc.cc: Likewise. * sm-pattern-test.cc: Likewise. * sm-sensitive.cc: Likewise. * sm-signal.cc: Likewise. * sm-taint.cc: Likewise. * sm.cc: Likewise. * store.cc: Likewise. * supergraph.cc: Likewise. * svalue.cc: Likewise; drop #include. * varargs.cc: Likewise. gcc/c-family/ChangeLog: * c-pretty-print.cc: Drop include of "make-unique.h". Replace uses of ::make_unique with std::make_unique. gcc/c/ChangeLog: * c-decl.cc: Drop include of "make-unique.h". Replace uses of ::make_unique with std::make_unique. * c-objc-common.cc: Likewise. * c-parser.cc: Likewise. gcc/cp/ChangeLog: * cxx-pretty-print.cc: Drop include of "make-unique.h". Replace uses of ::make_unique with std::make_unique. * error.cc: Likewise. * name-lookup.cc: Likewise. * parser.cc: Likewise. gcc/ChangeLog: * diagnostic-format-json.cc: Drop include of "make-unique.h". Replace uses of ::make_unique with std::make_unique. * diagnostic-format-sarif.cc: Likewise. * diagnostic-format-text.cc: Likewise. * diagnostic.cc: Likewise. * dumpfile.cc: Likewise. * gcc-attribute-urlifier.cc: Likewise. * gcc-urlifier.cc: Likewise. * json-parsing.cc: Likewise. * json.cc: Likewise. * lazy-diagnostic-path.cc: Likewise. * libgdiagnostics.cc: Likewise. * libsarifreplay.cc: Likewise. * lto-wrapper.cc: Likewise. * make-unique.h: Delete. * opts-diagnostic.cc: Drop include of "make-unique.h". Replace uses of ::make_unique with std::make_unique. * pretty-print.cc: Likewise. * text-art/style.cc: Likewise. * text-art/styled-string.cc: Likewise. * text-art/table.cc: Likewise. * text-art/tree-widget.cc: Likewise. * text-art/widget.cc: Likewise. * timevar.cc: Likewise. * toplev.cc: Likewise. * tree-diagnostic-client-data-hooks.cc: Likewise. gcc/jit/ChangeLog: * dummy-frontend.cc: Drop include of "make-unique.h". Replace uses of ::make_unique with std::make_unique. gcc/testsuite/ChangeLog: * gcc.dg/plugin/analyzer_cpython_plugin.cc: Drop include of "make-unique.h". Replace uses of ::make_unique with std::make_unique. * gcc.dg/plugin/analyzer_gil_plugin.cc: Likewise. * gcc.dg/plugin/analyzer_kernel_plugin.cc: Likewise. * gcc.dg/plugin/analyzer_known_fns_plugin.cc: Likewise. * gcc.dg/plugin/diagnostic_group_plugin.cc: Likewise. * gcc.dg/plugin/diagnostic_plugin_xhtml_format.cc: Likewise. Signed-off-by: David Malcolm <dmalcolm@redhat.com>
Diffstat (limited to 'gcc')
-rw-r--r--gcc/analyzer/access-diagram.cc39
-rw-r--r--gcc/analyzer/analyzer.cc12
-rw-r--r--gcc/analyzer/bounds-checking.cc76
-rw-r--r--gcc/analyzer/call-details.cc8
-rw-r--r--gcc/analyzer/call-info.cc2
-rw-r--r--gcc/analyzer/call-string.cc4
-rw-r--r--gcc/analyzer/checker-path.cc4
-rw-r--r--gcc/analyzer/common.h1
-rw-r--r--gcc/analyzer/constraint-manager.cc20
-rw-r--r--gcc/analyzer/diagnostic-manager.cc158
-rw-r--r--gcc/analyzer/engine.cc130
-rw-r--r--gcc/analyzer/infinite-loop.cc59
-rw-r--r--gcc/analyzer/infinite-recursion.cc15
-rw-r--r--gcc/analyzer/kf-analyzer.cc30
-rw-r--r--gcc/analyzer/kf-lang-cp.cc8
-rw-r--r--gcc/analyzer/kf.cc334
-rw-r--r--gcc/analyzer/pending-diagnostic.cc23
-rw-r--r--gcc/analyzer/program-point.cc3
-rw-r--r--gcc/analyzer/program-state.cc10
-rw-r--r--gcc/analyzer/ranges.cc2
-rw-r--r--gcc/analyzer/region-model.cc104
-rw-r--r--gcc/analyzer/region.cc3
-rw-r--r--gcc/analyzer/sm-fd.cc188
-rw-r--r--gcc/analyzer/sm-file.cc67
-rw-r--r--gcc/analyzer/sm-malloc.cc31
-rw-r--r--gcc/analyzer/sm-pattern-test.cc2
-rw-r--r--gcc/analyzer/sm-sensitive.cc4
-rw-r--r--gcc/analyzer/sm-signal.cc12
-rw-r--r--gcc/analyzer/sm-taint.cc23
-rw-r--r--gcc/analyzer/sm.cc6
-rw-r--r--gcc/analyzer/store.cc12
-rw-r--r--gcc/analyzer/supergraph.cc14
-rw-r--r--gcc/analyzer/svalue.cc4
-rw-r--r--gcc/analyzer/varargs.cc21
-rw-r--r--gcc/c-family/c-pretty-print.cc3
-rw-r--r--gcc/c/c-decl.cc13
-rw-r--r--gcc/c/c-objc-common.cc3
-rw-r--r--gcc/c/c-parser.cc8
-rw-r--r--gcc/cp/cxx-pretty-print.cc3
-rw-r--r--gcc/cp/error.cc1
-rw-r--r--gcc/cp/name-lookup.cc33
-rw-r--r--gcc/cp/parser.cc7
-rw-r--r--gcc/diagnostic-format-json.cc33
-rw-r--r--gcc/diagnostic-format-sarif.cc192
-rw-r--r--gcc/diagnostic-format-text.cc3
-rw-r--r--gcc/diagnostic.cc3
-rw-r--r--gcc/dumpfile.cc35
-rw-r--r--gcc/gcc-attribute-urlifier.cc1
-rw-r--r--gcc/gcc-urlifier.cc3
-rw-r--r--gcc/jit/dummy-frontend.cc6
-rw-r--r--gcc/json-parsing.cc21
-rw-r--r--gcc/json.cc5
-rw-r--r--gcc/lazy-diagnostic-path.cc5
-rw-r--r--gcc/libgdiagnostics.cc46
-rw-r--r--gcc/libsarifreplay.cc5
-rw-r--r--gcc/lto-wrapper.cc1
-rw-r--r--gcc/make-unique.h35
-rw-r--r--gcc/opts-diagnostic.cc9
-rw-r--r--gcc/pretty-print.cc7
-rw-r--r--gcc/testsuite/gcc.dg/plugin/analyzer_cpython_plugin.cc30
-rw-r--r--gcc/testsuite/gcc.dg/plugin/analyzer_gil_plugin.cc13
-rw-r--r--gcc/testsuite/gcc.dg/plugin/analyzer_kernel_plugin.cc15
-rw-r--r--gcc/testsuite/gcc.dg/plugin/analyzer_known_fns_plugin.cc10
-rw-r--r--gcc/testsuite/gcc.dg/plugin/diagnostic_group_plugin.cc4
-rw-r--r--gcc/testsuite/gcc.dg/plugin/diagnostic_plugin_xhtml_format.cc49
-rw-r--r--gcc/text-art/style.cc1
-rw-r--r--gcc/text-art/styled-string.cc1
-rw-r--r--gcc/text-art/table.cc1
-rw-r--r--gcc/text-art/tree-widget.cc5
-rw-r--r--gcc/text-art/widget.cc11
-rw-r--r--gcc/timevar.cc15
-rw-r--r--gcc/toplev.cc7
-rw-r--r--gcc/tree-diagnostic-client-data-hooks.cc3
73 files changed, 1031 insertions, 1044 deletions
diff --git a/gcc/analyzer/access-diagram.cc b/gcc/analyzer/access-diagram.cc
index a45268a..4283360 100644
--- a/gcc/analyzer/access-diagram.cc
+++ b/gcc/analyzer/access-diagram.cc
@@ -365,11 +365,11 @@ bit_size_expr::maybe_get_formatted_str (text_art::style_manager &sm,
if (!wi::fits_uhwi_p (concrete_num_bytes))
return nullptr;
if (concrete_num_bytes == 1)
- return ::make_unique <text_art::styled_string>
+ return std::make_unique <text_art::styled_string>
(fmt_styled_string (sm, concrete_single_byte_fmt,
concrete_num_bytes.to_uhwi ()));
else
- return ::make_unique <text_art::styled_string>
+ return std::make_unique <text_art::styled_string>
(fmt_styled_string (sm, concrete_plural_bytes_fmt,
concrete_num_bytes.to_uhwi ()));
}
@@ -379,7 +379,7 @@ bit_size_expr::maybe_get_formatted_str (text_art::style_manager &sm,
pp_format_decoder (&pp) = default_tree_printer;
if (!num_bytes->maybe_print_for_user (&pp, model))
return nullptr;
- return ::make_unique <text_art::styled_string>
+ return std::make_unique <text_art::styled_string>
(fmt_styled_string (sm, symbolic_bytes_fmt,
pp_formatted_text (&pp)));
}
@@ -390,11 +390,11 @@ bit_size_expr::maybe_get_formatted_str (text_art::style_manager &sm,
if (!wi::fits_uhwi_p (concrete_num_bits))
return nullptr;
if (concrete_num_bits == 1)
- return ::make_unique <text_art::styled_string>
+ return std::make_unique <text_art::styled_string>
(fmt_styled_string (sm, concrete_single_bit_fmt,
concrete_num_bits.to_uhwi ()));
else
- return ::make_unique <text_art::styled_string>
+ return std::make_unique <text_art::styled_string>
(fmt_styled_string (sm, concrete_plural_bits_fmt,
concrete_num_bits.to_uhwi ()));
}
@@ -404,7 +404,7 @@ bit_size_expr::maybe_get_formatted_str (text_art::style_manager &sm,
pp_format_decoder (&pp) = default_tree_printer;
if (!m_num_bits.maybe_print_for_user (&pp, model))
return nullptr;
- return ::make_unique <text_art::styled_string>
+ return std::make_unique <text_art::styled_string>
(fmt_styled_string (sm, symbolic_bits_fmt,
pp_formatted_text (&pp)));
}
@@ -1965,11 +1965,11 @@ make_written_svalue_spatial_item (const access_operation &op,
if (const initial_svalue *initial_sval = sval.dyn_cast_initial_svalue ())
if (const string_region *string_reg
= initial_sval->get_region ()->dyn_cast_string_region ())
- return make_unique <string_literal_spatial_item>
+ return std::make_unique <string_literal_spatial_item>
(sval, actual_bits,
*string_reg, theme,
svalue_spatial_item::kind::WRITTEN);
- return make_unique <written_svalue_spatial_item> (op, sval, actual_bits);
+ return std::make_unique <written_svalue_spatial_item> (op, sval, actual_bits);
}
static std::unique_ptr<spatial_item>
@@ -1990,7 +1990,7 @@ make_existing_svalue_spatial_item (const svalue *sval,
const initial_svalue *initial_sval = (const initial_svalue *)sval;
if (const string_region *string_reg
= initial_sval->get_region ()->dyn_cast_string_region ())
- return make_unique <string_literal_spatial_item>
+ return std::make_unique <string_literal_spatial_item>
(*sval, bits,
*string_reg, theme,
svalue_spatial_item::kind::EXISTING);
@@ -1998,7 +1998,7 @@ make_existing_svalue_spatial_item (const svalue *sval,
}
case SK_COMPOUND:
- return make_unique<compound_svalue_spatial_item>
+ return std::make_unique<compound_svalue_spatial_item>
(*((const compound_svalue *)sval),
bits,
svalue_spatial_item::kind::EXISTING,
@@ -2106,7 +2106,7 @@ public:
}
m_col_widths
- = make_unique <table_dimension_sizes> (m_btm.get_num_columns ());
+ = std::make_unique <table_dimension_sizes> (m_btm.get_num_columns ());
/* Now create child widgets. */
@@ -2201,8 +2201,8 @@ private:
std::unique_ptr<boundaries>
find_boundaries () const
{
- std::unique_ptr<boundaries> result
- = make_unique<boundaries> (*m_op.m_base_region, m_logger);
+ auto result
+ = std::make_unique<boundaries> (*m_op.m_base_region, m_logger);
m_valid_region_spatial_item.add_boundaries (*result, m_logger);
m_accessed_region_spatial_item.add_boundaries (*result, m_logger);
@@ -2261,7 +2261,7 @@ private:
void add_direction_widget ()
{
- add_child (::make_unique<direction_widget> (*this, m_btm));
+ add_child (std::make_unique<direction_widget> (*this, m_btm));
}
void add_invalid_accesses_to_region_table (table &t_region)
@@ -2666,11 +2666,12 @@ access_diagram::access_diagram (const access_operation &op,
style_manager &sm,
const theme &theme,
logger *logger)
-: wrapper_widget (make_unique <access_diagram_impl> (op,
- region_creation_event_id,
- sm,
- theme,
- logger))
+: wrapper_widget
+ (std::make_unique <access_diagram_impl> (op,
+ region_creation_event_id,
+ sm,
+ theme,
+ logger))
{
}
diff --git a/gcc/analyzer/analyzer.cc b/gcc/analyzer/analyzer.cc
index 88e53c7..c2814d2 100644
--- a/gcc/analyzer/analyzer.cc
+++ b/gcc/analyzer/analyzer.cc
@@ -219,11 +219,11 @@ std::unique_ptr<json::value>
tree_to_json (tree node)
{
if (!node)
- return ::make_unique<json::literal> (json::JSON_NULL);
+ return std::make_unique<json::literal> (json::JSON_NULL);
pretty_printer pp;
dump_generic_node (&pp, node, 0, TDF_VOPS|TDF_MEMSYMS, false);
- return ::make_unique<json::string> (pp_formatted_text (&pp));
+ return std::make_unique<json::string> (pp_formatted_text (&pp));
}
/* Generate a JSON value for EVENT_ID.
@@ -238,10 +238,10 @@ diagnostic_event_id_to_json (const diagnostic_event_id_t &event_id)
{
pretty_printer pp;
pp_printf (&pp, "%@", &event_id);
- return ::make_unique<json::string> (pp_formatted_text (&pp));
+ return std::make_unique<json::string> (pp_formatted_text (&pp));
}
else
- return ::make_unique<json::literal> (json::JSON_NULL);
+ return std::make_unique<json::literal> (json::JSON_NULL);
}
/* Generate a JSON value for OFFSET.
@@ -253,7 +253,7 @@ bit_offset_to_json (const bit_offset_t &offset)
{
pretty_printer pp;
pp_wide_int_large (&pp, offset, SIGNED);
- return ::make_unique<json::string> (pp_formatted_text (&pp));
+ return std::make_unique<json::string> (pp_formatted_text (&pp));
}
/* Generate a JSON value for OFFSET.
@@ -265,7 +265,7 @@ byte_offset_to_json (const byte_offset_t &offset)
{
pretty_printer pp;
pp_wide_int_large (&pp, offset, SIGNED);
- return ::make_unique<json::string> (pp_formatted_text (&pp));
+ return std::make_unique<json::string> (pp_formatted_text (&pp));
}
/* Workaround for lack of const-correctness of ssa_default_def. */
diff --git a/gcc/analyzer/bounds-checking.cc b/gcc/analyzer/bounds-checking.cc
index df7fab2..a3b1345 100644
--- a/gcc/analyzer/bounds-checking.cc
+++ b/gcc/analyzer/bounds-checking.cc
@@ -96,9 +96,9 @@ public:
so we don't need an event for that. */
if (byte_capacity)
emission_path.add_event
- (make_unique<oob_region_creation_event_capacity> (byte_capacity,
- loc_info,
- *this));
+ (std::make_unique<oob_region_creation_event_capacity> (byte_capacity,
+ loc_info,
+ *this));
}
void maybe_add_sarif_properties (sarif_object &result_obj)
@@ -289,9 +289,9 @@ public:
{
if (m_byte_bound && TREE_CODE (m_byte_bound) == INTEGER_CST)
emission_path.add_event
- (make_unique<oob_region_creation_event_capacity> (m_byte_bound,
- loc_info,
- *this));
+ (std::make_unique<oob_region_creation_event_capacity> (m_byte_bound,
+ loc_info,
+ *this));
}
void maybe_add_sarif_properties (sarif_object &result_obj)
@@ -1420,22 +1420,24 @@ region_model::check_symbolic_bounds (const region *base_reg,
break;
case access_direction::read:
gcc_assert (sval_hint == nullptr);
- ctxt->warn (make_unique<symbolic_buffer_over_read> (*this,
- sized_offset_reg,
- diag_arg,
- offset_tree,
- num_bytes_tree,
- capacity_tree));
+ ctxt->warn
+ (std::make_unique<symbolic_buffer_over_read> (*this,
+ sized_offset_reg,
+ diag_arg,
+ offset_tree,
+ num_bytes_tree,
+ capacity_tree));
return false;
break;
case access_direction::write:
- ctxt->warn (make_unique<symbolic_buffer_overflow> (*this,
- sized_offset_reg,
- diag_arg,
- offset_tree,
- num_bytes_tree,
- capacity_tree,
- sval_hint));
+ ctxt->warn
+ (std::make_unique<symbolic_buffer_overflow> (*this,
+ sized_offset_reg,
+ diag_arg,
+ offset_tree,
+ num_bytes_tree,
+ capacity_tree,
+ sval_hint));
return false;
break;
}
@@ -1528,16 +1530,18 @@ region_model::check_region_bounds (const region *reg,
break;
case access_direction::read:
gcc_assert (sval_hint == nullptr);
- ctxt->warn (make_unique<concrete_buffer_under_read> (*this, reg,
- diag_arg,
- bits_outside));
+ ctxt->warn
+ (std::make_unique<concrete_buffer_under_read> (*this, reg,
+ diag_arg,
+ bits_outside));
oob_safe = false;
break;
case access_direction::write:
- ctxt->warn (make_unique<concrete_buffer_underwrite> (*this,
- reg, diag_arg,
- bits_outside,
- sval_hint));
+ ctxt->warn
+ (std::make_unique<concrete_buffer_underwrite> (*this,
+ reg, diag_arg,
+ bits_outside,
+ sval_hint));
oob_safe = false;
break;
}
@@ -1564,18 +1568,20 @@ region_model::check_region_bounds (const region *reg,
break;
case access_direction::read:
gcc_assert (sval_hint == nullptr);
- ctxt->warn (make_unique<concrete_buffer_over_read> (*this,
- reg, diag_arg,
- bits_outside,
- bit_bound));
+ ctxt->warn
+ (std::make_unique<concrete_buffer_over_read> (*this,
+ reg, diag_arg,
+ bits_outside,
+ bit_bound));
oob_safe = false;
break;
case access_direction::write:
- ctxt->warn (make_unique<concrete_buffer_overflow> (*this,
- reg, diag_arg,
- bits_outside,
- bit_bound,
- sval_hint));
+ ctxt->warn
+ (std::make_unique<concrete_buffer_overflow> (*this,
+ reg, diag_arg,
+ bits_outside,
+ bit_bound,
+ sval_hint));
oob_safe = false;
break;
}
diff --git a/gcc/analyzer/call-details.cc b/gcc/analyzer/call-details.cc
index 75e7341..bca8658 100644
--- a/gcc/analyzer/call-details.cc
+++ b/gcc/analyzer/call-details.cc
@@ -593,10 +593,10 @@ call_details::complain_about_overlap (unsigned arg_idx_a,
if (!byte_range_a.intersection (byte_range_b, *model).is_true ())
return;
- ctxt->warn (make_unique<overlapping_buffers> (get_fndecl_for_call (),
- byte_range_a,
- byte_range_b,
- num_bytes_read_sval));
+ ctxt->warn (std::make_unique<overlapping_buffers> (get_fndecl_for_call (),
+ byte_range_a,
+ byte_range_b,
+ num_bytes_read_sval));
}
} // namespace ana
diff --git a/gcc/analyzer/call-info.cc b/gcc/analyzer/call-info.cc
index 0a5ae57..0e48c16 100644
--- a/gcc/analyzer/call-info.cc
+++ b/gcc/analyzer/call-info.cc
@@ -101,7 +101,7 @@ call_info::add_events_to_path (checker_path *emission_path,
const int stack_depth = src_point.get_stack_depth ();
emission_path->add_event
- (make_unique<call_event> (event_loc_info (get_call_stmt ().location,
+ (std::make_unique<call_event> (event_loc_info (get_call_stmt ().location,
caller_fndecl,
stack_depth),
this));
diff --git a/gcc/analyzer/call-string.cc b/gcc/analyzer/call-string.cc
index 3a9829e..afa8004 100644
--- a/gcc/analyzer/call-string.cc
+++ b/gcc/analyzer/call-string.cc
@@ -91,11 +91,11 @@ call_string::print (pretty_printer *pp) const
std::unique_ptr<json::value>
call_string::to_json () const
{
- auto arr = ::make_unique<json::array> ();
+ auto arr = std::make_unique<json::array> ();
for (const call_string::element_t &e : m_elements)
{
- auto e_obj = ::make_unique<json::object> ();
+ auto e_obj = std::make_unique<json::object> ();
e_obj->set_integer ("src_snode_idx", e.m_callee->m_index);
e_obj->set_integer ("dst_snode_idx", e.m_caller->m_index);
e_obj->set_string ("funcname", function_name (e.m_caller->m_fun));
diff --git a/gcc/analyzer/checker-path.cc b/gcc/analyzer/checker-path.cc
index e7a559f..9bde6f2 100644
--- a/gcc/analyzer/checker-path.cc
+++ b/gcc/analyzer/checker-path.cc
@@ -148,8 +148,8 @@ checker_path::add_region_creation_events (pending_diagnostic *pd,
pd->add_region_creation_events (reg, capacity, loc_info, *this);
if (debug)
- add_event (make_unique<region_creation_event_debug> (reg, capacity,
- loc_info));
+ add_event (std::make_unique<region_creation_event_debug> (reg, capacity,
+ loc_info));
}
void
diff --git a/gcc/analyzer/common.h b/gcc/analyzer/common.h
index 0dac29c..3d02b62 100644
--- a/gcc/analyzer/common.h
+++ b/gcc/analyzer/common.h
@@ -25,7 +25,6 @@ along with GCC; see the file COPYING3. If not see
#define INCLUDE_VECTOR
#include "system.h"
#include "coretypes.h"
-#include "make-unique.h"
#include "tree.h"
#include "function.h"
#include "basic-block.h"
diff --git a/gcc/analyzer/constraint-manager.cc b/gcc/analyzer/constraint-manager.cc
index f39f054..a3e682c 100644
--- a/gcc/analyzer/constraint-manager.cc
+++ b/gcc/analyzer/constraint-manager.cc
@@ -436,7 +436,7 @@ bounded_range::dump (bool show_types) const
std::unique_ptr<json::object>
bounded_range::to_json () const
{
- auto range_obj = ::make_unique<json::object> ();
+ auto range_obj = std::make_unique<json::object> ();
set_json_attr (*range_obj, "lower", m_lower);
set_json_attr (*range_obj, "upper", m_upper);
return range_obj;
@@ -705,7 +705,7 @@ bounded_ranges::dump (bool show_types) const
std::unique_ptr<json::value>
bounded_ranges::to_json () const
{
- auto arr_obj = ::make_unique<json::array> ();
+ auto arr_obj = std::make_unique<json::array> ();
for (unsigned i = 0; i < m_ranges.length (); ++i)
arr_obj->append (m_ranges[i].to_json ());
@@ -1103,9 +1103,9 @@ equiv_class::print (pretty_printer *pp) const
std::unique_ptr<json::object>
equiv_class::to_json () const
{
- auto ec_obj = ::make_unique<json::object> ();
+ auto ec_obj = std::make_unique<json::object> ();
- auto sval_arr = ::make_unique<json::array> ();
+ auto sval_arr = std::make_unique<json::array> ();
for (const svalue *sval : m_vars)
sval_arr->append (sval->to_json ());
ec_obj->set ("svals", std::move (sval_arr));
@@ -1370,7 +1370,7 @@ constraint::print (pretty_printer *pp, const constraint_manager &cm) const
std::unique_ptr<json::object>
constraint::to_json () const
{
- auto con_obj = ::make_unique<json::object> ();
+ auto con_obj = std::make_unique<json::object> ();
con_obj->set_integer ("lhs", m_lhs.as_int ());
con_obj->set_string ("op", constraint_op_code (m_op));
@@ -1458,7 +1458,7 @@ bounded_ranges_constraint::print (pretty_printer *pp,
std::unique_ptr<json::object>
bounded_ranges_constraint::to_json () const
{
- auto con_obj = ::make_unique<json::object> ();
+ auto con_obj = std::make_unique<json::object> ();
con_obj->set_integer ("ec", m_ec_id.as_int ());
con_obj->set ("ranges", m_ranges->to_json ());
@@ -1771,11 +1771,11 @@ debug (const constraint_manager &cm)
std::unique_ptr<json::object>
constraint_manager::to_json () const
{
- auto cm_obj = ::make_unique<json::object> ();
+ auto cm_obj = std::make_unique<json::object> ();
/* Equivalence classes. */
{
- auto ec_arr = ::make_unique<json::array> ();
+ auto ec_arr = std::make_unique<json::array> ();
for (const equiv_class *ec : m_equiv_classes)
ec_arr->append (ec->to_json ());
cm_obj->set ("ecs", std::move (ec_arr));
@@ -1783,7 +1783,7 @@ constraint_manager::to_json () const
/* Constraints. */
{
- auto con_arr = ::make_unique<json::array> ();
+ auto con_arr = std::make_unique<json::array> ();
for (const constraint &c : m_constraints)
con_arr->append (c.to_json ());
cm_obj->set ("constraints", std::move (con_arr));
@@ -1791,7 +1791,7 @@ constraint_manager::to_json () const
/* m_bounded_ranges_constraints. */
{
- auto con_arr = ::make_unique<json::array> ();
+ auto con_arr = std::make_unique<json::array> ();
for (const auto &c : m_bounded_ranges_constraints)
con_arr->append (c.to_json ());
cm_obj->set ("bounded_ranges_constraints", std::move (con_arr));
diff --git a/gcc/analyzer/diagnostic-manager.cc b/gcc/analyzer/diagnostic-manager.cc
index 09629d4..161ae62 100644
--- a/gcc/analyzer/diagnostic-manager.cc
+++ b/gcc/analyzer/diagnostic-manager.cc
@@ -191,7 +191,7 @@ epath_finder::get_best_epath (const exploded_node *enode,
logger->log ("trying to find shortest path ignoring feasibility");
gcc_assert (m_sep);
std::unique_ptr<exploded_path> epath
- = make_unique<exploded_path> (m_sep->get_shortest_path (enode));
+ = std::make_unique<exploded_path> (m_sep->get_shortest_path (enode));
if (epath->feasible_p (logger, out_problem, m_eg.get_engine (), &m_eg))
{
if (logger)
@@ -730,7 +730,7 @@ saved_diagnostic::add_event (std::unique_ptr<checker_event> event)
std::unique_ptr<json::object>
saved_diagnostic::to_json () const
{
- auto sd_obj = ::make_unique<json::object> ();
+ auto sd_obj = std::make_unique<json::object> ();
if (m_sm)
sd_obj->set_string ("sm", m_sm->get_name ());
@@ -1036,10 +1036,10 @@ saved_diagnostic::maybe_add_sarif_properties (sarif_object &result_obj) const
props.set_integer (PROPERTY_PREFIX "idx", m_idx);
if (m_duplicates.length () > 0)
{
- auto duplicates_arr = ::make_unique<json::array> ();
+ auto duplicates_arr = std::make_unique<json::array> ();
for (auto iter : m_duplicates)
{
- auto sd_obj = ::make_unique<sarif_object> ();
+ auto sd_obj = std::make_unique<sarif_object> ();
iter->maybe_add_sarif_properties (*sd_obj);
duplicates_arr->append (std::move (sd_obj));
}
@@ -1230,10 +1230,10 @@ diagnostic_manager::add_event (std::unique_ptr<checker_event> event)
std::unique_ptr<json::object>
diagnostic_manager::to_json () const
{
- auto dm_obj = ::make_unique<json::object> ();
+ auto dm_obj = std::make_unique<json::object> ();
{
- auto sd_arr = ::make_unique<json::array> ();
+ auto sd_arr = std::make_unique<json::array> ();
int i;
saved_diagnostic *sd;
FOR_EACH_VEC_ELT (m_saved_diagnostics, i, sd)
@@ -1804,16 +1804,16 @@ public:
int stack_depth = src_stack_depth;
m_emission_path->add_event
- (make_unique<state_change_event> (supernode,
- stmt,
- stack_depth,
- sm,
- nullptr,
- src_sm_val,
- dst_sm_val,
- nullptr,
- dst_state,
- src_node));
+ (std::make_unique<state_change_event> (supernode,
+ stmt,
+ stack_depth,
+ sm,
+ nullptr,
+ src_sm_val,
+ dst_sm_val,
+ nullptr,
+ dst_state,
+ src_node));
return false;
}
@@ -1849,16 +1849,16 @@ public:
return false;
m_emission_path->add_event
- (make_unique<state_change_event> (supernode,
- stmt,
- stack_depth,
- sm,
- sval,
- src_sm_val,
- dst_sm_val,
- dst_origin_sval,
- dst_state,
- src_node));
+ (std::make_unique<state_change_event> (supernode,
+ stmt,
+ stack_depth,
+ sm,
+ sval,
+ src_sm_val,
+ dst_sm_val,
+ dst_origin_sval,
+ dst_state,
+ src_node));
return false;
}
@@ -1995,15 +1995,15 @@ struct null_assignment_sm_context : public sm_context
int stack_depth = m_point->get_stack_depth ();
m_emission_path->add_event
- (make_unique<state_change_event> (supernode,
- m_stmt,
- stack_depth,
- m_sm,
- var_new_sval,
- from, to,
- nullptr,
- *m_new_state,
- nullptr));
+ (std::make_unique<state_change_event> (supernode,
+ m_stmt,
+ stack_depth,
+ m_sm,
+ var_new_sval,
+ from, to,
+ nullptr,
+ *m_new_state,
+ nullptr));
}
void set_next_state (const gimple *stmt,
@@ -2021,15 +2021,15 @@ struct null_assignment_sm_context : public sm_context
int stack_depth = m_point->get_stack_depth ();
m_emission_path->add_event
- (make_unique<state_change_event> (supernode,
- m_stmt,
- stack_depth,
- m_sm,
- sval,
- from, to,
- nullptr,
- *m_new_state,
- nullptr));
+ (std::make_unique<state_change_event> (supernode,
+ m_stmt,
+ stack_depth,
+ m_sm,
+ sval,
+ from, to,
+ nullptr,
+ *m_new_state,
+ nullptr));
}
void warn (const supernode *, const gimple *,
@@ -2210,16 +2210,17 @@ diagnostic_manager::add_events_for_eedge (const path_builder &pb,
const gcall *call = dyn_cast <const gcall *> (stmt);
if (call && is_setjmp_call_p (*call))
emission_path->add_event
- (make_unique<setjmp_event> (event_loc_info (stmt->location,
- dst_point.get_fndecl (),
- dst_stack_depth),
- dst_node,
- *call));
+ (std::make_unique<setjmp_event>
+ (event_loc_info (stmt->location,
+ dst_point.get_fndecl (),
+ dst_stack_depth),
+ dst_node,
+ *call));
else
emission_path->add_event
- (make_unique<statement_event> (stmt,
- dst_point.get_fndecl (),
- dst_stack_depth, dst_state));
+ (std::make_unique<statement_event> (stmt,
+ dst_point.get_fndecl (),
+ dst_stack_depth, dst_state));
/* Create state change events for assignment to NULL.
Iterate through the stmts in dst_enode, adding state change
@@ -2312,11 +2313,11 @@ diagnostic_manager::add_events_for_eedge (const path_builder &pb,
" at this edge: ");
pb.get_feasibility_problem ()->dump_to_pp (&pp);
emission_path->add_event
- (make_unique<precanned_custom_event>
- (event_loc_info (dst_point.get_location (),
- dst_point.get_fndecl (),
- dst_stack_depth),
- pp_formatted_text (&pp)));
+ (std::make_unique<precanned_custom_event>
+ (event_loc_info (dst_point.get_location (),
+ dst_point.get_fndecl (),
+ dst_stack_depth),
+ pp_formatted_text (&pp)));
}
}
@@ -2427,17 +2428,18 @@ diagnostic_manager::add_events_for_superedge (const path_builder &pb,
case SUPEREDGE_CFG_EDGE:
{
emission_path->add_event
- (make_unique<start_cfg_edge_event>
- (eedge,
- event_loc_info (last_stmt ? last_stmt->location : UNKNOWN_LOCATION,
- src_point.get_fndecl (),
- src_stack_depth)));
+ (std::make_unique<start_cfg_edge_event>
+ (eedge,
+ event_loc_info
+ (last_stmt ? last_stmt->location : UNKNOWN_LOCATION,
+ src_point.get_fndecl (),
+ src_stack_depth)));
emission_path->add_event
- (make_unique<end_cfg_edge_event>
- (eedge,
- event_loc_info (dst_point.get_supernode ()->get_start_location (),
- dst_point.get_fndecl (),
- dst_stack_depth)));
+ (std::make_unique<end_cfg_edge_event>
+ (eedge,
+ event_loc_info (dst_point.get_supernode ()->get_start_location (),
+ dst_point.get_fndecl (),
+ dst_stack_depth)));
}
break;
@@ -2450,12 +2452,13 @@ diagnostic_manager::add_events_for_superedge (const path_builder &pb,
/* TODO: add a subclass for this, or generate events for the
summary. */
emission_path->add_event
- (make_unique<debug_event> (event_loc_info (last_stmt
- ? last_stmt->location
- : UNKNOWN_LOCATION,
- src_point.get_fndecl (),
- src_stack_depth),
- "call summary"));
+ (std::make_unique<debug_event>
+ (event_loc_info (last_stmt
+ ? last_stmt->location
+ : UNKNOWN_LOCATION,
+ src_point.get_fndecl (),
+ src_stack_depth),
+ "call summary"));
}
break;
@@ -2466,10 +2469,11 @@ diagnostic_manager::add_events_for_superedge (const path_builder &pb,
const gcall &call_stmt = return_edge->get_call_stmt ();
emission_path->add_event
- (make_unique<return_event> (eedge,
- event_loc_info (call_stmt.location,
- dst_point.get_fndecl (),
- dst_stack_depth)));
+ (std::make_unique<return_event>
+ (eedge,
+ event_loc_info (call_stmt.location,
+ dst_point.get_fndecl (),
+ dst_stack_depth)));
}
break;
}
diff --git a/gcc/analyzer/engine.cc b/gcc/analyzer/engine.cc
index c04bda1..1b819ff 100644
--- a/gcc/analyzer/engine.cc
+++ b/gcc/analyzer/engine.cc
@@ -572,17 +572,17 @@ get_state_map_by_name (const char *name,
{
const sm_state_map *old_smap = m_old_state->m_checker_states[sm_idx];
*out_sm_context
- = make_unique<impl_sm_context> (*m_eg,
- sm_idx,
- *sm,
- m_enode_for_diag,
- m_old_state,
- m_new_state,
- old_smap,
- new_smap,
- m_path_ctxt,
- m_stmt_finder,
- false);
+ = std::make_unique<impl_sm_context> (*m_eg,
+ sm_idx,
+ *sm,
+ m_enode_for_diag,
+ m_old_state,
+ m_new_state,
+ old_smap,
+ new_smap,
+ m_path_ctxt,
+ m_stmt_finder,
+ false);
}
return true;
}
@@ -598,7 +598,7 @@ public:
std::unique_ptr<stmt_finder> clone () const final override
{
- return make_unique<leak_stmt_finder> (m_eg, m_var);
+ return std::make_unique<leak_stmt_finder> (m_eg, m_var);
}
const gimple *find_stmt (const exploded_path &epath)
@@ -1429,7 +1429,7 @@ exploded_node::dump (const extrinsic_state &ext_state) const
std::unique_ptr<json::object>
exploded_node::to_json (const extrinsic_state &ext_state) const
{
- auto enode_obj = ::make_unique<json::object> ();
+ auto enode_obj = std::make_unique<json::object> ();
enode_obj->set ("point", get_point ().to_json ());
enode_obj->set ("state", get_state ().to_json (ext_state));
@@ -1743,10 +1743,11 @@ exploded_node::replay_call_summary (exploded_graph &eg,
call_summary_replay r (cd, called_fn, summary, ext_state);
if (path_ctxt)
- path_ctxt->bifurcate (make_unique<call_summary_edge_info> (cd,
- called_fn,
- summary,
- ext_state));
+ path_ctxt->bifurcate
+ (std::make_unique<call_summary_edge_info> (cd,
+ called_fn,
+ summary,
+ ext_state));
}
@@ -1941,9 +1942,9 @@ exploded_node::on_longjmp (exploded_graph &eg,
/* Verify that the setjmp's call_stack hasn't been popped. */
if (!valid_longjmp_stack_p (longjmp_point, setjmp_point))
{
- ctxt->warn (make_unique<stale_jmp_buf> (setjmp_call,
- longjmp_call,
- setjmp_point));
+ ctxt->warn (std::make_unique<stale_jmp_buf> (setjmp_call,
+ longjmp_call,
+ setjmp_point));
return;
}
@@ -1977,8 +1978,8 @@ exploded_node::on_longjmp (exploded_graph &eg,
{
exploded_edge *eedge
= eg.add_edge (const_cast<exploded_node *> (this), next, NULL, true,
- make_unique<rewind_info_t> (tmp_setjmp_record,
- longjmp_call));
+ std::make_unique<rewind_info_t> (tmp_setjmp_record,
+ longjmp_call));
/* For any diagnostics that were queued here (such as leaks) we want
the checker_path to show the rewinding events after the "final event"
@@ -2122,16 +2123,16 @@ dynamic_call_info_t::add_events_to_path (checker_path *emission_path,
if (m_is_returning_call)
emission_path->add_event
- (make_unique<return_event> (eedge,
- event_loc_info (m_dynamic_call.location,
- dest_point.get_fndecl (),
- dest_stack_depth)));
+ (std::make_unique<return_event> (eedge,
+ event_loc_info (m_dynamic_call.location,
+ dest_point.get_fndecl (),
+ dest_stack_depth)));
else
emission_path->add_event
- (make_unique<call_event> (eedge,
- event_loc_info (m_dynamic_call.location,
- src_point.get_fndecl (),
- src_stack_depth)));
+ (std::make_unique<call_event> (eedge,
+ event_loc_info (m_dynamic_call.location,
+ src_point.get_fndecl (),
+ src_stack_depth)));
}
/* class rewind_info_t : public custom_edge_info. */
@@ -2176,19 +2177,19 @@ rewind_info_t::add_events_to_path (checker_path *emission_path,
const int dst_stack_depth = dst_point.get_stack_depth ();
emission_path->add_event
- (make_unique<rewind_from_longjmp_event>
- (&eedge,
- event_loc_info (get_longjmp_call ().location,
- src_point.get_fndecl (),
- src_stack_depth),
- this));
+ (std::make_unique<rewind_from_longjmp_event>
+ (&eedge,
+ event_loc_info (get_longjmp_call ().location,
+ src_point.get_fndecl (),
+ src_stack_depth),
+ this));
emission_path->add_event
- (make_unique<rewind_to_setjmp_event>
- (&eedge,
- event_loc_info (get_setjmp_call ().location,
- dst_point.get_fndecl (),
- dst_stack_depth),
- this));
+ (std::make_unique<rewind_to_setjmp_event>
+ (&eedge,
+ event_loc_info (get_setjmp_call ().location,
+ dst_point.get_fndecl (),
+ dst_stack_depth),
+ this));
}
/* class exploded_edge : public dedge<eg_traits>. */
@@ -2281,7 +2282,7 @@ exploded_edge::dump_dot_label (pretty_printer *pp) const
std::unique_ptr<json::object>
exploded_edge::to_json () const
{
- auto eedge_obj = ::make_unique<json::object> ();
+ auto eedge_obj = std::make_unique<json::object> ();
eedge_obj->set_integer ("src_idx", m_src->m_index);
eedge_obj->set_integer ("dst_idx", m_dest->m_index);
if (m_sedge)
@@ -2407,9 +2408,9 @@ strongly_connected_components::dump () const
std::unique_ptr<json::array>
strongly_connected_components::to_json () const
{
- auto scc_arr = ::make_unique<json::array> ();
+ auto scc_arr = std::make_unique<json::array> ();
for (int i = 0; i < m_sg.num_nodes (); i++)
- scc_arr->append (::make_unique<json::integer_number> (get_scc_id (i)));
+ scc_arr->append (std::make_unique<json::integer_number> (get_scc_id (i)));
return scc_arr;
}
@@ -2628,7 +2629,7 @@ worklist::key_t::cmp (const worklist::key_t &ka, const worklist::key_t &kb)
std::unique_ptr<json::object>
worklist::to_json () const
{
- auto worklist_obj = ::make_unique<json::object> ();
+ auto worklist_obj = std::make_unique<json::object> ();
worklist_obj->set ("scc", m_scc.to_json ());
@@ -2778,8 +2779,8 @@ public:
const exploded_edge &) const final override
{
emission_path->add_event
- (make_unique<tainted_args_function_custom_event>
- (event_loc_info (DECL_SOURCE_LOCATION (m_fndecl), m_fndecl, 0)));
+ (std::make_unique<tainted_args_function_custom_event>
+ (event_loc_info (DECL_SOURCE_LOCATION (m_fndecl), m_fndecl, 0)));
}
private:
@@ -2820,7 +2821,7 @@ exploded_graph::add_function_entry (const function &fun)
if (lookup_attribute ("tainted_args", DECL_ATTRIBUTES (fun.decl)))
{
if (mark_params_as_tainted (&state, fun.decl, m_ext_state))
- edge_info = make_unique<tainted_args_function_info> (fun.decl);
+ edge_info = std::make_unique<tainted_args_function_info> (fun.decl);
}
if (!state.m_valid)
@@ -3225,16 +3226,16 @@ public:
/* Show the field in the struct declaration, e.g.
"(1) field 'store' is marked with '__attribute__((tainted_args))'" */
emission_path->add_event
- (make_unique<tainted_args_field_custom_event> (m_field));
+ (std::make_unique<tainted_args_field_custom_event> (m_field));
/* Show the callback in the initializer
e.g.
"(2) function 'gadget_dev_desc_UDC_store' used as initializer
for field 'store' marked with '__attribute__((tainted_args))'". */
emission_path->add_event
- (make_unique<tainted_args_callback_custom_event>
- (event_loc_info (m_loc, m_fndecl, 0),
- m_field));
+ (std::make_unique<tainted_args_callback_custom_event>
+ (event_loc_info (m_loc, m_fndecl, 0),
+ m_field));
}
private:
@@ -3291,7 +3292,7 @@ add_tainted_args_callback (exploded_graph *eg, tree field, tree fndecl,
}
eg->add_edge (eg->get_origin (), enode, NULL, false,
- make_unique<tainted_args_call_info> (field, fndecl, loc));
+ std::make_unique<tainted_args_call_info> (field, fndecl, loc));
}
/* Callback for walk_tree for finding callbacks within initializers;
@@ -3892,7 +3893,7 @@ exploded_graph::maybe_create_dynamic_call (const gcall &call,
if (enode)
add_edge (node,enode, NULL,
false, /* No work is done by the call itself. */
- make_unique<dynamic_call_info_t> (call));
+ std::make_unique<dynamic_call_info_t> (call));
return true;
}
}
@@ -4362,7 +4363,8 @@ exploded_graph::process_node (exploded_node *node)
const svalue *fn_ptr_sval
= model->get_rvalue (fn_ptr, &ctxt);
if (fn_ptr_sval->all_zeroes_p ())
- ctxt.warn (make_unique<jump_through_null> (call));
+ ctxt.warn
+ (std::make_unique<jump_through_null> (call));
}
/* An unknown function or a special function was called
@@ -4429,7 +4431,7 @@ exploded_graph::process_node (exploded_node *node)
node);
if (enode)
add_edge (node, enode, NULL, false,
- make_unique<dynamic_call_info_t> (*call, true));
+ std::make_unique<dynamic_call_info_t> (*call, true));
}
}
}
@@ -4648,11 +4650,11 @@ exploded_graph::dump_states_for_supernode (FILE *out,
std::unique_ptr<json::object>
exploded_graph::to_json () const
{
- auto egraph_obj = ::make_unique<json::object> ();
+ auto egraph_obj = std::make_unique<json::object> ();
/* Nodes. */
{
- auto nodes_arr = ::make_unique<json::array> ();
+ auto nodes_arr = std::make_unique<json::array> ();
unsigned i;
exploded_node *n;
FOR_EACH_VEC_ELT (m_nodes, i, n)
@@ -4662,7 +4664,7 @@ exploded_graph::to_json () const
/* Edges. */
{
- auto edges_arr = ::make_unique<json::array> ();
+ auto edges_arr = std::make_unique<json::array> ();
unsigned i;
exploded_edge *n;
FOR_EACH_VEC_ELT (m_edges, i, n)
@@ -4768,9 +4770,9 @@ exploded_path::feasible_p (logger *logger,
const program_point &src_point = src_enode.get_point ();
const gimple *last_stmt
= src_point.get_supernode ()->get_last_stmt ();
- *out = ::make_unique<feasibility_problem> (edge_idx, *eedge,
- last_stmt,
- std::move (rc));
+ *out = std::make_unique<feasibility_problem> (edge_idx, *eedge,
+ last_stmt,
+ std::move (rc));
}
return false;
}
@@ -6082,7 +6084,7 @@ dump_analyzer_json (const supergraph &sg,
return;
}
- auto toplev_obj = ::make_unique<json::object> ();
+ auto toplev_obj = std::make_unique<json::object> ();
toplev_obj->set ("sgraph", sg.to_json ());
toplev_obj->set ("egraph", eg.to_json ());
diff --git a/gcc/analyzer/infinite-loop.cc b/gcc/analyzer/infinite-loop.cc
index 58927c7..ec0b079 100644
--- a/gcc/analyzer/infinite-loop.cc
+++ b/gcc/analyzer/infinite-loop.cc
@@ -86,9 +86,9 @@ struct infinite_loop
std::unique_ptr<json::object>
to_json () const
{
- auto loop_obj = ::make_unique<json::object> ();
+ auto loop_obj = std::make_unique<json::object> ();
loop_obj->set_integer ("enode", m_enode.m_index);
- auto edge_arr = ::make_unique<json::array> ();
+ auto edge_arr = std::make_unique<json::array> ();
for (auto eedge : m_eedge_vec)
edge_arr->append (eedge->to_json ());
loop_obj->set ("eedges", std::move (edge_arr));
@@ -215,7 +215,7 @@ public:
checker_path *emission_path) final override
{
emission_path->add_event
- (make_unique<warning_event>
+ (std::make_unique<warning_event>
(event_loc_info (m_inf_loop->m_loc,
enode->get_function ()->decl,
enode->get_stack_depth ()),
@@ -263,43 +263,46 @@ public:
if (switch_cfg_sedge->implicitly_created_default_p ())
{
emission_path->add_event
- (make_unique<perpetual_start_cfg_edge_event> (*eedge,
- loc_info_from));
+ (std::make_unique<perpetual_start_cfg_edge_event>
+ (*eedge,
+ loc_info_from));
emission_path->add_event
- (make_unique<end_cfg_edge_event>
- (*eedge,
- loc_info_to));
+ (std::make_unique<end_cfg_edge_event>
+ (*eedge,
+ loc_info_to));
}
}
if (cfg_sedge->true_value_p ())
{
emission_path->add_event
- (make_unique<perpetual_start_cfg_edge_event> (*eedge,
- loc_info_from));
+ (std::make_unique<perpetual_start_cfg_edge_event>
+ (*eedge,
+ loc_info_from));
emission_path->add_event
- (make_unique<end_cfg_edge_event>
- (*eedge,
- loc_info_to));
+ (std::make_unique<end_cfg_edge_event>
+ (*eedge,
+ loc_info_to));
}
else if (cfg_sedge->false_value_p ())
{
emission_path->add_event
- (make_unique<perpetual_start_cfg_edge_event> (*eedge,
- loc_info_from));
+ (std::make_unique<perpetual_start_cfg_edge_event>
+ (*eedge,
+ loc_info_from));
emission_path->add_event
- (make_unique<end_cfg_edge_event>
- (*eedge,
- loc_info_to));
+ (std::make_unique<end_cfg_edge_event>
+ (*eedge,
+ loc_info_to));
}
else if (cfg_sedge->back_edge_p ())
{
emission_path->add_event
- (make_unique<looping_back_event> (*eedge, loc_info_from));
+ (std::make_unique<looping_back_event> (*eedge, loc_info_from));
emission_path->add_event
- (make_unique<end_cfg_edge_event>
- (*eedge,
- loc_info_to));
+ (std::make_unique<end_cfg_edge_event>
+ (*eedge,
+ loc_info_to));
}
}
}
@@ -393,7 +396,7 @@ starts_infinite_loop_p (const exploded_node &enode,
feasible_node *curr_fnode = nullptr;
if (flag_dump_analyzer_infinite_loop)
- fg = ::make_unique<feasible_graph> ();
+ fg = std::make_unique<feasible_graph> ();
location_t first_loc = UNKNOWN_LOCATION;
const exploded_node *iter = &enode;
@@ -438,10 +441,10 @@ starts_infinite_loop_p (const exploded_node &enode,
fg->dump_dot (filename, nullptr, dump_args);
free (filename);
}
- return ::make_unique<infinite_loop> (enode,
- first_loc,
- std::move (eedges),
- logger);
+ return std::make_unique<infinite_loop> (enode,
+ first_loc,
+ std::move (eedges),
+ logger);
}
else
{
@@ -571,7 +574,7 @@ exploded_graph::detect_infinite_loops ()
pending_location ploc (enode, snode, inf_loop->m_loc);
auto d
- = ::make_unique<infinite_loop_diagnostic> (std::move (inf_loop));
+ = std::make_unique<infinite_loop_diagnostic> (std::move (inf_loop));
get_diagnostic_manager ().add_diagnostic (ploc, std::move (d));
}
}
diff --git a/gcc/analyzer/infinite-recursion.cc b/gcc/analyzer/infinite-recursion.cc
index 297b049..0641117 100644
--- a/gcc/analyzer/infinite-recursion.cc
+++ b/gcc/analyzer/infinite-recursion.cc
@@ -148,14 +148,15 @@ public:
{
gcc_assert (m_prev_entry_event == NULL);
std::unique_ptr<checker_event> prev_entry_event
- = make_unique <recursive_function_entry_event> (dst_point,
- *this, false);
+ = std::make_unique <recursive_function_entry_event> (dst_point,
+ *this, false);
m_prev_entry_event = prev_entry_event.get ();
emission_path->add_event (std::move (prev_entry_event));
}
else if (eedge.m_dest == m_new_entry_enode)
emission_path->add_event
- (make_unique<recursive_function_entry_event> (dst_point, *this, true));
+ (std::make_unique<recursive_function_entry_event>
+ (dst_point, *this, true));
else
pending_diagnostic::add_function_entry_event (eedge, emission_path);
}
@@ -171,7 +172,7 @@ public:
{
gcc_assert (m_new_entry_enode);
emission_path->add_event
- (make_unique<warning_event>
+ (std::make_unique<warning_event>
(event_loc_info (m_new_entry_enode->get_supernode
()->get_start_location (),
m_callee_fndecl,
@@ -623,7 +624,7 @@ exploded_graph::detect_infinite_recursion (exploded_node *enode)
nullptr);
get_diagnostic_manager ().add_diagnostic
(ploc,
- make_unique<infinite_recursion_diagnostic> (prev_entry_enode,
- enode,
- fndecl));
+ std::make_unique<infinite_recursion_diagnostic> (prev_entry_enode,
+ enode,
+ fndecl));
}
diff --git a/gcc/analyzer/kf-analyzer.cc b/gcc/analyzer/kf-analyzer.cc
index 669b497..3e671e5 100644
--- a/gcc/analyzer/kf-analyzer.cc
+++ b/gcc/analyzer/kf-analyzer.cc
@@ -297,7 +297,7 @@ public:
region_model_context *ctxt = cd.get_ctxt ();
if (!ctxt)
return;
- ctxt->warn (make_unique<dump_path_diagnostic> ());
+ ctxt->warn (std::make_unique<dump_path_diagnostic> ());
}
};
@@ -374,22 +374,28 @@ public:
void
register_known_analyzer_functions (known_function_manager &kfm)
{
- kfm.add ("__analyzer_break", make_unique<kf_analyzer_break> ());
- kfm.add ("__analyzer_describe", make_unique<kf_analyzer_describe> ());
+ kfm.add ("__analyzer_break",
+ std::make_unique<kf_analyzer_break> ());
+ kfm.add ("__analyzer_describe",
+ std::make_unique<kf_analyzer_describe> ());
kfm.add ("__analyzer_dump_capacity",
- make_unique<kf_analyzer_dump_capacity> ());
- kfm.add ("__analyzer_dump_escaped", make_unique<kf_analyzer_dump_escaped> ());
+ std::make_unique<kf_analyzer_dump_capacity> ());
+ kfm.add ("__analyzer_dump_escaped",
+ std::make_unique<kf_analyzer_dump_escaped> ());
kfm.add ("__analyzer_dump_exploded_nodes",
- make_unique<kf_analyzer_dump_exploded_nodes> ());
+ std::make_unique<kf_analyzer_dump_exploded_nodes> ());
kfm.add ("__analyzer_dump_named_constant",
- make_unique<kf_analyzer_dump_named_constant> ());
- kfm.add ("__analyzer_dump_path", make_unique<kf_analyzer_dump_path> ());
+ std::make_unique<kf_analyzer_dump_named_constant> ());
+ kfm.add ("__analyzer_dump_path",
+ std::make_unique<kf_analyzer_dump_path> ());
kfm.add ("__analyzer_dump_region_model",
- make_unique<kf_analyzer_dump_region_model> ());
- kfm.add ("__analyzer_eval", make_unique<kf_analyzer_eval> ());
+ std::make_unique<kf_analyzer_dump_region_model> ());
+ kfm.add ("__analyzer_eval",
+ std::make_unique<kf_analyzer_eval> ());
kfm.add ("__analyzer_get_unknown_ptr",
- make_unique<kf_analyzer_get_unknown_ptr> ());
- kfm.add ("__analyzer_get_strlen", make_kf_strlen ());
+ std::make_unique<kf_analyzer_get_unknown_ptr> ());
+ kfm.add ("__analyzer_get_strlen",
+ make_kf_strlen ());
}
} // namespace ana
diff --git a/gcc/analyzer/kf-lang-cp.cc b/gcc/analyzer/kf-lang-cp.cc
index 8325f15..8e08dbc 100644
--- a/gcc/analyzer/kf-lang-cp.cc
+++ b/gcc/analyzer/kf-lang-cp.cc
@@ -172,10 +172,10 @@ public:
void
register_known_functions_lang_cp (known_function_manager &kfm)
{
- kfm.add ("operator new", make_unique<kf_operator_new> ());
- kfm.add ("operator new []", make_unique<kf_operator_new> ());
- kfm.add ("operator delete", make_unique<kf_operator_delete> ());
- kfm.add ("operator delete []", make_unique<kf_operator_delete> ());
+ kfm.add ("operator new", std::make_unique<kf_operator_new> ());
+ kfm.add ("operator new []", std::make_unique<kf_operator_new> ());
+ kfm.add ("operator delete", std::make_unique<kf_operator_delete> ());
+ kfm.add ("operator delete []", std::make_unique<kf_operator_delete> ());
}
} // namespace ana
diff --git a/gcc/analyzer/kf.cc b/gcc/analyzer/kf.cc
index e7f51ac..e9ad865 100644
--- a/gcc/analyzer/kf.cc
+++ b/gcc/analyzer/kf.cc
@@ -871,7 +871,7 @@ public:
break;
case MEMSPACE_STACK:
if (ctxt)
- ctxt->warn (make_unique<putenv_of_auto_var> (fndecl, reg));
+ ctxt->warn (std::make_unique<putenv_of_auto_var> (fndecl, reg));
break;
}
cd.set_any_lhs_with_defaults ();
@@ -1119,9 +1119,9 @@ kf_realloc::impl_call_post (const call_details &cd) const
if (cd.get_ctxt ())
{
- cd.get_ctxt ()->bifurcate (make_unique<failure> (cd));
- cd.get_ctxt ()->bifurcate (make_unique<success_no_move> (cd));
- cd.get_ctxt ()->bifurcate (make_unique<success_with_move> (cd));
+ cd.get_ctxt ()->bifurcate (std::make_unique<failure> (cd));
+ cd.get_ctxt ()->bifurcate (std::make_unique<success_no_move> (cd));
+ cd.get_ctxt ()->bifurcate (std::make_unique<success_with_move> (cd));
cd.get_ctxt ()->terminate_path ();
}
}
@@ -1210,8 +1210,8 @@ kf_strchr::impl_call_post (const call_details &cd) const
/* Body of kf_strchr::impl_call_post. */
if (cd.get_ctxt ())
{
- cd.get_ctxt ()->bifurcate (make_unique<strchr_call_info> (cd, false));
- cd.get_ctxt ()->bifurcate (make_unique<strchr_call_info> (cd, true));
+ cd.get_ctxt ()->bifurcate (std::make_unique<strchr_call_info> (cd, false));
+ cd.get_ctxt ()->bifurcate (std::make_unique<strchr_call_info> (cd, true));
cd.get_ctxt ()->terminate_path ();
}
}
@@ -1466,7 +1466,7 @@ public:
std::unique_ptr<known_function>
make_kf_strlen ()
{
- return make_unique<kf_strlen> ();
+ return std::make_unique<kf_strlen> ();
}
/* Handler for "strncpy" and "__builtin_strncpy".
@@ -1640,11 +1640,13 @@ kf_strncpy::impl_call_post (const call_details &cd) const
nullptr,
nullptr);
cd.get_ctxt ()->bifurcate
- (make_unique<strncpy_call_info> (cd, num_bytes_with_terminator_sval,
- false));
+ (std::make_unique<strncpy_call_info>
+ (cd, num_bytes_with_terminator_sval,
+ false));
cd.get_ctxt ()->bifurcate
- (make_unique<strncpy_call_info> (cd, num_bytes_with_terminator_sval,
- true));
+ (std::make_unique<strncpy_call_info>
+ (cd, num_bytes_with_terminator_sval,
+ true));
cd.get_ctxt ()->terminate_path ();
}
};
@@ -1767,8 +1769,8 @@ kf_strstr::impl_call_post (const call_details &cd) const
/* Body of kf_strstr::impl_call_post. */
if (cd.get_ctxt ())
{
- cd.get_ctxt ()->bifurcate (make_unique<strstr_call_info> (cd, false));
- cd.get_ctxt ()->bifurcate (make_unique<strstr_call_info> (cd, true));
+ cd.get_ctxt ()->bifurcate (std::make_unique<strstr_call_info> (cd, false));
+ cd.get_ctxt ()->bifurcate (std::make_unique<strstr_call_info> (cd, true));
cd.get_ctxt ()->terminate_path ();
}
}
@@ -1914,7 +1916,7 @@ public:
if (cd.get_arg_svalue (0)->all_zeroes_p ())
{
if (ctxt)
- ctxt->warn (::make_unique<undefined_behavior> (cd));
+ ctxt->warn (::std::make_unique<undefined_behavior> (cd));
}
/* Assume that "str" was actually non-null; terminate
@@ -2032,13 +2034,13 @@ public:
Typically the str is either null or non-null at a particular site,
so hopefully this will generally just lead to two out-edges. */
cd.get_ctxt ()->bifurcate
- (make_unique<strtok_call_info> (cd, m_private_reg, false, false));
+ (std::make_unique<strtok_call_info> (cd, m_private_reg, false, false));
cd.get_ctxt ()->bifurcate
- (make_unique<strtok_call_info> (cd, m_private_reg, false, true));
+ (std::make_unique<strtok_call_info> (cd, m_private_reg, false, true));
cd.get_ctxt ()->bifurcate
- (make_unique<strtok_call_info> (cd, m_private_reg, true, false));
+ (std::make_unique<strtok_call_info> (cd, m_private_reg, true, false));
cd.get_ctxt ()->bifurcate
- (make_unique<strtok_call_info> (cd, m_private_reg, true, true));
+ (std::make_unique<strtok_call_info> (cd, m_private_reg, true, true));
cd.get_ctxt ()->terminate_path ();
}
}
@@ -2064,127 +2066,127 @@ region_model::impl_deallocation_call (const call_details &cd)
static void
register_atomic_builtins (known_function_manager &kfm)
{
- kfm.add (BUILT_IN_ATOMIC_EXCHANGE, make_unique<kf_atomic_exchange> ());
- kfm.add (BUILT_IN_ATOMIC_EXCHANGE_N, make_unique<kf_atomic_exchange_n> ());
- kfm.add (BUILT_IN_ATOMIC_EXCHANGE_1, make_unique<kf_atomic_exchange_n> ());
- kfm.add (BUILT_IN_ATOMIC_EXCHANGE_2, make_unique<kf_atomic_exchange_n> ());
- kfm.add (BUILT_IN_ATOMIC_EXCHANGE_4, make_unique<kf_atomic_exchange_n> ());
- kfm.add (BUILT_IN_ATOMIC_EXCHANGE_8, make_unique<kf_atomic_exchange_n> ());
- kfm.add (BUILT_IN_ATOMIC_EXCHANGE_16, make_unique<kf_atomic_exchange_n> ());
- kfm.add (BUILT_IN_ATOMIC_LOAD, make_unique<kf_atomic_load> ());
- kfm.add (BUILT_IN_ATOMIC_LOAD_N, make_unique<kf_atomic_load_n> ());
- kfm.add (BUILT_IN_ATOMIC_LOAD_1, make_unique<kf_atomic_load_n> ());
- kfm.add (BUILT_IN_ATOMIC_LOAD_2, make_unique<kf_atomic_load_n> ());
- kfm.add (BUILT_IN_ATOMIC_LOAD_4, make_unique<kf_atomic_load_n> ());
- kfm.add (BUILT_IN_ATOMIC_LOAD_8, make_unique<kf_atomic_load_n> ());
- kfm.add (BUILT_IN_ATOMIC_LOAD_16, make_unique<kf_atomic_load_n> ());
- kfm.add (BUILT_IN_ATOMIC_STORE, make_unique<kf_atomic_store> ());
- kfm.add (BUILT_IN_ATOMIC_STORE_N, make_unique<kf_atomic_store_n> ());
- kfm.add (BUILT_IN_ATOMIC_STORE_1, make_unique<kf_atomic_store_n> ());
- kfm.add (BUILT_IN_ATOMIC_STORE_2, make_unique<kf_atomic_store_n> ());
- kfm.add (BUILT_IN_ATOMIC_STORE_4, make_unique<kf_atomic_store_n> ());
- kfm.add (BUILT_IN_ATOMIC_STORE_8, make_unique<kf_atomic_store_n> ());
- kfm.add (BUILT_IN_ATOMIC_STORE_16, make_unique<kf_atomic_store_n> ());
+ kfm.add (BUILT_IN_ATOMIC_EXCHANGE, std::make_unique<kf_atomic_exchange> ());
+ kfm.add (BUILT_IN_ATOMIC_EXCHANGE_N, std::make_unique<kf_atomic_exchange_n> ());
+ kfm.add (BUILT_IN_ATOMIC_EXCHANGE_1, std::make_unique<kf_atomic_exchange_n> ());
+ kfm.add (BUILT_IN_ATOMIC_EXCHANGE_2, std::make_unique<kf_atomic_exchange_n> ());
+ kfm.add (BUILT_IN_ATOMIC_EXCHANGE_4, std::make_unique<kf_atomic_exchange_n> ());
+ kfm.add (BUILT_IN_ATOMIC_EXCHANGE_8, std::make_unique<kf_atomic_exchange_n> ());
+ kfm.add (BUILT_IN_ATOMIC_EXCHANGE_16, std::make_unique<kf_atomic_exchange_n> ());
+ kfm.add (BUILT_IN_ATOMIC_LOAD, std::make_unique<kf_atomic_load> ());
+ kfm.add (BUILT_IN_ATOMIC_LOAD_N, std::make_unique<kf_atomic_load_n> ());
+ kfm.add (BUILT_IN_ATOMIC_LOAD_1, std::make_unique<kf_atomic_load_n> ());
+ kfm.add (BUILT_IN_ATOMIC_LOAD_2, std::make_unique<kf_atomic_load_n> ());
+ kfm.add (BUILT_IN_ATOMIC_LOAD_4, std::make_unique<kf_atomic_load_n> ());
+ kfm.add (BUILT_IN_ATOMIC_LOAD_8, std::make_unique<kf_atomic_load_n> ());
+ kfm.add (BUILT_IN_ATOMIC_LOAD_16, std::make_unique<kf_atomic_load_n> ());
+ kfm.add (BUILT_IN_ATOMIC_STORE, std::make_unique<kf_atomic_store> ());
+ kfm.add (BUILT_IN_ATOMIC_STORE_N, std::make_unique<kf_atomic_store_n> ());
+ kfm.add (BUILT_IN_ATOMIC_STORE_1, std::make_unique<kf_atomic_store_n> ());
+ kfm.add (BUILT_IN_ATOMIC_STORE_2, std::make_unique<kf_atomic_store_n> ());
+ kfm.add (BUILT_IN_ATOMIC_STORE_4, std::make_unique<kf_atomic_store_n> ());
+ kfm.add (BUILT_IN_ATOMIC_STORE_8, std::make_unique<kf_atomic_store_n> ());
+ kfm.add (BUILT_IN_ATOMIC_STORE_16, std::make_unique<kf_atomic_store_n> ());
kfm.add (BUILT_IN_ATOMIC_ADD_FETCH_1,
- make_unique<kf_atomic_op_fetch> (PLUS_EXPR));
+ std::make_unique<kf_atomic_op_fetch> (PLUS_EXPR));
kfm.add (BUILT_IN_ATOMIC_ADD_FETCH_2,
- make_unique<kf_atomic_op_fetch> (PLUS_EXPR));
+ std::make_unique<kf_atomic_op_fetch> (PLUS_EXPR));
kfm.add (BUILT_IN_ATOMIC_ADD_FETCH_4,
- make_unique<kf_atomic_op_fetch> (PLUS_EXPR));
+ std::make_unique<kf_atomic_op_fetch> (PLUS_EXPR));
kfm.add (BUILT_IN_ATOMIC_ADD_FETCH_8,
- make_unique<kf_atomic_op_fetch> (PLUS_EXPR));
+ std::make_unique<kf_atomic_op_fetch> (PLUS_EXPR));
kfm.add (BUILT_IN_ATOMIC_ADD_FETCH_16,
- make_unique<kf_atomic_op_fetch> (PLUS_EXPR));
+ std::make_unique<kf_atomic_op_fetch> (PLUS_EXPR));
kfm.add (BUILT_IN_ATOMIC_SUB_FETCH_1,
- make_unique<kf_atomic_op_fetch> (MINUS_EXPR));
+ std::make_unique<kf_atomic_op_fetch> (MINUS_EXPR));
kfm.add (BUILT_IN_ATOMIC_SUB_FETCH_2,
- make_unique<kf_atomic_op_fetch> (MINUS_EXPR));
+ std::make_unique<kf_atomic_op_fetch> (MINUS_EXPR));
kfm.add (BUILT_IN_ATOMIC_SUB_FETCH_4,
- make_unique<kf_atomic_op_fetch> (MINUS_EXPR));
+ std::make_unique<kf_atomic_op_fetch> (MINUS_EXPR));
kfm.add (BUILT_IN_ATOMIC_SUB_FETCH_8,
- make_unique<kf_atomic_op_fetch> (MINUS_EXPR));
+ std::make_unique<kf_atomic_op_fetch> (MINUS_EXPR));
kfm.add (BUILT_IN_ATOMIC_SUB_FETCH_16,
- make_unique<kf_atomic_op_fetch> (MINUS_EXPR));
+ std::make_unique<kf_atomic_op_fetch> (MINUS_EXPR));
kfm.add (BUILT_IN_ATOMIC_AND_FETCH_1,
- make_unique<kf_atomic_op_fetch> (BIT_AND_EXPR));
+ std::make_unique<kf_atomic_op_fetch> (BIT_AND_EXPR));
kfm.add (BUILT_IN_ATOMIC_AND_FETCH_2,
- make_unique<kf_atomic_op_fetch> (BIT_AND_EXPR));
+ std::make_unique<kf_atomic_op_fetch> (BIT_AND_EXPR));
kfm.add (BUILT_IN_ATOMIC_AND_FETCH_4,
- make_unique<kf_atomic_op_fetch> (BIT_AND_EXPR));
+ std::make_unique<kf_atomic_op_fetch> (BIT_AND_EXPR));
kfm.add (BUILT_IN_ATOMIC_AND_FETCH_8,
- make_unique<kf_atomic_op_fetch> (BIT_AND_EXPR));
+ std::make_unique<kf_atomic_op_fetch> (BIT_AND_EXPR));
kfm.add (BUILT_IN_ATOMIC_AND_FETCH_16,
- make_unique<kf_atomic_op_fetch> (BIT_AND_EXPR));
+ std::make_unique<kf_atomic_op_fetch> (BIT_AND_EXPR));
kfm.add (BUILT_IN_ATOMIC_XOR_FETCH_1,
- make_unique<kf_atomic_op_fetch> (BIT_XOR_EXPR));
+ std::make_unique<kf_atomic_op_fetch> (BIT_XOR_EXPR));
kfm.add (BUILT_IN_ATOMIC_XOR_FETCH_2,
- make_unique<kf_atomic_op_fetch> (BIT_XOR_EXPR));
+ std::make_unique<kf_atomic_op_fetch> (BIT_XOR_EXPR));
kfm.add (BUILT_IN_ATOMIC_XOR_FETCH_4,
- make_unique<kf_atomic_op_fetch> (BIT_XOR_EXPR));
+ std::make_unique<kf_atomic_op_fetch> (BIT_XOR_EXPR));
kfm.add (BUILT_IN_ATOMIC_XOR_FETCH_8,
- make_unique<kf_atomic_op_fetch> (BIT_XOR_EXPR));
+ std::make_unique<kf_atomic_op_fetch> (BIT_XOR_EXPR));
kfm.add (BUILT_IN_ATOMIC_XOR_FETCH_16,
- make_unique<kf_atomic_op_fetch> (BIT_XOR_EXPR));
+ std::make_unique<kf_atomic_op_fetch> (BIT_XOR_EXPR));
kfm.add (BUILT_IN_ATOMIC_OR_FETCH_1,
- make_unique<kf_atomic_op_fetch> (BIT_IOR_EXPR));
+ std::make_unique<kf_atomic_op_fetch> (BIT_IOR_EXPR));
kfm.add (BUILT_IN_ATOMIC_OR_FETCH_2,
- make_unique<kf_atomic_op_fetch> (BIT_IOR_EXPR));
+ std::make_unique<kf_atomic_op_fetch> (BIT_IOR_EXPR));
kfm.add (BUILT_IN_ATOMIC_OR_FETCH_4,
- make_unique<kf_atomic_op_fetch> (BIT_IOR_EXPR));
+ std::make_unique<kf_atomic_op_fetch> (BIT_IOR_EXPR));
kfm.add (BUILT_IN_ATOMIC_OR_FETCH_8,
- make_unique<kf_atomic_op_fetch> (BIT_IOR_EXPR));
+ std::make_unique<kf_atomic_op_fetch> (BIT_IOR_EXPR));
kfm.add (BUILT_IN_ATOMIC_OR_FETCH_16,
- make_unique<kf_atomic_op_fetch> (BIT_IOR_EXPR));
+ std::make_unique<kf_atomic_op_fetch> (BIT_IOR_EXPR));
kfm.add (BUILT_IN_ATOMIC_FETCH_ADD_1,
- make_unique<kf_atomic_fetch_op> (PLUS_EXPR));
+ std::make_unique<kf_atomic_fetch_op> (PLUS_EXPR));
kfm.add (BUILT_IN_ATOMIC_FETCH_ADD_2,
- make_unique<kf_atomic_fetch_op> (PLUS_EXPR));
+ std::make_unique<kf_atomic_fetch_op> (PLUS_EXPR));
kfm.add (BUILT_IN_ATOMIC_FETCH_ADD_4,
- make_unique<kf_atomic_fetch_op> (PLUS_EXPR));
+ std::make_unique<kf_atomic_fetch_op> (PLUS_EXPR));
kfm.add (BUILT_IN_ATOMIC_FETCH_ADD_8,
- make_unique<kf_atomic_fetch_op> (PLUS_EXPR));
+ std::make_unique<kf_atomic_fetch_op> (PLUS_EXPR));
kfm.add (BUILT_IN_ATOMIC_FETCH_ADD_16,
- make_unique<kf_atomic_fetch_op> (PLUS_EXPR));
+ std::make_unique<kf_atomic_fetch_op> (PLUS_EXPR));
kfm.add (BUILT_IN_ATOMIC_FETCH_SUB_1,
- make_unique<kf_atomic_fetch_op> (MINUS_EXPR));
+ std::make_unique<kf_atomic_fetch_op> (MINUS_EXPR));
kfm.add (BUILT_IN_ATOMIC_FETCH_SUB_2,
- make_unique<kf_atomic_fetch_op> (MINUS_EXPR));
+ std::make_unique<kf_atomic_fetch_op> (MINUS_EXPR));
kfm.add (BUILT_IN_ATOMIC_FETCH_SUB_4,
- make_unique<kf_atomic_fetch_op> (MINUS_EXPR));
+ std::make_unique<kf_atomic_fetch_op> (MINUS_EXPR));
kfm.add (BUILT_IN_ATOMIC_FETCH_SUB_8,
- make_unique<kf_atomic_fetch_op> (MINUS_EXPR));
+ std::make_unique<kf_atomic_fetch_op> (MINUS_EXPR));
kfm.add (BUILT_IN_ATOMIC_FETCH_SUB_16,
- make_unique<kf_atomic_fetch_op> (MINUS_EXPR));
+ std::make_unique<kf_atomic_fetch_op> (MINUS_EXPR));
kfm.add (BUILT_IN_ATOMIC_FETCH_AND_1,
- make_unique<kf_atomic_fetch_op> (BIT_AND_EXPR));
+ std::make_unique<kf_atomic_fetch_op> (BIT_AND_EXPR));
kfm.add (BUILT_IN_ATOMIC_FETCH_AND_2,
- make_unique<kf_atomic_fetch_op> (BIT_AND_EXPR));
+ std::make_unique<kf_atomic_fetch_op> (BIT_AND_EXPR));
kfm.add (BUILT_IN_ATOMIC_FETCH_AND_4,
- make_unique<kf_atomic_fetch_op> (BIT_AND_EXPR));
+ std::make_unique<kf_atomic_fetch_op> (BIT_AND_EXPR));
kfm.add (BUILT_IN_ATOMIC_FETCH_AND_8,
- make_unique<kf_atomic_fetch_op> (BIT_AND_EXPR));
+ std::make_unique<kf_atomic_fetch_op> (BIT_AND_EXPR));
kfm.add (BUILT_IN_ATOMIC_FETCH_AND_16,
- make_unique<kf_atomic_fetch_op> (BIT_AND_EXPR));
+ std::make_unique<kf_atomic_fetch_op> (BIT_AND_EXPR));
kfm.add (BUILT_IN_ATOMIC_FETCH_XOR_1,
- make_unique<kf_atomic_fetch_op> (BIT_XOR_EXPR));
+ std::make_unique<kf_atomic_fetch_op> (BIT_XOR_EXPR));
kfm.add (BUILT_IN_ATOMIC_FETCH_XOR_2,
- make_unique<kf_atomic_fetch_op> (BIT_XOR_EXPR));
+ std::make_unique<kf_atomic_fetch_op> (BIT_XOR_EXPR));
kfm.add (BUILT_IN_ATOMIC_FETCH_XOR_4,
- make_unique<kf_atomic_fetch_op> (BIT_XOR_EXPR));
+ std::make_unique<kf_atomic_fetch_op> (BIT_XOR_EXPR));
kfm.add (BUILT_IN_ATOMIC_FETCH_XOR_8,
- make_unique<kf_atomic_fetch_op> (BIT_XOR_EXPR));
+ std::make_unique<kf_atomic_fetch_op> (BIT_XOR_EXPR));
kfm.add (BUILT_IN_ATOMIC_FETCH_XOR_16,
- make_unique<kf_atomic_fetch_op> (BIT_XOR_EXPR));
+ std::make_unique<kf_atomic_fetch_op> (BIT_XOR_EXPR));
kfm.add (BUILT_IN_ATOMIC_FETCH_OR_1,
- make_unique<kf_atomic_fetch_op> (BIT_IOR_EXPR));
+ std::make_unique<kf_atomic_fetch_op> (BIT_IOR_EXPR));
kfm.add (BUILT_IN_ATOMIC_FETCH_OR_2,
- make_unique<kf_atomic_fetch_op> (BIT_IOR_EXPR));
+ std::make_unique<kf_atomic_fetch_op> (BIT_IOR_EXPR));
kfm.add (BUILT_IN_ATOMIC_FETCH_OR_4,
- make_unique<kf_atomic_fetch_op> (BIT_IOR_EXPR));
+ std::make_unique<kf_atomic_fetch_op> (BIT_IOR_EXPR));
kfm.add (BUILT_IN_ATOMIC_FETCH_OR_8,
- make_unique<kf_atomic_fetch_op> (BIT_IOR_EXPR));
+ std::make_unique<kf_atomic_fetch_op> (BIT_IOR_EXPR));
kfm.add (BUILT_IN_ATOMIC_FETCH_OR_16,
- make_unique<kf_atomic_fetch_op> (BIT_IOR_EXPR));
+ std::make_unique<kf_atomic_fetch_op> (BIT_IOR_EXPR));
}
/* Handle calls to the various IFN_UBSAN_* with no return value.
@@ -2214,14 +2216,14 @@ register_sanitizer_builtins (known_function_manager &kfm)
/* Handle calls to the various IFN_UBSAN_* with no return value.
For now, treat these as no-ops. */
kfm.add (IFN_UBSAN_NULL,
- make_unique<kf_ubsan_noop> ());
+ std::make_unique<kf_ubsan_noop> ());
kfm.add (IFN_UBSAN_BOUNDS,
- make_unique<kf_ubsan_noop> ());
+ std::make_unique<kf_ubsan_noop> ());
kfm.add (IFN_UBSAN_PTR,
- make_unique<kf_ubsan_noop> ());
+ std::make_unique<kf_ubsan_noop> ());
kfm.add (BUILT_IN_UBSAN_HANDLE_NONNULL_ARG,
- make_unique<kf_ubsan_handler> ());
+ std::make_unique<kf_ubsan_handler> ());
}
/* Populate KFM with instances of known functions supported by the core of the
@@ -2236,17 +2238,17 @@ register_known_functions (known_function_manager &kfm,
/* Internal fns the analyzer has known_functions for. */
{
- kfm.add (IFN_BUILTIN_EXPECT, make_unique<kf_expect> ());
+ kfm.add (IFN_BUILTIN_EXPECT, std::make_unique<kf_expect> ());
}
/* GCC built-ins that do not correspond to a function
in the standard library. */
{
- kfm.add (BUILT_IN_EXPECT, make_unique<kf_expect> ());
- kfm.add (BUILT_IN_EXPECT_WITH_PROBABILITY, make_unique<kf_expect> ());
- kfm.add (BUILT_IN_ALLOCA_WITH_ALIGN, make_unique<kf_alloca> ());
- kfm.add (BUILT_IN_STACK_RESTORE, make_unique<kf_stack_restore> ());
- kfm.add (BUILT_IN_STACK_SAVE, make_unique<kf_stack_save> ());
+ kfm.add (BUILT_IN_EXPECT, std::make_unique<kf_expect> ());
+ kfm.add (BUILT_IN_EXPECT_WITH_PROBABILITY, std::make_unique<kf_expect> ());
+ kfm.add (BUILT_IN_ALLOCA_WITH_ALIGN, std::make_unique<kf_alloca> ());
+ kfm.add (BUILT_IN_STACK_RESTORE, std::make_unique<kf_stack_restore> ());
+ kfm.add (BUILT_IN_STACK_SAVE, std::make_unique<kf_stack_save> ());
register_atomic_builtins (kfm);
register_sanitizer_builtins (kfm);
@@ -2256,58 +2258,58 @@ register_known_functions (known_function_manager &kfm,
/* Known builtins and C standard library functions
the analyzer has known functions for. */
{
- kfm.add ("alloca", make_unique<kf_alloca> ());
- kfm.add ("__builtin_alloca", make_unique<kf_alloca> ());
- kfm.add ("calloc", make_unique<kf_calloc> ());
- kfm.add ("__builtin_calloc", make_unique<kf_calloc> ());
- kfm.add ("free", make_unique<kf_free> ());
- kfm.add ("__builtin_free", make_unique<kf_free> ());
- kfm.add ("malloc", make_unique<kf_malloc> ());
- kfm.add ("__builtin_malloc", make_unique<kf_malloc> ());
+ kfm.add ("alloca", std::make_unique<kf_alloca> ());
+ kfm.add ("__builtin_alloca", std::make_unique<kf_alloca> ());
+ kfm.add ("calloc", std::make_unique<kf_calloc> ());
+ kfm.add ("__builtin_calloc", std::make_unique<kf_calloc> ());
+ kfm.add ("free", std::make_unique<kf_free> ());
+ kfm.add ("__builtin_free", std::make_unique<kf_free> ());
+ kfm.add ("malloc", std::make_unique<kf_malloc> ());
+ kfm.add ("__builtin_malloc", std::make_unique<kf_malloc> ());
kfm.add ("memcpy",
- make_unique<kf_memcpy_memmove> (kf_memcpy_memmove::KF_MEMCPY));
+ std::make_unique<kf_memcpy_memmove> (kf_memcpy_memmove::KF_MEMCPY));
kfm.add ("__builtin_memcpy",
- make_unique<kf_memcpy_memmove> (kf_memcpy_memmove::KF_MEMCPY));
- kfm.add ("__memcpy_chk", make_unique<kf_memcpy_memmove>
+ std::make_unique<kf_memcpy_memmove> (kf_memcpy_memmove::KF_MEMCPY));
+ kfm.add ("__memcpy_chk", std::make_unique<kf_memcpy_memmove>
(kf_memcpy_memmove::KF_MEMCPY_CHK));
- kfm.add ("__builtin___memcpy_chk", make_unique<kf_memcpy_memmove>
+ kfm.add ("__builtin___memcpy_chk", std::make_unique<kf_memcpy_memmove>
(kf_memcpy_memmove::KF_MEMCPY_CHK));
kfm.add ("memmove",
- make_unique<kf_memcpy_memmove> (kf_memcpy_memmove::KF_MEMMOVE));
+ std::make_unique<kf_memcpy_memmove> (kf_memcpy_memmove::KF_MEMMOVE));
kfm.add ("__builtin_memmove",
- make_unique<kf_memcpy_memmove> (kf_memcpy_memmove::KF_MEMMOVE));
- kfm.add ("__memmove_chk", make_unique<kf_memcpy_memmove>
+ std::make_unique<kf_memcpy_memmove> (kf_memcpy_memmove::KF_MEMMOVE));
+ kfm.add ("__memmove_chk", std::make_unique<kf_memcpy_memmove>
(kf_memcpy_memmove::KF_MEMMOVE_CHK));
- kfm.add ("__builtin___memmove_chk", make_unique<kf_memcpy_memmove>
+ kfm.add ("__builtin___memmove_chk", std::make_unique<kf_memcpy_memmove>
(kf_memcpy_memmove::KF_MEMMOVE_CHK));
- kfm.add ("memset", make_unique<kf_memset> (false));
- kfm.add ("__builtin_memset", make_unique<kf_memset> (false));
- kfm.add ("__memset_chk", make_unique<kf_memset> (true));
- kfm.add ("__builtin___memset_chk", make_unique<kf_memset> (true));
- kfm.add ("realloc", make_unique<kf_realloc> ());
- kfm.add ("__builtin_realloc", make_unique<kf_realloc> ());
- kfm.add ("sprintf", make_unique<kf_sprintf> ());
- kfm.add ("__builtin_sprintf", make_unique<kf_sprintf> ());
- kfm.add ("strchr", make_unique<kf_strchr> ());
- kfm.add ("__builtin_strchr", make_unique<kf_strchr> ());
- kfm.add ("strcpy", make_unique<kf_strcpy> (2, false));
- kfm.add ("__builtin_strcpy", make_unique<kf_strcpy> (2, false));
- kfm.add ("__strcpy_chk", make_unique<kf_strcpy> (3, true));
- kfm.add ("__builtin___strcpy_chk", make_unique<kf_strcpy> (3, true));
- kfm.add ("strcat", make_unique<kf_strcat> (2, false));
- kfm.add ("__builtin_strcat", make_unique<kf_strcat> (2, false));
- kfm.add ("__strcat_chk", make_unique<kf_strcat> (3, true));
- kfm.add ("__builtin___strcat_chk", make_unique<kf_strcat> (3, true));
- kfm.add ("strdup", make_unique<kf_strdup> ());
- kfm.add ("__builtin_strdup", make_unique<kf_strdup> ());
- kfm.add ("strncpy", make_unique<kf_strncpy> ());
- kfm.add ("__builtin_strncpy", make_unique<kf_strncpy> ());
- kfm.add ("strndup", make_unique<kf_strndup> ());
- kfm.add ("__builtin_strndup", make_unique<kf_strndup> ());
- kfm.add ("strlen", make_unique<kf_strlen> ());
- kfm.add ("__builtin_strlen", make_unique<kf_strlen> ());
- kfm.add ("strstr", make_unique<kf_strstr> ());
- kfm.add ("__builtin_strstr", make_unique<kf_strstr> ());
+ kfm.add ("memset", std::make_unique<kf_memset> (false));
+ kfm.add ("__builtin_memset", std::make_unique<kf_memset> (false));
+ kfm.add ("__memset_chk", std::make_unique<kf_memset> (true));
+ kfm.add ("__builtin___memset_chk", std::make_unique<kf_memset> (true));
+ kfm.add ("realloc", std::make_unique<kf_realloc> ());
+ kfm.add ("__builtin_realloc", std::make_unique<kf_realloc> ());
+ kfm.add ("sprintf", std::make_unique<kf_sprintf> ());
+ kfm.add ("__builtin_sprintf", std::make_unique<kf_sprintf> ());
+ kfm.add ("strchr", std::make_unique<kf_strchr> ());
+ kfm.add ("__builtin_strchr", std::make_unique<kf_strchr> ());
+ kfm.add ("strcpy", std::make_unique<kf_strcpy> (2, false));
+ kfm.add ("__builtin_strcpy", std::make_unique<kf_strcpy> (2, false));
+ kfm.add ("__strcpy_chk", std::make_unique<kf_strcpy> (3, true));
+ kfm.add ("__builtin___strcpy_chk", std::make_unique<kf_strcpy> (3, true));
+ kfm.add ("strcat", std::make_unique<kf_strcat> (2, false));
+ kfm.add ("__builtin_strcat", std::make_unique<kf_strcat> (2, false));
+ kfm.add ("__strcat_chk", std::make_unique<kf_strcat> (3, true));
+ kfm.add ("__builtin___strcat_chk", std::make_unique<kf_strcat> (3, true));
+ kfm.add ("strdup", std::make_unique<kf_strdup> ());
+ kfm.add ("__builtin_strdup", std::make_unique<kf_strdup> ());
+ kfm.add ("strncpy", std::make_unique<kf_strncpy> ());
+ kfm.add ("__builtin_strncpy", std::make_unique<kf_strncpy> ());
+ kfm.add ("strndup", std::make_unique<kf_strndup> ());
+ kfm.add ("__builtin_strndup", std::make_unique<kf_strndup> ());
+ kfm.add ("strlen", std::make_unique<kf_strlen> ());
+ kfm.add ("__builtin_strlen", std::make_unique<kf_strlen> ());
+ kfm.add ("strstr", std::make_unique<kf_strstr> ());
+ kfm.add ("__builtin_strstr", std::make_unique<kf_strstr> ());
register_atomic_builtins (kfm);
register_varargs_builtins (kfm);
@@ -2315,9 +2317,9 @@ register_known_functions (known_function_manager &kfm,
/* Known POSIX functions, and some non-standard extensions. */
{
- kfm.add ("fopen", make_unique<kf_fopen> ());
- kfm.add ("putenv", make_unique<kf_putenv> ());
- kfm.add ("strtok", make_unique<kf_strtok> (rmm));
+ kfm.add ("fopen", std::make_unique<kf_fopen> ());
+ kfm.add ("putenv", std::make_unique<kf_putenv> ());
+ kfm.add ("strtok", std::make_unique<kf_strtok> (rmm));
register_known_fd_functions (kfm);
register_known_file_functions (kfm);
@@ -2325,13 +2327,13 @@ register_known_functions (known_function_manager &kfm,
/* glibc functions. */
{
- kfm.add ("__errno_location", make_unique<kf_errno_location> ());
- kfm.add ("error", make_unique<kf_error> (3));
- kfm.add ("error_at_line", make_unique<kf_error> (5));
+ kfm.add ("__errno_location", std::make_unique<kf_errno_location> ());
+ kfm.add ("error", std::make_unique<kf_error> (3));
+ kfm.add ("error_at_line", std::make_unique<kf_error> (5));
/* Variants of "error" and "error_at_line" seen by the
analyzer at -O0 (PR analyzer/115724). */
- kfm.add ("__error_alias", make_unique<kf_error> (3));
- kfm.add ("__error_at_line_alias", make_unique<kf_error> (5));
+ kfm.add ("__error_alias", std::make_unique<kf_error> (3));
+ kfm.add ("__error_at_line_alias", std::make_unique<kf_error> (5));
}
/* Other implementations of C standard library. */
@@ -2345,9 +2347,9 @@ register_known_functions (known_function_manager &kfm,
#define errno (*__error())
and similarly __errno for newlib.
Add these as synonyms for "__errno_location". */
- kfm.add ("___errno", make_unique<kf_errno_location> ());
- kfm.add ("__error", make_unique<kf_errno_location> ());
- kfm.add ("__errno", make_unique<kf_errno_location> ());
+ kfm.add ("___errno", std::make_unique<kf_errno_location> ());
+ kfm.add ("__error", std::make_unique<kf_errno_location> ());
+ kfm.add ("__errno", std::make_unique<kf_errno_location> ());
}
/* Language-specific support functions. */
@@ -2357,22 +2359,22 @@ register_known_functions (known_function_manager &kfm,
from <cstdlib> etc for the C spellings of these headers (e.g. <stdlib.h>),
so we must match against these too. */
{
- kfm.add_std_ns ("malloc", make_unique<kf_malloc> ());
- kfm.add_std_ns ("free", make_unique<kf_free> ());
- kfm.add_std_ns ("realloc", make_unique<kf_realloc> ());
- kfm.add_std_ns ("calloc", make_unique<kf_calloc> ());
+ kfm.add_std_ns ("malloc", std::make_unique<kf_malloc> ());
+ kfm.add_std_ns ("free", std::make_unique<kf_free> ());
+ kfm.add_std_ns ("realloc", std::make_unique<kf_realloc> ());
+ kfm.add_std_ns ("calloc", std::make_unique<kf_calloc> ());
kfm.add_std_ns
("memcpy",
- make_unique<kf_memcpy_memmove> (kf_memcpy_memmove::KF_MEMCPY));
+ std::make_unique<kf_memcpy_memmove> (kf_memcpy_memmove::KF_MEMCPY));
kfm.add_std_ns
("memmove",
- make_unique<kf_memcpy_memmove> (kf_memcpy_memmove::KF_MEMMOVE));
- kfm.add_std_ns ("memset", make_unique<kf_memset> (false));
- kfm.add_std_ns ("strcat", make_unique<kf_strcat> (2, false));
- kfm.add_std_ns ("strcpy", make_unique<kf_strcpy> (2, false));
- kfm.add_std_ns ("strlen", make_unique<kf_strlen> ());
- kfm.add_std_ns ("strncpy", make_unique<kf_strncpy> ());
- kfm.add_std_ns ("strtok", make_unique<kf_strtok> (rmm));
+ std::make_unique<kf_memcpy_memmove> (kf_memcpy_memmove::KF_MEMMOVE));
+ kfm.add_std_ns ("memset", std::make_unique<kf_memset> (false));
+ kfm.add_std_ns ("strcat", std::make_unique<kf_strcat> (2, false));
+ kfm.add_std_ns ("strcpy", std::make_unique<kf_strcpy> (2, false));
+ kfm.add_std_ns ("strlen", std::make_unique<kf_strlen> ());
+ kfm.add_std_ns ("strncpy", std::make_unique<kf_strncpy> ());
+ kfm.add_std_ns ("strtok", std::make_unique<kf_strtok> (rmm));
}
}
diff --git a/gcc/analyzer/pending-diagnostic.cc b/gcc/analyzer/pending-diagnostic.cc
index 452453a..70dc815 100644
--- a/gcc/analyzer/pending-diagnostic.cc
+++ b/gcc/analyzer/pending-diagnostic.cc
@@ -185,7 +185,7 @@ pending_diagnostic::add_function_entry_event (const exploded_edge &eedge,
{
const exploded_node *dst_node = eedge.m_dest;
const program_point &dst_point = dst_node->get_point ();
- emission_path->add_event (make_unique<function_entry_event> (dst_point));
+ emission_path->add_event (std::make_unique<function_entry_event> (dst_point));
}
/* Base implementation of pending_diagnostic::add_call_event.
@@ -200,12 +200,12 @@ pending_diagnostic::add_call_event (const exploded_edge &eedge,
const int src_stack_depth = src_point.get_stack_depth ();
const gimple *last_stmt = src_point.get_supernode ()->get_last_stmt ();
emission_path->add_event
- (make_unique<call_event> (eedge,
- event_loc_info (last_stmt
- ? last_stmt->location
- : UNKNOWN_LOCATION,
- src_point.get_fndecl (),
- src_stack_depth)));
+ (std::make_unique<call_event> (eedge,
+ event_loc_info (last_stmt
+ ? last_stmt->location
+ : UNKNOWN_LOCATION,
+ src_point.get_fndecl (),
+ src_stack_depth)));
}
/* Base implementation of pending_diagnostic::add_region_creation_events.
@@ -218,12 +218,13 @@ pending_diagnostic::add_region_creation_events (const region *reg,
checker_path &emission_path)
{
emission_path.add_event
- (make_unique<region_creation_event_memory_space> (reg->get_memory_space (),
- loc_info));
+ (std::make_unique<region_creation_event_memory_space>
+ (reg->get_memory_space (),
+ loc_info));
if (capacity)
emission_path.add_event
- (make_unique<region_creation_event_capacity> (capacity, loc_info));
+ (std::make_unique<region_creation_event_capacity> (capacity, loc_info));
}
/* Base implementation of pending_diagnostic::add_final_event.
@@ -237,7 +238,7 @@ pending_diagnostic::add_final_event (const state_machine *sm,
checker_path *emission_path)
{
emission_path->add_event
- (make_unique<warning_event>
+ (std::make_unique<warning_event>
(loc_info,
enode,
sm, var, state));
diff --git a/gcc/analyzer/program-point.cc b/gcc/analyzer/program-point.cc
index e72c2e2..c95f863 100644
--- a/gcc/analyzer/program-point.cc
+++ b/gcc/analyzer/program-point.cc
@@ -23,7 +23,6 @@ along with GCC; see the file COPYING3. If not see
#include "diagnostic-event-id.h"
#include "gcc-rich-location.h"
#include "gimple-pretty-print.h"
-#include "make-unique.h"
#include "sbitmap.h"
#include "selftest.h"
#include "shortest-paths.h"
@@ -303,7 +302,7 @@ program_point::dump () const
std::unique_ptr<json::object>
program_point::to_json () const
{
- auto point_obj = ::make_unique<json::object> ();
+ auto point_obj = std::make_unique<json::object> ();
point_obj->set_string ("kind", point_kind_to_string (get_kind ()));
diff --git a/gcc/analyzer/program-state.cc b/gcc/analyzer/program-state.cc
index 4d3fec0..dbca036 100644
--- a/gcc/analyzer/program-state.cc
+++ b/gcc/analyzer/program-state.cc
@@ -92,10 +92,10 @@ extrinsic_state::dump () const
std::unique_ptr<json::object>
extrinsic_state::to_json () const
{
- auto ext_state_obj = ::make_unique<json::object> ();
+ auto ext_state_obj = std::make_unique<json::object> ();
{
- auto checkers_arr = ::make_unique<json::array> ();
+ auto checkers_arr = std::make_unique<json::array> ();
for (auto &sm : m_checkers)
checkers_arr->append (sm->to_json ());
ext_state_obj->set ("checkers", std::move (checkers_arr));
@@ -266,7 +266,7 @@ sm_state_map::dump (bool simple) const
std::unique_ptr<json::object>
sm_state_map::to_json () const
{
- auto map_obj = ::make_unique<json::object> ();
+ auto map_obj = std::make_unique<json::object> ();
if (m_global_state != m_sm.get_start_state ())
map_obj->set ("global", m_global_state->to_json ());
@@ -1175,7 +1175,7 @@ program_state::dump () const
std::unique_ptr<json::object>
program_state::to_json (const extrinsic_state &ext_state) const
{
- auto state_obj = ::make_unique<json::object> ();
+ auto state_obj = std::make_unique<json::object> ();
state_obj->set ("store", m_region_model->get_store ()->to_json ());
state_obj->set ("constraints",
@@ -1186,7 +1186,7 @@ program_state::to_json (const extrinsic_state &ext_state) const
/* Provide m_checker_states as an object, using names as keys. */
{
- auto checkers_obj = ::make_unique<json::object> ();
+ auto checkers_obj = std::make_unique<json::object> ();
int i;
sm_state_map *smap;
diff --git a/gcc/analyzer/ranges.cc b/gcc/analyzer/ranges.cc
index 64e351f..1a960fa 100644
--- a/gcc/analyzer/ranges.cc
+++ b/gcc/analyzer/ranges.cc
@@ -136,7 +136,7 @@ symbolic_byte_range::dump (bool simple, region_model_manager &mgr) const
std::unique_ptr<json::value>
symbolic_byte_range::to_json () const
{
- auto obj = ::make_unique<json::object> ();
+ auto obj = std::make_unique<json::object> ();
obj->set ("start", m_start.to_json ());
obj->set ("size", m_size.to_json ());
return obj;
diff --git a/gcc/analyzer/region-model.cc b/gcc/analyzer/region-model.cc
index b65efad..ea0e6b0 100644
--- a/gcc/analyzer/region-model.cc
+++ b/gcc/analyzer/region-model.cc
@@ -217,7 +217,7 @@ region_to_value_map::dump (bool simple) const
std::unique_ptr<json::object>
region_to_value_map::to_json () const
{
- auto map_obj = ::make_unique<json::object> ();
+ auto map_obj = std::make_unique<json::object> ();
auto_vec<const region *> regs;
for (iterator iter = begin (); iter != end (); ++iter)
@@ -497,7 +497,7 @@ region_model::debug () const
std::unique_ptr<json::object>
region_model::to_json () const
{
- auto model_obj = ::make_unique<json::object> ();
+ auto model_obj = std::make_unique<json::object> ();
model_obj->set ("store", m_store.to_json ());
model_obj->set ("constraints", m_constraints->to_json ());
if (m_current_frame)
@@ -938,10 +938,10 @@ public:
{
if (reg == m_base_reg_a)
emission_path.add_event
- (make_unique<ptrdiff_region_creation_event> (loc_info, true));
+ (std::make_unique<ptrdiff_region_creation_event> (loc_info, true));
else if (reg == m_base_reg_b)
emission_path.add_event
- (make_unique<ptrdiff_region_creation_event> (loc_info, false));
+ (std::make_unique<ptrdiff_region_creation_event> (loc_info, false));
}
bool
@@ -991,11 +991,12 @@ check_for_invalid_ptrdiff (const gassign *assign,
if (base_reg_b->get_kind () == RK_SYMBOLIC)
return;
- ctxt.warn (make_unique<undefined_ptrdiff_diagnostic> (assign,
- sval_a,
- sval_b,
- base_reg_a,
- base_reg_b));
+ ctxt.warn
+ (std::make_unique<undefined_ptrdiff_diagnostic> (assign,
+ sval_a,
+ sval_b,
+ base_reg_a,
+ base_reg_b));
}
/* If ASSIGN is a stmt that can be modelled via
@@ -1174,13 +1175,13 @@ region_model::get_gassign_result (const gassign *assign,
{
if (tree_int_cst_sgn (rhs2_cst) < 0)
ctxt->warn
- (make_unique<shift_count_negative_diagnostic>
+ (std::make_unique<shift_count_negative_diagnostic>
(assign, rhs2_cst));
else if (compare_tree_int (rhs2_cst,
TYPE_PRECISION (TREE_TYPE (rhs1)))
>= 0)
ctxt->warn
- (make_unique<shift_count_overflow_diagnostic>
+ (std::make_unique<shift_count_overflow_diagnostic>
(assign,
int (TYPE_PRECISION (TREE_TYPE (rhs1))),
rhs2_cst));
@@ -1414,10 +1415,11 @@ region_model::check_for_poison (const svalue *sval,
check_expr = expr;
else
check_expr = NULL;
- if (ctxt->warn (make_unique<poisoned_value_diagnostic> (diag_arg,
- pkind,
- src_region,
- check_expr)))
+ if (ctxt->warn
+ (std::make_unique<poisoned_value_diagnostic> (diag_arg,
+ pkind,
+ src_region,
+ check_expr)))
{
/* We only want to report use of a poisoned value at the first
place it gets used; return an unknown value to avoid generating
@@ -1680,7 +1682,7 @@ region_model::check_call_format_attr (const call_details &cd,
};
call_arg_details arg_details (m_cd, m_fmt_param_idx);
- add_note (make_unique<reason_format_attr> (arg_details));
+ add_note (std::make_unique<reason_format_attr> (arg_details));
}
private:
const call_details &m_cd;
@@ -2135,8 +2137,8 @@ region_model::check_function_attr_access (const gcall &call,
}
void add_annotations () final override
{
- add_note (make_unique<reason_attr_access>
- (m_callee_fndecl, m_access));
+ add_note (std::make_unique<reason_attr_access>
+ (m_callee_fndecl, m_access));
}
private:
tree m_callee_fndecl;
@@ -3080,7 +3082,7 @@ region_model::deref_rvalue (const svalue *ptr_sval, tree ptr_tree,
const poisoned_svalue *poisoned_sval
= as_a <const poisoned_svalue *> (ptr_sval);
enum poison_kind pkind = poisoned_sval->get_poison_kind ();
- ctxt->warn (::make_unique<poisoned_value_diagnostic>
+ ctxt->warn (std::make_unique<poisoned_value_diagnostic>
(ptr, pkind, nullptr, nullptr));
}
}
@@ -3251,16 +3253,18 @@ region_model::check_for_writable_region (const region* dest_reg,
{
const function_region *func_reg = as_a <const function_region *> (base_reg);
tree fndecl = func_reg->get_fndecl ();
- ctxt->warn (make_unique<write_to_const_diagnostic>
- (func_reg, fndecl));
+ ctxt->warn
+ (std::make_unique<write_to_const_diagnostic>
+ (func_reg, fndecl));
}
break;
case RK_LABEL:
{
const label_region *label_reg = as_a <const label_region *> (base_reg);
tree label = label_reg->get_label ();
- ctxt->warn (make_unique<write_to_const_diagnostic>
- (label_reg, label));
+ ctxt->warn
+ (std::make_unique<write_to_const_diagnostic>
+ (label_reg, label));
}
break;
case RK_DECL:
@@ -3273,11 +3277,13 @@ region_model::check_for_writable_region (const region* dest_reg,
"this" param is "T* const"). */
if (TREE_READONLY (decl)
&& is_global_var (decl))
- ctxt->warn (make_unique<write_to_const_diagnostic> (dest_reg, decl));
+ ctxt->warn
+ (std::make_unique<write_to_const_diagnostic> (dest_reg, decl));
}
break;
case RK_STRING:
- ctxt->warn (make_unique<write_to_string_literal_diagnostic> (dest_reg));
+ ctxt->warn
+ (std::make_unique<write_to_string_literal_diagnostic> (dest_reg));
break;
}
}
@@ -3479,7 +3485,8 @@ public:
checker_path &emission_path) final override
{
emission_path.add_event
- (make_unique<region_creation_event_allocation_size> (capacity, loc_info));
+ (std::make_unique<region_creation_event_allocation_size>
+ (capacity, loc_info));
m_has_allocation_event = true;
}
@@ -3815,9 +3822,10 @@ region_model::check_region_size (const region *lhs_reg, const svalue *rhs_sval,
if (TREE_CODE (cst_cap) == INTEGER_CST
&& !capacity_compatible_with_type (cst_cap, pointee_size_tree,
is_struct))
- ctxt->warn (make_unique <dubious_allocation_size> (lhs_reg, rhs_reg,
- capacity, cst_cap,
- ctxt->get_stmt ()));
+ ctxt->warn
+ (std::make_unique <dubious_allocation_size> (lhs_reg, rhs_reg,
+ capacity, cst_cap,
+ ctxt->get_stmt ()));
}
break;
default:
@@ -3829,10 +3837,11 @@ region_model::check_region_size (const region *lhs_reg, const svalue *rhs_sval,
m_constraints))
{
tree expr = get_representative_tree (capacity);
- ctxt->warn (make_unique <dubious_allocation_size> (lhs_reg,
- rhs_reg,
- capacity, expr,
- ctxt->get_stmt ()));
+ ctxt->warn
+ (std::make_unique <dubious_allocation_size> (lhs_reg,
+ rhs_reg,
+ capacity, expr,
+ ctxt->get_stmt ()));
}
}
break;
@@ -4625,9 +4634,11 @@ region_model::check_for_null_terminated_string_arg (const call_details &cd,
m_cd.get_model ()->get_current_function ()->decl,
m_cd.get_model ()->get_stack_depth ());
- add_event (make_unique<null_terminator_check_event> (loc_info,
- arg_details));
- add_note (make_unique <null_terminator_check_decl_note> (arg_details));
+ add_event
+ (std::make_unique<null_terminator_check_event> (loc_info,
+ arg_details));
+ add_note
+ (std::make_unique <null_terminator_check_decl_note> (arg_details));
}
private:
const call_details &m_cd;
@@ -5373,7 +5384,7 @@ region_model::add_constraint (tree lhs, enum tree_code op, tree rhs,
{
bool sat = add_constraint (lhs, op, rhs, ctxt);
if (!sat && out)
- *out = make_unique <rejected_op_constraint> (*this, lhs, op, rhs);
+ *out = std::make_unique <rejected_op_constraint> (*this, lhs, op, rhs);
return sat;
}
@@ -6144,7 +6155,7 @@ apply_constraints_for_gswitch (const switch_cfg_superedge &edge,
&& !ctxt->possibly_tainted_p (index_sval))
{
if (out)
- *out = make_unique <rejected_default_case> (*this);
+ *out = std::make_unique <rejected_default_case> (*this);
return false;
}
@@ -6153,7 +6164,8 @@ apply_constraints_for_gswitch (const switch_cfg_superedge &edge,
= ranges_mgr->get_or_create_ranges_for_switch (&edge, switch_stmt);
bool sat = m_constraints->add_bounded_ranges (index_sval, all_cases_ranges);
if (!sat && out)
- *out = make_unique <rejected_ranges_constraint> (*this, index, all_cases_ranges);
+ *out = std::make_unique <rejected_ranges_constraint>
+ (*this, index, all_cases_ranges);
if (sat && ctxt && !all_cases_ranges->empty_p ())
ctxt->on_bounded_ranges (*index_sval, *all_cases_ranges);
return sat;
@@ -6370,7 +6382,7 @@ public:
{}
std::unique_ptr<stmt_finder> clone () const override
{
- return ::make_unique<my_finder> (m_call_stmt, m_caller_frame);
+ return std::make_unique<my_finder> (m_call_stmt, m_caller_frame);
}
const gimple *find_stmt (const exploded_path &) override
{
@@ -6813,7 +6825,7 @@ region_model::check_dynamic_size_for_floats (const svalue *size_in_bytes,
if (const svalue *float_sval = v.get_svalue_to_report ())
{
tree diag_arg = get_representative_tree (float_sval);
- ctxt->warn (make_unique<float_as_size_arg> (diag_arg));
+ ctxt->warn (std::make_unique<float_as_size_arg> (diag_arg));
}
}
@@ -7159,8 +7171,7 @@ private:
tree type = m_copied_sval->get_type ();
if (type && TREE_CODE (type) == RECORD_TYPE)
{
- // (std::make_unique is C++14)
- layout = std::unique_ptr<record_layout> (new record_layout (type));
+ layout = std::make_unique<record_layout> (type);
if (0)
layout->dump ();
@@ -7385,9 +7396,10 @@ region_model::maybe_complain_about_infoleak (const region *dst_reg,
{
/* Check for exposure. */
if (contains_uninit_p (copied_sval))
- ctxt->warn (make_unique<exposure_through_uninit_copy> (src_reg,
- dst_reg,
- copied_sval));
+ ctxt->warn
+ (std::make_unique<exposure_through_uninit_copy> (src_reg,
+ dst_reg,
+ copied_sval));
}
/* Set errno to a positive symbolic int, as if some error has occurred. */
diff --git a/gcc/analyzer/region.cc b/gcc/analyzer/region.cc
index bfbcf2d..4e56cd5 100644
--- a/gcc/analyzer/region.cc
+++ b/gcc/analyzer/region.cc
@@ -27,7 +27,6 @@ along with GCC; see the file COPYING3. If not see
#include "digraph.h"
#include "sbitmap.h"
#include "fold-const.h"
-#include "make-unique.h"
#include "analyzer/analyzer-logging.h"
#include "analyzer/supergraph.h"
@@ -1019,7 +1018,7 @@ std::unique_ptr<json::value>
region::to_json () const
{
label_text desc = get_desc (true);
- auto reg_js = ::make_unique<json::string> (desc.get ());
+ auto reg_js = std::make_unique<json::string> (desc.get ());
return reg_js;
}
diff --git a/gcc/analyzer/sm-fd.cc b/gcc/analyzer/sm-fd.cc
index dd9ae93..cee8d2d 100644
--- a/gcc/analyzer/sm-fd.cc
+++ b/gcc/analyzer/sm-fd.cc
@@ -1438,7 +1438,7 @@ fd_state_machine::check_for_fd_attrs (
{
sm_ctxt.warn (node, stmt, arg,
- make_unique<fd_use_after_close>
+ std::make_unique<fd_use_after_close>
(*this, diag_arg,
fndecl, attr_name,
arg_idx));
@@ -1450,7 +1450,7 @@ fd_state_machine::check_for_fd_attrs (
if (!is_constant_fd_p (state))
{
sm_ctxt.warn (node, stmt, arg,
- make_unique<fd_use_without_check>
+ std::make_unique<fd_use_without_check>
(*this, diag_arg,
fndecl, attr_name,
arg_idx));
@@ -1466,13 +1466,13 @@ fd_state_machine::check_for_fd_attrs (
if (is_writeonly_fd_p (state))
{
- sm_ctxt.warn (
- node, stmt, arg,
- make_unique<fd_access_mode_mismatch> (*this, diag_arg,
- DIRS_WRITE,
- fndecl,
- attr_name,
- arg_idx));
+ sm_ctxt.warn
+ (node, stmt, arg,
+ std::make_unique<fd_access_mode_mismatch> (*this, diag_arg,
+ DIRS_WRITE,
+ fndecl,
+ attr_name,
+ arg_idx));
}
break;
@@ -1480,13 +1480,13 @@ fd_state_machine::check_for_fd_attrs (
if (is_readonly_fd_p (state))
{
- sm_ctxt.warn (
- node, stmt, arg,
- make_unique<fd_access_mode_mismatch> (*this, diag_arg,
- DIRS_READ,
- fndecl,
- attr_name,
- arg_idx));
+ sm_ctxt.warn
+ (node, stmt, arg,
+ std::make_unique<fd_access_mode_mismatch> (*this, diag_arg,
+ DIRS_READ,
+ fndecl,
+ attr_name,
+ arg_idx));
}
break;
@@ -1528,7 +1528,7 @@ fd_state_machine::on_open (sm_context &sm_ctxt, const supernode *node,
else
{
sm_ctxt.warn (node, stmt, NULL_TREE,
- make_unique<fd_leak> (*this, NULL_TREE));
+ std::make_unique<fd_leak> (*this, NULL_TREE));
}
}
@@ -1541,7 +1541,7 @@ fd_state_machine::on_creat (sm_context &sm_ctxt, const supernode *node,
sm_ctxt.on_transition (node, stmt, lhs, m_start, m_unchecked_write_only);
else
sm_ctxt.warn (node, stmt, NULL_TREE,
- make_unique<fd_leak> (*this, NULL_TREE));
+ std::make_unique<fd_leak> (*this, NULL_TREE));
}
void
@@ -1587,8 +1587,8 @@ fd_state_machine::check_for_dup (sm_context &sm_ctxt, const supernode *node,
{
sm_ctxt.warn (
node, stmt, arg_2,
- make_unique<fd_use_without_check> (*this, diag_arg_2,
- callee_fndecl));
+ std::make_unique<fd_use_without_check> (*this, diag_arg_2,
+ callee_fndecl));
return;
}
/* dup2 returns value of its second argument on success.But, the
@@ -1635,7 +1635,7 @@ fd_state_machine::on_close (sm_context &sm_ctxt, const supernode *node,
if (is_closed_fd_p (state))
{
sm_ctxt.warn (node, stmt, arg,
- make_unique<fd_double_close> (*this, diag_arg));
+ std::make_unique<fd_double_close> (*this, diag_arg));
sm_ctxt.set_next_state (stmt, arg, m_stop);
}
}
@@ -1667,8 +1667,8 @@ fd_state_machine::check_for_open_fd (
if (is_closed_fd_p (state))
{
sm_ctxt.warn (node, stmt, arg,
- make_unique<fd_use_after_close> (*this, diag_arg,
- callee_fndecl));
+ std::make_unique<fd_use_after_close> (*this, diag_arg,
+ callee_fndecl));
}
else
@@ -1679,10 +1679,10 @@ fd_state_machine::check_for_open_fd (
/* Complain about fncall on socket in wrong phase. */
sm_ctxt.warn
(node, stmt, arg,
- make_unique<fd_phase_mismatch> (*this, diag_arg,
- callee_fndecl,
- state,
- EXPECTED_PHASE_CAN_TRANSFER));
+ std::make_unique<fd_phase_mismatch> (*this, diag_arg,
+ callee_fndecl,
+ state,
+ EXPECTED_PHASE_CAN_TRANSFER));
else if (!(is_valid_fd_p (state)
|| state == m_new_datagram_socket
|| state == m_bound_unknown_socket
@@ -1693,8 +1693,8 @@ fd_state_machine::check_for_open_fd (
if (!is_constant_fd_p (state))
sm_ctxt.warn (
node, stmt, arg,
- make_unique<fd_use_without_check> (*this, diag_arg,
- callee_fndecl));
+ std::make_unique<fd_use_without_check> (*this, diag_arg,
+ callee_fndecl));
}
switch (callee_fndecl_dir)
{
@@ -1705,8 +1705,8 @@ fd_state_machine::check_for_open_fd (
{
tree diag_arg = sm_ctxt.get_diagnostic_tree (arg);
sm_ctxt.warn (node, stmt, arg,
- make_unique<fd_access_mode_mismatch> (
- *this, diag_arg, DIRS_WRITE, callee_fndecl));
+ std::make_unique<fd_access_mode_mismatch>
+ (*this, diag_arg, DIRS_WRITE, callee_fndecl));
}
break;
@@ -1716,8 +1716,8 @@ fd_state_machine::check_for_open_fd (
{
tree diag_arg = sm_ctxt.get_diagnostic_tree (arg);
sm_ctxt.warn (node, stmt, arg,
- make_unique<fd_access_mode_mismatch> (
- *this, diag_arg, DIRS_READ, callee_fndecl));
+ std::make_unique<fd_access_mode_mismatch>
+ (*this, diag_arg, DIRS_READ, callee_fndecl));
}
break;
}
@@ -1792,7 +1792,7 @@ fd_state_machine::on_socket (const call_details &cd,
}
else
sm_ctxt.warn (node, &call, NULL_TREE,
- make_unique<fd_leak> (*this, NULL_TREE));
+ std::make_unique<fd_leak> (*this, NULL_TREE));
}
else
{
@@ -1829,8 +1829,8 @@ fd_state_machine::check_for_socket_fd (const call_details &cd,
tree diag_arg = sm_ctxt.get_diagnostic_tree (fd_sval);
sm_ctxt.warn
(node, &call, fd_sval,
- make_unique<fd_use_after_close> (*this, diag_arg,
- cd.get_fndecl_for_call ()));
+ std::make_unique<fd_use_after_close> (*this, diag_arg,
+ cd.get_fndecl_for_call ()));
if (complained)
*complained = true;
if (successful)
@@ -1842,10 +1842,10 @@ fd_state_machine::check_for_socket_fd (const call_details &cd,
tree diag_arg = sm_ctxt.get_diagnostic_tree (fd_sval);
sm_ctxt.warn
(node, &call, fd_sval,
- make_unique<fd_type_mismatch> (*this, diag_arg,
- cd.get_fndecl_for_call (),
- old_state,
- EXPECTED_TYPE_SOCKET));
+ std::make_unique<fd_type_mismatch> (*this, diag_arg,
+ cd.get_fndecl_for_call (),
+ old_state,
+ EXPECTED_TYPE_SOCKET));
if (complained)
*complained = true;
if (successful)
@@ -1856,8 +1856,8 @@ fd_state_machine::check_for_socket_fd (const call_details &cd,
tree diag_arg = sm_ctxt.get_diagnostic_tree (fd_sval);
sm_ctxt.warn
(node, &call, fd_sval,
- make_unique<fd_use_without_check> (*this, diag_arg,
- cd.get_fndecl_for_call ()));
+ std::make_unique<fd_use_without_check> (*this, diag_arg,
+ cd.get_fndecl_for_call ()));
if (complained)
*complained = true;
if (successful)
@@ -1919,10 +1919,10 @@ fd_state_machine::check_for_new_socket_fd (const call_details &cd,
tree diag_arg = sm_ctxt.get_diagnostic_tree (fd_sval);
sm_ctxt.warn
(node, &cd.get_call_stmt (), fd_sval,
- make_unique<fd_phase_mismatch> (*this, diag_arg,
- cd.get_fndecl_for_call (),
- old_state,
- expected_phase));
+ std::make_unique<fd_phase_mismatch> (*this, diag_arg,
+ cd.get_fndecl_for_call (),
+ old_state,
+ expected_phase));
if (successful)
return false;
}
@@ -2029,17 +2029,17 @@ fd_state_machine::on_listen (const call_details &cd,
if (is_stream_socket_fd_p (old_state))
sm_ctxt.warn
(node, &call, fd_sval,
- make_unique<fd_phase_mismatch> (*this, diag_arg,
- cd.get_fndecl_for_call (),
- old_state,
- EXPECTED_PHASE_CAN_LISTEN));
+ std::make_unique<fd_phase_mismatch> (*this, diag_arg,
+ cd.get_fndecl_for_call (),
+ old_state,
+ EXPECTED_PHASE_CAN_LISTEN));
else
sm_ctxt.warn
(node, &call, fd_sval,
- make_unique<fd_type_mismatch> (*this, diag_arg,
- cd.get_fndecl_for_call (),
- old_state,
- EXPECTED_TYPE_STREAM_SOCKET));
+ std::make_unique<fd_type_mismatch> (*this, diag_arg,
+ cd.get_fndecl_for_call (),
+ old_state,
+ EXPECTED_TYPE_STREAM_SOCKET));
if (successful)
return false;
}
@@ -2150,17 +2150,17 @@ fd_state_machine::on_accept (const call_details &cd,
if (is_stream_socket_fd_p (old_state))
sm_ctxt.warn
(node, &call, fd_sval,
- make_unique<fd_phase_mismatch> (*this, diag_arg,
- cd.get_fndecl_for_call (),
- old_state,
- EXPECTED_PHASE_CAN_ACCEPT));
+ std::make_unique<fd_phase_mismatch> (*this, diag_arg,
+ cd.get_fndecl_for_call (),
+ old_state,
+ EXPECTED_PHASE_CAN_ACCEPT));
else
sm_ctxt.warn
(node, &call, fd_sval,
- make_unique<fd_type_mismatch> (*this, diag_arg,
- cd.get_fndecl_for_call (),
- old_state,
- EXPECTED_TYPE_STREAM_SOCKET));
+ std::make_unique<fd_type_mismatch> (*this, diag_arg,
+ cd.get_fndecl_for_call (),
+ old_state,
+ EXPECTED_TYPE_STREAM_SOCKET));
if (successful)
return false;
}
@@ -2185,7 +2185,7 @@ fd_state_machine::on_accept (const call_details &cd,
}
else
sm_ctxt.warn (node, &call, NULL_TREE,
- make_unique<fd_leak> (*this, NULL_TREE));
+ std::make_unique<fd_leak> (*this, NULL_TREE));
}
else
{
@@ -2323,7 +2323,7 @@ fd_state_machine::can_purge_p (state_t s) const
std::unique_ptr<pending_diagnostic>
fd_state_machine::on_leak (tree var) const
{
- return make_unique<fd_leak> (*this, var);
+ return std::make_unique<fd_leak> (*this, var);
}
} // namespace
@@ -2415,8 +2415,10 @@ public:
{
if (cd.get_ctxt ())
{
- cd.get_ctxt ()->bifurcate (make_unique<outcome_of_socket> (cd, false));
- cd.get_ctxt ()->bifurcate (make_unique<outcome_of_socket> (cd, true));
+ cd.get_ctxt ()->bifurcate
+ (std::make_unique<outcome_of_socket> (cd, false));
+ cd.get_ctxt ()->bifurcate
+ (std::make_unique<outcome_of_socket> (cd, true));
cd.get_ctxt ()->terminate_path ();
}
}
@@ -2467,8 +2469,10 @@ public:
{
if (cd.get_ctxt ())
{
- cd.get_ctxt ()->bifurcate (make_unique<outcome_of_bind> (cd, false));
- cd.get_ctxt ()->bifurcate (make_unique<outcome_of_bind> (cd, true));
+ cd.get_ctxt ()->bifurcate
+ (std::make_unique<outcome_of_bind> (cd, false));
+ cd.get_ctxt ()->bifurcate
+ (std::make_unique<outcome_of_bind> (cd, true));
cd.get_ctxt ()->terminate_path ();
}
}
@@ -2519,8 +2523,10 @@ class kf_listen : public known_function
{
if (cd.get_ctxt ())
{
- cd.get_ctxt ()->bifurcate (make_unique<outcome_of_listen> (cd, false));
- cd.get_ctxt ()->bifurcate (make_unique<outcome_of_listen> (cd, true));
+ cd.get_ctxt ()->bifurcate
+ (std::make_unique<outcome_of_listen> (cd, false));
+ cd.get_ctxt ()->bifurcate
+ (std::make_unique<outcome_of_listen> (cd, true));
cd.get_ctxt ()->terminate_path ();
}
}
@@ -2573,8 +2579,10 @@ class kf_accept : public known_function
{
if (cd.get_ctxt ())
{
- cd.get_ctxt ()->bifurcate (make_unique<outcome_of_accept> (cd, false));
- cd.get_ctxt ()->bifurcate (make_unique<outcome_of_accept> (cd, true));
+ cd.get_ctxt ()->bifurcate
+ (std::make_unique<outcome_of_accept> (cd, false));
+ cd.get_ctxt ()->bifurcate
+ (std::make_unique<outcome_of_accept> (cd, true));
cd.get_ctxt ()->terminate_path ();
}
}
@@ -2627,8 +2635,10 @@ public:
{
if (cd.get_ctxt ())
{
- cd.get_ctxt ()->bifurcate (make_unique<outcome_of_connect> (cd, false));
- cd.get_ctxt ()->bifurcate (make_unique<outcome_of_connect> (cd, true));
+ cd.get_ctxt ()->bifurcate
+ (std::make_unique<outcome_of_connect> (cd, false));
+ cd.get_ctxt ()->bifurcate
+ (std::make_unique<outcome_of_connect> (cd, true));
cd.get_ctxt ()->terminate_path ();
}
}
@@ -2705,8 +2715,10 @@ public:
{
if (cd.get_ctxt ())
{
- cd.get_ctxt ()->bifurcate (make_unique<outcome_of_isatty> (cd, false));
- cd.get_ctxt ()->bifurcate (make_unique<outcome_of_isatty> (cd, true));
+ cd.get_ctxt ()->bifurcate
+ (std::make_unique<outcome_of_isatty> (cd, false));
+ cd.get_ctxt ()->bifurcate
+ (std::make_unique<outcome_of_isatty> (cd, true));
cd.get_ctxt ()->terminate_path ();
}
}
@@ -2788,8 +2800,10 @@ public:
{
if (cd.get_ctxt ())
{
- cd.get_ctxt ()->bifurcate (make_unique<failure> (cd));
- cd.get_ctxt ()->bifurcate (make_unique<success> (cd));
+ cd.get_ctxt ()->bifurcate
+ (std::make_unique<failure> (cd));
+ cd.get_ctxt ()->bifurcate
+ (std::make_unique<success> (cd));
cd.get_ctxt ()->terminate_path ();
}
}
@@ -2837,15 +2851,15 @@ public:
void
register_known_fd_functions (known_function_manager &kfm)
{
- kfm.add ("accept", make_unique<kf_accept> ());
- kfm.add ("bind", make_unique<kf_bind> ());
- kfm.add ("connect", make_unique<kf_connect> ());
- kfm.add ("isatty", make_unique<kf_isatty> ());
- kfm.add ("listen", make_unique<kf_listen> ());
- kfm.add ("pipe", make_unique<kf_pipe> (1));
- kfm.add ("pipe2", make_unique<kf_pipe> (2));
- kfm.add ("read", make_unique<kf_read> ());
- kfm.add ("socket", make_unique<kf_socket> ());
+ kfm.add ("accept", std::make_unique<kf_accept> ());
+ kfm.add ("bind", std::make_unique<kf_bind> ());
+ kfm.add ("connect", std::make_unique<kf_connect> ());
+ kfm.add ("isatty", std::make_unique<kf_isatty> ());
+ kfm.add ("listen", std::make_unique<kf_listen> ());
+ kfm.add ("pipe", std::make_unique<kf_pipe> (1));
+ kfm.add ("pipe2", std::make_unique<kf_pipe> (2));
+ kfm.add ("read", std::make_unique<kf_read> ());
+ kfm.add ("socket", std::make_unique<kf_socket> ());
}
} // namespace ana
diff --git a/gcc/analyzer/sm-file.cc b/gcc/analyzer/sm-file.cc
index 319ac01..d7dbe2f 100644
--- a/gcc/analyzer/sm-file.cc
+++ b/gcc/analyzer/sm-file.cc
@@ -423,7 +423,8 @@ fileptr_state_machine::on_stmt (sm_context &sm_ctxt,
{
tree diag_arg = sm_ctxt.get_diagnostic_tree (arg);
sm_ctxt.warn (node, stmt, arg,
- make_unique<double_fclose> (*this, diag_arg));
+ std::make_unique<double_fclose> (*this,
+ diag_arg));
sm_ctxt.set_next_state (stmt, arg, m_stop);
}
return true;
@@ -493,7 +494,7 @@ fileptr_state_machine::can_purge_p (state_t s) const
std::unique_ptr<pending_diagnostic>
fileptr_state_machine::on_leak (tree var) const
{
- return make_unique<file_leak> (*this, var);
+ return std::make_unique<file_leak> (*this, var);
}
} // anonymous namespace
@@ -645,40 +646,40 @@ public:
void
register_known_file_functions (known_function_manager &kfm)
{
- kfm.add (BUILT_IN_FPRINTF, make_unique<kf_stdio_output_fn> ());
- kfm.add (BUILT_IN_FPRINTF_UNLOCKED, make_unique<kf_stdio_output_fn> ());
- kfm.add (BUILT_IN_FPUTC, make_unique<kf_stdio_output_fn> ());
- kfm.add (BUILT_IN_FPUTC_UNLOCKED, make_unique<kf_stdio_output_fn> ());
- kfm.add (BUILT_IN_FPUTS, make_unique<kf_stdio_output_fn> ());
- kfm.add (BUILT_IN_FPUTS_UNLOCKED, make_unique<kf_stdio_output_fn> ());
- kfm.add (BUILT_IN_FWRITE, make_unique<kf_stdio_output_fn> ());
- kfm.add (BUILT_IN_FWRITE_UNLOCKED, make_unique<kf_stdio_output_fn> ());
- kfm.add (BUILT_IN_PRINTF, make_unique<kf_stdio_output_fn> ());
- kfm.add (BUILT_IN_PRINTF_UNLOCKED, make_unique<kf_stdio_output_fn> ());
- kfm.add (BUILT_IN_PUTC, make_unique<kf_stdio_output_fn> ());
- kfm.add (BUILT_IN_PUTCHAR, make_unique<kf_stdio_output_fn> ());
- kfm.add (BUILT_IN_PUTCHAR_UNLOCKED, make_unique<kf_stdio_output_fn> ());
- kfm.add (BUILT_IN_PUTC_UNLOCKED, make_unique<kf_stdio_output_fn> ());
- kfm.add (BUILT_IN_PUTS, make_unique<kf_stdio_output_fn> ());
- kfm.add (BUILT_IN_PUTS_UNLOCKED, make_unique<kf_stdio_output_fn> ());
- kfm.add (BUILT_IN_VFPRINTF, make_unique<kf_stdio_output_fn> ());
- kfm.add (BUILT_IN_VPRINTF, make_unique<kf_stdio_output_fn> ());
-
- kfm.add ("ferror", make_unique<kf_ferror> ());
- kfm.add ("fgets", make_unique<kf_fgets> ());
- kfm.add ("fgets_unlocked", make_unique<kf_fgets> ()); // non-standard
- kfm.add ("fileno", make_unique<kf_fileno> ());
- kfm.add ("fread", make_unique<kf_fread> ());
- kfm.add ("getc", make_unique<kf_getc> ());
- kfm.add ("getchar", make_unique<kf_getchar> ());
+ kfm.add (BUILT_IN_FPRINTF, std::make_unique<kf_stdio_output_fn> ());
+ kfm.add (BUILT_IN_FPRINTF_UNLOCKED, std::make_unique<kf_stdio_output_fn> ());
+ kfm.add (BUILT_IN_FPUTC, std::make_unique<kf_stdio_output_fn> ());
+ kfm.add (BUILT_IN_FPUTC_UNLOCKED, std::make_unique<kf_stdio_output_fn> ());
+ kfm.add (BUILT_IN_FPUTS, std::make_unique<kf_stdio_output_fn> ());
+ kfm.add (BUILT_IN_FPUTS_UNLOCKED, std::make_unique<kf_stdio_output_fn> ());
+ kfm.add (BUILT_IN_FWRITE, std::make_unique<kf_stdio_output_fn> ());
+ kfm.add (BUILT_IN_FWRITE_UNLOCKED, std::make_unique<kf_stdio_output_fn> ());
+ kfm.add (BUILT_IN_PRINTF, std::make_unique<kf_stdio_output_fn> ());
+ kfm.add (BUILT_IN_PRINTF_UNLOCKED, std::make_unique<kf_stdio_output_fn> ());
+ kfm.add (BUILT_IN_PUTC, std::make_unique<kf_stdio_output_fn> ());
+ kfm.add (BUILT_IN_PUTCHAR, std::make_unique<kf_stdio_output_fn> ());
+ kfm.add (BUILT_IN_PUTCHAR_UNLOCKED, std::make_unique<kf_stdio_output_fn> ());
+ kfm.add (BUILT_IN_PUTC_UNLOCKED, std::make_unique<kf_stdio_output_fn> ());
+ kfm.add (BUILT_IN_PUTS, std::make_unique<kf_stdio_output_fn> ());
+ kfm.add (BUILT_IN_PUTS_UNLOCKED, std::make_unique<kf_stdio_output_fn> ());
+ kfm.add (BUILT_IN_VFPRINTF, std::make_unique<kf_stdio_output_fn> ());
+ kfm.add (BUILT_IN_VPRINTF, std::make_unique<kf_stdio_output_fn> ());
+
+ kfm.add ("ferror", std::make_unique<kf_ferror> ());
+ kfm.add ("fgets", std::make_unique<kf_fgets> ());
+ kfm.add ("fgets_unlocked", std::make_unique<kf_fgets> ()); // non-standard
+ kfm.add ("fileno", std::make_unique<kf_fileno> ());
+ kfm.add ("fread", std::make_unique<kf_fread> ());
+ kfm.add ("getc", std::make_unique<kf_getc> ());
+ kfm.add ("getchar", std::make_unique<kf_getchar> ());
/* Some C++ implementations use the std:: copies of these functions
from <cstdio> for <stdio.h>, so we must match against these too. */
- kfm.add_std_ns ("ferror", make_unique<kf_ferror> ());
- kfm.add_std_ns ("fgets", make_unique<kf_fgets> ());
- kfm.add_std_ns ("fread", make_unique<kf_fread> ());
- kfm.add_std_ns ("getc", make_unique<kf_getc> ());
- kfm.add_std_ns ("getchar", make_unique<kf_getchar> ());
+ kfm.add_std_ns ("ferror", std::make_unique<kf_ferror> ());
+ kfm.add_std_ns ("fgets", std::make_unique<kf_fgets> ());
+ kfm.add_std_ns ("fread", std::make_unique<kf_fread> ());
+ kfm.add_std_ns ("getc", std::make_unique<kf_getc> ());
+ kfm.add_std_ns ("getchar", std::make_unique<kf_getchar> ());
}
#if CHECKING_P
diff --git a/gcc/analyzer/sm-malloc.cc b/gcc/analyzer/sm-malloc.cc
index ad7974e..0186268 100644
--- a/gcc/analyzer/sm-malloc.cc
+++ b/gcc/analyzer/sm-malloc.cc
@@ -2018,9 +2018,10 @@ malloc_state_machine::handle_nonnull (sm_context &sm_ctxt,
if (unchecked_p (state))
{
tree diag_arg = sm_ctxt.get_diagnostic_tree (arg);
- sm_ctxt.warn (node, stmt, arg,
- make_unique<possible_null_arg> (*this, diag_arg, fndecl,
- i));
+ sm_ctxt.warn
+ (node, stmt, arg,
+ std::make_unique<possible_null_arg> (*this, diag_arg, fndecl,
+ i));
const allocation_state *astate
= as_a_allocation_state (state);
sm_ctxt.set_next_state (stmt, arg, astate->get_nonnull ());
@@ -2029,7 +2030,7 @@ malloc_state_machine::handle_nonnull (sm_context &sm_ctxt,
{
tree diag_arg = sm_ctxt.get_diagnostic_tree (arg);
sm_ctxt.warn (node, stmt, arg,
- make_unique<null_arg> (*this, diag_arg, fndecl, i));
+ std::make_unique<null_arg> (*this, diag_arg, fndecl, i));
sm_ctxt.set_next_state (stmt, arg, m_stop);
}
else if (state == m_start)
@@ -2251,8 +2252,8 @@ malloc_state_machine::on_stmt (sm_context &sm_ctxt,
{
tree diag_arg = sm_ctxt.get_diagnostic_tree (arg);
sm_ctxt.warn (node, stmt, arg,
- make_unique<possible_null_deref> (*this,
- diag_arg));
+ std::make_unique<possible_null_deref> (*this,
+ diag_arg));
const allocation_state *astate = as_a_allocation_state (state);
sm_ctxt.set_next_state (stmt, arg, astate->get_nonnull ());
}
@@ -2260,7 +2261,7 @@ malloc_state_machine::on_stmt (sm_context &sm_ctxt,
{
tree diag_arg = sm_ctxt.get_diagnostic_tree (arg);
sm_ctxt.warn (node, stmt, arg,
- make_unique<null_deref> (*this, diag_arg));
+ std::make_unique<null_deref> (*this, diag_arg));
sm_ctxt.set_next_state (stmt, arg, m_stop);
}
else if (freed_p (state))
@@ -2268,7 +2269,7 @@ malloc_state_machine::on_stmt (sm_context &sm_ctxt,
tree diag_arg = sm_ctxt.get_diagnostic_tree (arg);
const allocation_state *astate = as_a_allocation_state (state);
sm_ctxt.warn (node, stmt, arg,
- make_unique<use_after_free>
+ std::make_unique<use_after_free>
(*this, diag_arg, astate->m_deallocator));
sm_ctxt.set_next_state (stmt, arg, m_stop);
}
@@ -2330,7 +2331,7 @@ maybe_complain_about_deref_before_check (sm_context &sm_ctxt,
if (diag_ptr)
sm_ctxt.warn
(node, stmt, ptr,
- make_unique<deref_before_check> (*this, diag_ptr));
+ std::make_unique<deref_before_check> (*this, diag_ptr));
sm_ctxt.set_next_state (stmt, ptr, m_stop);
}
@@ -2378,7 +2379,7 @@ malloc_state_machine::handle_free_of_non_heap (sm_context &sm_ctxt,
freed_reg = old_model->deref_rvalue (ptr_sval, arg, NULL);
}
sm_ctxt.warn (node, &call, arg,
- make_unique<free_of_non_heap>
+ std::make_unique<free_of_non_heap>
(*this, diag_arg, freed_reg, d->m_name));
sm_ctxt.set_next_state (&call, arg, m_stop);
}
@@ -2408,7 +2409,7 @@ malloc_state_machine::on_deallocator_call (sm_context &sm_ctxt,
/* Wrong allocator. */
tree diag_arg = sm_ctxt.get_diagnostic_tree (arg);
sm_ctxt.warn (node, &call, arg,
- make_unique<mismatching_deallocation>
+ std::make_unique<mismatching_deallocation>
(*this, diag_arg,
astate->m_deallocators,
d));
@@ -2423,7 +2424,7 @@ malloc_state_machine::on_deallocator_call (sm_context &sm_ctxt,
/* freed -> stop, with warning. */
tree diag_arg = sm_ctxt.get_diagnostic_tree (arg);
sm_ctxt.warn (node, &call, arg,
- make_unique<double_free> (*this, diag_arg, d->m_name));
+ std::make_unique<double_free> (*this, diag_arg, d->m_name));
sm_ctxt.set_next_state (&call, arg, m_stop);
}
else if (state == m_non_heap)
@@ -2462,7 +2463,7 @@ malloc_state_machine::on_realloc_call (sm_context &sm_ctxt,
/* Wrong allocator. */
tree diag_arg = sm_ctxt.get_diagnostic_tree (arg);
sm_ctxt.warn (node, &call, arg,
- make_unique<mismatching_deallocation>
+ std::make_unique<mismatching_deallocation>
(*this, diag_arg,
astate->m_deallocators, d));
sm_ctxt.set_next_state (&call, arg, m_stop);
@@ -2475,7 +2476,7 @@ malloc_state_machine::on_realloc_call (sm_context &sm_ctxt,
/* freed -> stop, with warning. */
tree diag_arg = sm_ctxt.get_diagnostic_tree (arg);
sm_ctxt.warn (node, &call, arg,
- make_unique<double_free> (*this, diag_arg, "free"));
+ std::make_unique<double_free> (*this, diag_arg, "free"));
sm_ctxt.set_next_state (&call, arg, m_stop);
if (path_context *path_ctxt = sm_ctxt.get_path_context ())
path_ctxt->terminate_path ();
@@ -2585,7 +2586,7 @@ malloc_state_machine::can_purge_p (state_t s) const
std::unique_ptr<pending_diagnostic>
malloc_state_machine::on_leak (tree var) const
{
- return make_unique<malloc_leak> (*this, var);
+ return std::make_unique<malloc_leak> (*this, var);
}
/* Implementation of state_machine::reset_when_passed_to_unknown_fn_p vfunc
diff --git a/gcc/analyzer/sm-pattern-test.cc b/gcc/analyzer/sm-pattern-test.cc
index f24e8df..f05ffe0 100644
--- a/gcc/analyzer/sm-pattern-test.cc
+++ b/gcc/analyzer/sm-pattern-test.cc
@@ -132,7 +132,7 @@ pattern_test_state_machine::on_condition (sm_context &sm_ctxt,
if (tree lhs_expr = sm_ctxt.get_diagnostic_tree (lhs))
{
sm_ctxt.warn (node, stmt, lhs_expr,
- make_unique<pattern_match> (lhs_expr, op, rhs_cst));
+ std::make_unique<pattern_match> (lhs_expr, op, rhs_cst));
}
}
diff --git a/gcc/analyzer/sm-sensitive.cc b/gcc/analyzer/sm-sensitive.cc
index 385573b..7bd5ef6 100644
--- a/gcc/analyzer/sm-sensitive.cc
+++ b/gcc/analyzer/sm-sensitive.cc
@@ -187,8 +187,8 @@ sensitive_state_machine::warn_for_any_exposure (sm_context &sm_ctxt,
{
tree diag_arg = sm_ctxt.get_diagnostic_tree (arg);
sm_ctxt.warn (node, stmt, arg,
- make_unique<exposure_through_output_file> (*this,
- diag_arg));
+ std::make_unique<exposure_through_output_file> (*this,
+ diag_arg));
}
}
diff --git a/gcc/analyzer/sm-signal.cc b/gcc/analyzer/sm-signal.cc
index 2521c7c..bbd7d70 100644
--- a/gcc/analyzer/sm-signal.cc
+++ b/gcc/analyzer/sm-signal.cc
@@ -225,10 +225,10 @@ public:
const final override
{
emission_path->add_event
- (make_unique<precanned_custom_event>
- (event_loc_info (UNKNOWN_LOCATION, NULL_TREE, 0),
- "later on,"
- " when the signal is delivered to the process"));
+ (std::make_unique<precanned_custom_event>
+ (event_loc_info (UNKNOWN_LOCATION, NULL_TREE, 0),
+ "later on,"
+ " when the signal is delivered to the process"));
}
};
@@ -271,7 +271,7 @@ public:
if (dst_enode)
eg->add_edge (src_enode, dst_enode, NULL, /*state_change (),*/
true, /* assume does work */
- make_unique<signal_delivery_edge_info_t> ());
+ std::make_unique<signal_delivery_edge_info_t> ());
}
const signal_state_machine &m_sm;
@@ -352,7 +352,7 @@ signal_state_machine::on_stmt (sm_context &sm_ctxt,
if (signal_unsafe_p (callee_fndecl))
if (sm_ctxt.get_global_state () == m_in_signal_handler)
sm_ctxt.warn (node, stmt, NULL_TREE,
- make_unique<signal_unsafe_call>
+ std::make_unique<signal_unsafe_call>
(*this, *call, callee_fndecl));
}
diff --git a/gcc/analyzer/sm-taint.cc b/gcc/analyzer/sm-taint.cc
index 21ce68e..e782081 100644
--- a/gcc/analyzer/sm-taint.cc
+++ b/gcc/analyzer/sm-taint.cc
@@ -1113,8 +1113,8 @@ taint_state_machine::on_stmt (sm_context &sm_ctxt,
&& sm_ctxt.get_global_state () == m_tainted_control_flow)
{
sm_ctxt.warn (node, call, NULL_TREE,
- make_unique<tainted_assertion> (*this, NULL_TREE,
- callee_fndecl));
+ std::make_unique<tainted_assertion> (*this, NULL_TREE,
+ callee_fndecl));
}
}
// TODO: ...etc; many other sources of untrusted data
@@ -1464,7 +1464,7 @@ taint_state_machine::check_for_tainted_size_arg (sm_context &sm_ctxt,
TREE_STRING_POINTER (access->to_external_string ());
tree diag_size = sm_ctxt.get_diagnostic_tree (size_arg);
sm_ctxt.warn (node, &call, size_arg,
- make_unique<tainted_access_attrib_size>
+ std::make_unique<tainted_access_attrib_size>
(*this, diag_size, b,
callee_fndecl,
access->sizarg,
@@ -1508,8 +1508,9 @@ taint_state_machine::check_for_tainted_divisor (sm_context &sm_ctxt,
return;
tree diag_divisor = sm_ctxt.get_diagnostic_tree (divisor_expr);
- sm_ctxt.warn (node, assign, divisor_expr,
- make_unique <tainted_divisor> (*this, diag_divisor, b));
+ sm_ctxt.warn
+ (node, assign, divisor_expr,
+ std::make_unique <tainted_divisor> (*this, diag_divisor, b));
sm_ctxt.set_next_state (assign, divisor_sval, m_stop);
}
}
@@ -1672,8 +1673,8 @@ region_model::check_region_for_taint (const region *reg,
if (index_can_be_out_of_bounds_p (element_reg))
{
tree arg = get_representative_tree (index);
- ctxt->warn (make_unique<tainted_array_index> (taint_sm,
- arg, b));
+ ctxt->warn (std::make_unique<tainted_array_index> (taint_sm,
+ arg, b));
}
else if (ctxt->get_logger ())
ctxt->get_logger ()->log ("rejecting tainted_array_index as"
@@ -1699,8 +1700,8 @@ region_model::check_region_for_taint (const region *reg,
if (taint_sm.get_taint (state, effective_type, &b))
{
tree arg = get_representative_tree (offset);
- ctxt->warn (make_unique<tainted_offset> (taint_sm, arg, b,
- offset));
+ ctxt->warn (std::make_unique<tainted_offset> (taint_sm, arg, b,
+ offset));
}
}
break;
@@ -1717,7 +1718,7 @@ region_model::check_region_for_taint (const region *reg,
if (taint_sm.get_taint (state, size_sval->get_type (), &b))
{
tree arg = get_representative_tree (size_sval);
- ctxt->warn (make_unique<tainted_size> (taint_sm, arg, b));
+ ctxt->warn (std::make_unique<tainted_size> (taint_sm, arg, b));
}
}
break;
@@ -1763,7 +1764,7 @@ region_model::check_dynamic_size_for_taint (enum memory_space mem_space,
if (taint_sm.get_taint (state, size_in_bytes->get_type (), &b))
{
tree arg = get_representative_tree (size_in_bytes);
- ctxt->warn (make_unique<tainted_allocation_size>
+ ctxt->warn (std::make_unique<tainted_allocation_size>
(taint_sm, arg, size_in_bytes, b, mem_space));
}
}
diff --git a/gcc/analyzer/sm.cc b/gcc/analyzer/sm.cc
index 4328e3c..0abbdd6 100644
--- a/gcc/analyzer/sm.cc
+++ b/gcc/analyzer/sm.cc
@@ -72,7 +72,7 @@ state_machine::state::to_json () const
pretty_printer pp;
pp_format_decoder (&pp) = default_tree_printer;
dump_to_pp (&pp);
- return ::make_unique<json::string> (pp_formatted_text (&pp));
+ return std::make_unique<json::string> (pp_formatted_text (&pp));
}
/* class state_machine. */
@@ -143,11 +143,11 @@ state_machine::dump_to_pp (pretty_printer *pp) const
std::unique_ptr<json::object>
state_machine::to_json () const
{
- auto sm_obj = ::make_unique<json::object> ();
+ auto sm_obj = std::make_unique<json::object> ();
sm_obj->set_string ("name", m_name);
{
- auto states_arr = ::make_unique<json::array> ();
+ auto states_arr = std::make_unique<json::array> ();
unsigned i;
state *s;
FOR_EACH_VEC_ELT (m_states, i, s)
diff --git a/gcc/analyzer/store.cc b/gcc/analyzer/store.cc
index 6716aaf..e6723c7 100644
--- a/gcc/analyzer/store.cc
+++ b/gcc/analyzer/store.cc
@@ -213,7 +213,7 @@ bit_range::dump () const
std::unique_ptr<json::object>
bit_range::to_json () const
{
- auto obj = ::make_unique<json::object> ();
+ auto obj = std::make_unique<json::object> ();
obj->set ("start_bit_offset",
bit_offset_to_json (m_start_bit_offset));
obj->set ("size_in_bits",
@@ -487,7 +487,7 @@ byte_range::dump () const
std::unique_ptr<json::object>
byte_range::to_json () const
{
- auto obj = ::make_unique<json::object> ();
+ auto obj = std::make_unique<json::object> ();
obj->set ("start_byte_offset",
byte_offset_to_json (m_start_byte_offset));
obj->set ("size_in_bytes",
@@ -752,7 +752,7 @@ binding_map::dump (bool simple) const
std::unique_ptr<json::object>
binding_map::to_json () const
{
- auto map_obj = ::make_unique<json::object> ();
+ auto map_obj = std::make_unique<json::object> ();
auto_vec <const binding_key *> binding_keys;
for (map_t::iterator iter = m_map.begin ();
@@ -1434,7 +1434,7 @@ binding_cluster::validate () const
std::unique_ptr<json::object>
binding_cluster::to_json () const
{
- auto cluster_obj = ::make_unique<json::object> ();
+ auto cluster_obj = std::make_unique<json::object> ();
cluster_obj->set_bool ("escaped", m_escaped);
cluster_obj->set_bool ("touched", m_touched);
@@ -2651,7 +2651,7 @@ store::validate () const
std::unique_ptr<json::object>
store::to_json () const
{
- auto store_obj = ::make_unique<json::object> ();
+ auto store_obj = std::make_unique<json::object> ();
/* Sort into some deterministic order. */
auto_vec<const region *> base_regions;
@@ -2674,7 +2674,7 @@ store::to_json () const
{
gcc_assert (parent_reg);
- auto clusters_in_parent_reg_obj = ::make_unique<json::object> ();
+ auto clusters_in_parent_reg_obj = std::make_unique<json::object> ();
const region *base_reg;
unsigned j;
diff --git a/gcc/analyzer/supergraph.cc b/gcc/analyzer/supergraph.cc
index 67c676f..f4823c6 100644
--- a/gcc/analyzer/supergraph.cc
+++ b/gcc/analyzer/supergraph.cc
@@ -444,11 +444,11 @@ supergraph::dump_dot (const char *path, const dump_args_t &dump_args) const
std::unique_ptr<json::object>
supergraph::to_json () const
{
- auto sgraph_obj = ::make_unique<json::object> ();
+ auto sgraph_obj = std::make_unique<json::object> ();
/* Nodes. */
{
- auto nodes_arr = ::make_unique<json::array> ();
+ auto nodes_arr = std::make_unique<json::array> ();
unsigned i;
supernode *n;
FOR_EACH_VEC_ELT (m_nodes, i, n)
@@ -458,7 +458,7 @@ supergraph::to_json () const
/* Edges. */
{
- auto edges_arr = ::make_unique<json::array> ();
+ auto edges_arr = std::make_unique<json::array> ();
unsigned i;
superedge *n;
FOR_EACH_VEC_ELT (m_edges, i, n)
@@ -699,7 +699,7 @@ supernode::dump_dot_id (pretty_printer *pp) const
std::unique_ptr<json::object>
supernode::to_json () const
{
- auto snode_obj = ::make_unique<json::object> ();
+ auto snode_obj = std::make_unique<json::object> ();
snode_obj->set_integer ("idx", m_index);
snode_obj->set_integer ("bb_idx", m_bb->index);
@@ -716,7 +716,7 @@ supernode::to_json () const
/* Phi nodes. */
{
- auto phi_arr = ::make_unique<json::array> ();
+ auto phi_arr = std::make_unique<json::array> ();
for (gphi_iterator gpi = const_cast<supernode *> (this)->start_phis ();
!gsi_end_p (gpi); gsi_next (&gpi))
{
@@ -731,7 +731,7 @@ supernode::to_json () const
/* Statements. */
{
- auto stmt_arr = ::make_unique<json::array> ();
+ auto stmt_arr = std::make_unique<json::array> ();
int i;
gimple *stmt;
FOR_EACH_VEC_ELT (m_stmts, i, stmt)
@@ -962,7 +962,7 @@ superedge::dump_dot (graphviz_out *gv, const dump_args_t &) const
std::unique_ptr<json::object>
superedge::to_json () const
{
- auto sedge_obj = ::make_unique<json::object> ();
+ auto sedge_obj = std::make_unique<json::object> ();
sedge_obj->set_string ("kind", edge_kind_to_string (m_kind));
sedge_obj->set_integer ("src_idx", m_src->m_index);
sedge_obj->set_integer ("dst_idx", m_dest->m_index);
diff --git a/gcc/analyzer/svalue.cc b/gcc/analyzer/svalue.cc
index ed51115..513d9cc 100644
--- a/gcc/analyzer/svalue.cc
+++ b/gcc/analyzer/svalue.cc
@@ -25,7 +25,6 @@ along with GCC; see the file COPYING3. If not see
#include "fold-const.h"
#include "diagnostic.h"
#include "tree-diagnostic.h"
-#include "make-unique.h"
#include "text-art/dump.h"
@@ -36,7 +35,6 @@ along with GCC; see the file COPYING3. If not see
#include "analyzer/svalue.h"
#include "analyzer/region-model.h"
-
#if ENABLE_ANALYZER
namespace ana {
@@ -92,7 +90,7 @@ std::unique_ptr<json::value>
svalue::to_json () const
{
label_text desc = get_desc (true);
- auto sval_js = ::make_unique<json::string> (desc.get ());
+ auto sval_js = std::make_unique<json::string> (desc.get ());
return sval_js;
}
diff --git a/gcc/analyzer/varargs.cc b/gcc/analyzer/varargs.cc
index 55730a3..6ea0d29 100644
--- a/gcc/analyzer/varargs.cc
+++ b/gcc/analyzer/varargs.cc
@@ -556,7 +556,7 @@ va_list_state_machine::check_for_ended_va_list (sm_context &sm_ctxt,
{
if (sm_ctxt.get_state (&call, arg) == m_ended)
sm_ctxt.warn (node, &call, arg,
- make_unique<va_list_use_after_va_end>
+ std::make_unique<va_list_use_after_va_end>
(*this, arg, NULL_TREE, usage_fnname));
}
@@ -635,7 +635,7 @@ va_list_state_machine::on_va_end (sm_context &sm_ctxt,
std::unique_ptr<pending_diagnostic>
va_list_state_machine::on_leak (tree var) const
{
- return make_unique<va_list_leak> (*this, nullptr, var);
+ return std::make_unique<va_list_leak> (*this, nullptr, var);
}
} // anonymous namespace
@@ -814,7 +814,7 @@ public:
= get_num_variadic_arguments (dst_node->get_function ()->decl,
call_stmt);
emission_path->add_event
- (make_unique<va_arg_call_event>
+ (std::make_unique<va_arg_call_event>
(eedge,
event_loc_info (last_stmt ? last_stmt->location : UNKNOWN_LOCATION,
src_point.get_fndecl (),
@@ -1070,7 +1070,7 @@ kf_va_arg::impl_call_pre (const call_details &cd) const
else
{
if (ctxt)
- ctxt->warn (make_unique <va_arg_type_mismatch>
+ ctxt->warn (std::make_unique <va_arg_type_mismatch>
(va_list_tree,
arg_reg,
lhs_type,
@@ -1081,8 +1081,9 @@ kf_va_arg::impl_call_pre (const call_details &cd) const
else
{
if (ctxt)
- ctxt->warn (make_unique <va_list_exhausted> (va_list_tree,
- arg_reg));
+ ctxt->warn
+ (std::make_unique <va_list_exhausted> (va_list_tree,
+ arg_reg));
saw_problem = true;
}
}
@@ -1131,10 +1132,10 @@ public:
void
register_varargs_builtins (known_function_manager &kfm)
{
- kfm.add (BUILT_IN_VA_START, make_unique<kf_va_start> ());
- kfm.add (BUILT_IN_VA_COPY, make_unique<kf_va_copy> ());
- kfm.add (IFN_VA_ARG, make_unique<kf_va_arg> ());
- kfm.add (BUILT_IN_VA_END, make_unique<kf_va_end> ());
+ kfm.add (BUILT_IN_VA_START, std::make_unique<kf_va_start> ());
+ kfm.add (BUILT_IN_VA_COPY, std::make_unique<kf_va_copy> ());
+ kfm.add (IFN_VA_ARG, std::make_unique<kf_va_arg> ());
+ kfm.add (BUILT_IN_VA_END, std::make_unique<kf_va_end> ());
}
} // namespace ana
diff --git a/gcc/c-family/c-pretty-print.cc b/gcc/c-family/c-pretty-print.cc
index 1ce19f5..fad6b5e 100644
--- a/gcc/c-family/c-pretty-print.cc
+++ b/gcc/c-family/c-pretty-print.cc
@@ -36,7 +36,6 @@ along with GCC; see the file COPYING3. If not see
#include "function.h"
#include "basic-block.h"
#include "gimple.h"
-#include "make-unique.h"
/* The pretty-printer code is primarily designed to closely follow
(GNU) C and C++ grammars. That is to be contrasted with spaghetti
@@ -2994,7 +2993,7 @@ c_pretty_printer::c_pretty_printer (dump_flags_t dump_flags)
std::unique_ptr<pretty_printer>
c_pretty_printer::clone () const
{
- return ::make_unique<c_pretty_printer> (*this);
+ return std::make_unique<c_pretty_printer> (*this);
}
/* Print the tree T in full, on file FILE. */
diff --git a/gcc/c/c-decl.cc b/gcc/c/c-decl.cc
index e7765f6..4e200f9 100644
--- a/gcc/c/c-decl.cc
+++ b/gcc/c/c-decl.cc
@@ -62,7 +62,6 @@ along with GCC; see the file COPYING3. If not see
#include "omp-offload.h" /* For offload_vars. */
#include "c-parser.h"
#include "gcc-urlifier.h"
-#include "make-unique.h"
#include "tree-pretty-print.h"
@@ -4550,9 +4549,9 @@ lookup_name_fuzzy (tree name, enum lookup_name_fuzzy_kind kind, location_t loc)
if (header_hint)
return name_hint
(nullptr,
- ::make_unique<suggest_missing_header> (loc,
- IDENTIFIER_POINTER (name),
- header_hint));
+ std::make_unique<suggest_missing_header> (loc,
+ IDENTIFIER_POINTER (name),
+ header_hint));
/* Next, look for exact matches for builtin defines that would have been
defined if the user had passed a command-line option (e.g. -fopenmp
@@ -4562,9 +4561,9 @@ lookup_name_fuzzy (tree name, enum lookup_name_fuzzy_kind kind, location_t loc)
if (option_id.m_idx > 0)
return name_hint
(nullptr,
- ::make_unique<suggest_missing_option> (loc,
- IDENTIFIER_POINTER (name),
- option_id));
+ std::make_unique<suggest_missing_option> (loc,
+ IDENTIFIER_POINTER (name),
+ option_id));
/* Only suggest names reserved for the implementation if NAME begins
with an underscore. */
diff --git a/gcc/c/c-objc-common.cc b/gcc/c/c-objc-common.cc
index 7e227d3..2016eae 100644
--- a/gcc/c/c-objc-common.cc
+++ b/gcc/c/c-objc-common.cc
@@ -32,7 +32,6 @@ along with GCC; see the file COPYING3. If not see
#include "stringpool.h"
#include "attribs.h"
#include "dwarf2.h"
-#include "make-unique.h"
static bool c_tree_printer (pretty_printer *, text_info *, const char *,
int, bool, bool, bool, bool *, pp_token_list &);
@@ -412,7 +411,7 @@ has_c_linkage (const_tree decl ATTRIBUTE_UNUSED)
void
c_initialize_diagnostics (diagnostic_context *context)
{
- context->set_pretty_printer (::make_unique<c_pretty_printer> ());
+ context->set_pretty_printer (std::make_unique<c_pretty_printer> ());
c_common_diagnostics_set_defaults (context);
context->set_format_decoder (&c_tree_printer);
}
diff --git a/gcc/c/c-parser.cc b/gcc/c/c-parser.cc
index 2e7ba28..8a63dc5 100644
--- a/gcc/c/c-parser.cc
+++ b/gcc/c/c-parser.cc
@@ -77,7 +77,6 @@ along with GCC; see the file COPYING3. If not see
#include "asan.h"
#include "c-family/c-ubsan.h"
#include "gcc-urlifier.h"
-#include "make-unique.h"
/* We need to walk over decls with incomplete struct/union/enum types
after parsing the whole translation unit.
@@ -1074,9 +1073,10 @@ c_parser_error_richloc (c_parser *parser, const char *gmsgid,
= get_c_stdlib_header_for_string_macro_name (token_name);
if (header_hint != NULL)
h = name_hint (nullptr,
- ::make_unique<suggest_missing_header> (token->location,
- token_name,
- header_hint));
+ std::make_unique<suggest_missing_header>
+ (token->location,
+ token_name,
+ header_hint));
}
c_parse_error (gmsgid,
diff --git a/gcc/cp/cxx-pretty-print.cc b/gcc/cp/cxx-pretty-print.cc
index cf301bd..5f24015 100644
--- a/gcc/cp/cxx-pretty-print.cc
+++ b/gcc/cp/cxx-pretty-print.cc
@@ -24,7 +24,6 @@ along with GCC; see the file COPYING3. If not see
#include "cp-tree.h"
#include "cxx-pretty-print.h"
#include "tree-pretty-print.h"
-#include "make-unique.h"
static void pp_cxx_unqualified_id (cxx_pretty_printer *, tree);
static void pp_cxx_nested_name_specifier (cxx_pretty_printer *, tree);
@@ -2954,5 +2953,5 @@ cxx_pretty_printer::cxx_pretty_printer ()
std::unique_ptr<pretty_printer>
cxx_pretty_printer::clone () const
{
- return ::make_unique<cxx_pretty_printer> (*this);
+ return std::make_unique<cxx_pretty_printer> (*this);
}
diff --git a/gcc/cp/error.cc b/gcc/cp/error.cc
index 499eb1b..75bf7dc 100644
--- a/gcc/cp/error.cc
+++ b/gcc/cp/error.cc
@@ -38,7 +38,6 @@ along with GCC; see the file COPYING3. If not see
#include "cp-name-hint.h"
#include "attribs.h"
#include "pretty-print-format-impl.h"
-#include "make-unique.h"
#include "diagnostic-format-text.h"
#define pp_separate_with_comma(PP) pp_cxx_separate_with (PP, ',')
diff --git a/gcc/cp/name-lookup.cc b/gcc/cp/name-lookup.cc
index 27b32f0..9b317c4 100644
--- a/gcc/cp/name-lookup.cc
+++ b/gcc/cp/name-lookup.cc
@@ -35,7 +35,6 @@ along with GCC; see the file COPYING3. If not see
#include "c-family/known-headers.h"
#include "c-family/c-spellcheck.h"
#include "bitmap.h"
-#include "make-unique.h"
static cxx_binding *cxx_binding_make (tree value, tree type);
static cp_binding_level *innermost_nonclass_level (void);
@@ -7086,16 +7085,16 @@ namespace_hints::convert_candidates_to_name_hint ()
/* Clean up CANDIDATES. */
m_candidates.release ();
return name_hint (expr_to_string (candidate),
- ::make_unique<show_candidate_location> (m_loc,
- candidate));
+ std::make_unique<show_candidate_location> (m_loc,
+ candidate));
}
else if (m_candidates.length () > 1)
/* If we have more than one candidate, issue a name_hint without a single
"suggestion", but with a deferred diagnostic that lists the
various candidates. This takes ownership of m_candidates. */
return name_hint (NULL,
- ::make_unique<suggest_alternatives> (m_loc,
- m_candidates));
+ std::make_unique<suggest_alternatives> (m_loc,
+ m_candidates));
/* Otherwise, m_candidates ought to be empty, so no cleanup is necessary. */
gcc_assert (m_candidates.length () == 0);
@@ -7117,9 +7116,9 @@ namespace_hints::maybe_decorate_with_limit (name_hint hint)
if (m_limited)
return name_hint
(hint.suggestion (),
- ::make_unique<namespace_limit_reached> (m_loc, m_limit,
- m_name,
- hint.take_deferred ()));
+ std::make_unique<namespace_limit_reached> (m_loc, m_limit,
+ m_name,
+ hint.take_deferred ()));
else
return hint;
}
@@ -7198,9 +7197,9 @@ suggest_alternatives_for_1 (location_t location, tree name,
if (option_id.m_idx > 0)
return name_hint
(nullptr,
- ::make_unique<suggest_missing_option> (location,
- IDENTIFIER_POINTER (name),
- option_id));
+ std::make_unique<suggest_missing_option> (location,
+ IDENTIFIER_POINTER (name),
+ option_id));
/* Otherwise, consider misspellings. */
if (!suggest_misspellings)
@@ -7329,8 +7328,8 @@ maybe_suggest_missing_std_header (location_t location, tree name)
return name_hint ();
return name_hint (nullptr,
- ::make_unique<missing_std_header> (location, name_str,
- header_hint));
+ std::make_unique<missing_std_header> (location, name_str,
+ header_hint));
}
/* Attempt to generate a name_hint that suggests a missing header file
@@ -7727,7 +7726,7 @@ class macro_use_before_def : public deferred_diagnostic
if (!linemap_location_before_p (line_table, use_loc, def_loc))
return nullptr;
- return ::make_unique<macro_use_before_def> (use_loc, macro);
+ return std::make_unique<macro_use_before_def> (use_loc, macro);
}
/* Ctor. LOC is the location of the usage. MACRO is the
@@ -7798,9 +7797,9 @@ lookup_name_fuzzy (tree name, enum lookup_name_fuzzy_kind kind, location_t loc)
if (header_hint)
return name_hint
(nullptr,
- ::make_unique<suggest_missing_header> (loc,
- IDENTIFIER_POINTER (name),
- header_hint));
+ std::make_unique<suggest_missing_header> (loc,
+ IDENTIFIER_POINTER (name),
+ header_hint));
best_match <tree, const char *> bm (name);
diff --git a/gcc/cp/parser.cc b/gcc/cp/parser.cc
index 6cdf262..e165b2a 100644
--- a/gcc/cp/parser.cc
+++ b/gcc/cp/parser.cc
@@ -50,7 +50,6 @@ along with GCC; see the file COPYING3. If not see
#include "contracts.h"
#include "bitmap.h"
#include "builtins.h"
-#include "make-unique.h"
/* The lexer. */
@@ -3437,9 +3436,9 @@ cp_parser_error_1 (cp_parser* parser, const char* gmsgid,
if (header_hint != NULL)
h = name_hint
(nullptr,
- ::make_unique<suggest_missing_header> (token->location,
- token_name,
- header_hint));
+ std::make_unique<suggest_missing_header> (token->location,
+ token_name,
+ header_hint));
}
/* Actually emit the error. */
diff --git a/gcc/diagnostic-format-json.cc b/gcc/diagnostic-format-json.cc
index 883b0ea..c28804e 100644
--- a/gcc/diagnostic-format-json.cc
+++ b/gcc/diagnostic-format-json.cc
@@ -32,7 +32,6 @@ along with GCC; see the file COPYING3. If not see
#include "json.h"
#include "selftest.h"
#include "logical-location.h"
-#include "make-unique.h"
class json_output_format;
@@ -74,7 +73,7 @@ public:
std::unique_ptr<diagnostic_per_format_buffer>
make_per_format_buffer () final override
{
- return ::make_unique<diagnostic_json_format_buffer> (*this);
+ return std::make_unique<diagnostic_json_format_buffer> (*this);
}
void set_buffer (diagnostic_per_format_buffer *base_buffer) final override
{
@@ -118,7 +117,7 @@ protected:
bool formatted)
: diagnostic_output_format (context),
m_buffer (nullptr),
- m_toplevel_array (::make_unique<json::array> ()),
+ m_toplevel_array (std::make_unique<json::array> ()),
m_cur_group (nullptr),
m_cur_children_array (nullptr),
m_formatted (formatted)
@@ -156,7 +155,7 @@ static std::unique_ptr<json::object>
json_from_expanded_location (diagnostic_context &context, location_t loc)
{
expanded_location exploc = expand_location (loc);
- std::unique_ptr<json::object> result = ::make_unique <json::object> ();
+ std::unique_ptr<json::object> result = std::make_unique <json::object> ();
if (exploc.file)
result->set_string ("file", exploc.file);
result->set_integer ("line", exploc.line);
@@ -200,7 +199,7 @@ json_from_location_range (diagnostic_context &context,
location_t start_loc = get_start (loc_range->m_loc);
location_t finish_loc = get_finish (loc_range->m_loc);
- std::unique_ptr<json::object> result = ::make_unique <json::object> ();
+ std::unique_ptr<json::object> result = std::make_unique <json::object> ();
result->set ("caret",
json_from_expanded_location (context, caret_loc));
if (start_loc != caret_loc
@@ -227,7 +226,7 @@ json_from_location_range (diagnostic_context &context,
static std::unique_ptr<json::object>
json_from_fixit_hint (diagnostic_context &context, const fixit_hint *hint)
{
- std::unique_ptr<json::object> fixit_obj = ::make_unique <json::object> ();
+ std::unique_ptr<json::object> fixit_obj = std::make_unique <json::object> ();
location_t start_loc = hint->get_start_loc ();
fixit_obj->set ("start",
@@ -245,7 +244,7 @@ json_from_fixit_hint (diagnostic_context &context, const fixit_hint *hint)
static std::unique_ptr<json::object>
json_from_metadata (const diagnostic_metadata *metadata)
{
- std::unique_ptr<json::object> metadata_obj = ::make_unique <json::object> ();
+ std::unique_ptr<json::object> metadata_obj = std::make_unique <json::object> ();
if (metadata->get_cwe ())
metadata_obj->set_integer ("cwe", metadata->get_cwe ());
@@ -260,12 +259,12 @@ make_json_for_path (diagnostic_context &context,
pretty_printer *ref_pp,
const diagnostic_path *path)
{
- std::unique_ptr<json::array> path_array = ::make_unique<json::array> ();
+ std::unique_ptr<json::array> path_array = std::make_unique<json::array> ();
for (unsigned i = 0; i < path->num_events (); i++)
{
const diagnostic_event &event = path->get_event (i);
- std::unique_ptr<json::object> event_obj = ::make_unique <json::object> ();
+ std::unique_ptr<json::object> event_obj = std::make_unique <json::object> ();
if (event.get_location ())
event_obj->set ("location",
json_from_expanded_location (context,
@@ -395,7 +394,7 @@ json_output_format::on_report_diagnostic (const diagnostic_info &diagnostic,
add a "children" array and record the column origin. */
m_cur_group = diag_obj;
std::unique_ptr<json::array> children_array
- = ::make_unique<json::array> ();
+ = std::make_unique<json::array> ();
m_cur_children_array = children_array.get (); // borrowed
diag_obj->set ("children", std::move (children_array));
diag_obj->set_integer ("column-origin", m_context.m_column_origin);
@@ -409,7 +408,7 @@ json_output_format::on_report_diagnostic (const diagnostic_info &diagnostic,
const rich_location *richloc = diagnostic.richloc;
{
- std::unique_ptr<json::array> loc_array = ::make_unique<json::array> ();
+ std::unique_ptr<json::array> loc_array = std::make_unique<json::array> ();
for (unsigned int i = 0; i < richloc->get_num_locations (); i++)
{
const location_range *loc_range = richloc->get_range (i);
@@ -422,7 +421,7 @@ json_output_format::on_report_diagnostic (const diagnostic_info &diagnostic,
if (richloc->get_num_fixit_hints ())
{
- std::unique_ptr<json::array> fixit_array = ::make_unique<json::array> ();
+ std::unique_ptr<json::array> fixit_array = std::make_unique<json::array> ();
for (unsigned int i = 0; i < richloc->get_num_fixit_hints (); i++)
{
const fixit_hint *hint = richloc->get_fixit_hint (i);
@@ -524,8 +523,8 @@ diagnostic_output_format_init_json_stderr (diagnostic_context &context,
{
diagnostic_output_format_init_json
(context,
- ::make_unique<json_stderr_output_format> (context,
- formatted));
+ std::make_unique<json_stderr_output_format> (context,
+ formatted));
}
/* Populate CONTEXT in preparation for JSON output to a file named
@@ -538,9 +537,9 @@ diagnostic_output_format_init_json_file (diagnostic_context &context,
{
diagnostic_output_format_init_json
(context,
- ::make_unique<json_file_output_format> (context,
- formatted,
- base_file_name));
+ std::make_unique<json_file_output_format> (context,
+ formatted,
+ base_file_name));
}
#if CHECKING_P
diff --git a/gcc/diagnostic-format-sarif.cc b/gcc/diagnostic-format-sarif.cc
index c490d0d..f322991 100644
--- a/gcc/diagnostic-format-sarif.cc
+++ b/gcc/diagnostic-format-sarif.cc
@@ -41,7 +41,6 @@ along with GCC; see the file COPYING3. If not see
#include "diagnostic-format-text.h"
#include "ordered-hash-map.h"
#include "sbitmap.h"
-#include "make-unique.h"
#include "selftest.h"
#include "selftest-diagnostic.h"
#include "selftest-diagnostic-show-locus.h"
@@ -158,7 +157,7 @@ make_date_time_string_for_current_time ()
"%02i:%02i:%02iZ"),
tm->tm_year + 1900, tm->tm_mon + 1, tm->tm_mday,
tm->tm_hour, tm->tm_min, tm->tm_sec);
- return ::make_unique<json::string> (buf);
+ return std::make_unique<json::string> (buf);
}
/* Subclass of sarif_object for SARIF "invocation" objects
@@ -920,13 +919,13 @@ sarif_object::get_or_create_properties ()
sarif_invocation::sarif_invocation (sarif_builder &builder,
const char * const *original_argv)
-: m_notifications_arr (::make_unique<json::array> ()),
+: m_notifications_arr (std::make_unique<json::array> ()),
m_success (true)
{
// "arguments" property (SARIF v2.1.0 section 3.20.2)
if (original_argv)
{
- auto arguments_arr = ::make_unique<json::array> ();
+ auto arguments_arr = std::make_unique<json::array> ();
for (size_t i = 0; original_argv[i]; ++i)
arguments_arr->append_string (original_argv[i]);
set<json::array> ("arguments", std::move (arguments_arr));
@@ -953,9 +952,9 @@ sarif_invocation::add_notification_for_ice (const diagnostic_info &diagnostic,
m_success = false;
auto notification
- = ::make_unique<sarif_ice_notification> (diagnostic,
- builder,
- std::move (backtrace));
+ = std::make_unique<sarif_ice_notification> (diagnostic,
+ builder,
+ std::move (backtrace));
/* Support for related locations within a notification was added
in SARIF 2.2; see https://github.com/oasis-tcs/sarif-spec/issues/540 */
@@ -1070,7 +1069,7 @@ sarif_artifact::populate_roles ()
{
if (bitmap_empty_p (m_roles))
return;
- auto roles_arr (::make_unique<json::array> ());
+ auto roles_arr (std::make_unique<json::array> ());
for (int i = 0; i < (int)diagnostic_artifact_role::NUM_ROLES; i++)
if (bitmap_bit_p (m_roles, i))
{
@@ -1247,7 +1246,7 @@ void
sarif_result::on_diagram (const diagnostic_diagram &diagram,
sarif_builder &builder)
{
- auto location_obj = ::make_unique<sarif_location> ();
+ auto location_obj = std::make_unique<sarif_location> ();
auto message_obj = builder.make_message_object_for_diagram (diagram);
location_obj->set<sarif_message> ("message", std::move (message_obj));
@@ -1346,7 +1345,7 @@ sarif_location::lazily_add_relationship_object (sarif_location &target,
/* No existing locationRelationship from THIS to TARGET; make one,
record it, and add it to the "relationships" array. */
auto relationship_obj
- = ::make_unique<sarif_location_relationship> (target, loc_mgr);
+ = std::make_unique<sarif_location_relationship> (target, loc_mgr);
sarif_location_relationship *relationship = relationship_obj.get ();
auto kv
= std::pair<sarif_location *,
@@ -1474,7 +1473,7 @@ sarif_code_flow::sarif_code_flow (sarif_result &parent,
m_idx_within_parent (idx_within_parent)
{
/* "threadFlows" property (SARIF v2.1.0 section 3.36.3). */
- auto thread_flows_arr = ::make_unique<json::array> ();
+ auto thread_flows_arr = std::make_unique<json::array> ();
m_thread_flows_arr = thread_flows_arr.get (); // borrowed
set<json::array> ("threadFlows", std::move (thread_flows_arr));
}
@@ -1489,7 +1488,7 @@ sarif_code_flow::get_or_append_thread_flow (const diagnostic_thread &thread,
unsigned next_thread_flow_idx = m_thread_flows_arr->size ();
auto thread_flow_obj
- = ::make_unique<sarif_thread_flow> (*this, thread, next_thread_flow_idx);
+ = std::make_unique<sarif_thread_flow> (*this, thread, next_thread_flow_idx);
m_thread_id_map.put (thread_id, thread_flow_obj.get ()); // borrowed
sarif_thread_flow *result = thread_flow_obj.get ();
m_thread_flows_arr->append<sarif_thread_flow> (std::move (thread_flow_obj));
@@ -1569,8 +1568,8 @@ sarif_builder::sarif_builder (diagnostic_context &context,
m_line_maps (line_maps),
m_token_printer (*this),
m_invocation_obj
- (::make_unique<sarif_invocation> (*this,
- context.get_original_argv ())),
+ (std::make_unique<sarif_invocation> (*this,
+ context.get_original_argv ())),
m_results_array (new json::array ()),
m_cur_group_result (nullptr),
m_seen_any_relative_paths (false),
@@ -1687,7 +1686,7 @@ bt_callback (void *data, uintptr_t pc, const char *filename, int lineno,
}
}
- auto frame_obj = ::make_unique<json::object> ();
+ auto frame_obj = std::make_unique<json::object> ();
/* I tried using sarifStack and sarifStackFrame for this
but it's not a good fit e.g. PC information. */
@@ -1713,7 +1712,7 @@ bt_callback (void *data, uintptr_t pc, const char *filename, int lineno,
std::unique_ptr<json::object>
sarif_builder::make_stack_from_backtrace ()
{
- auto frames_arr = ::make_unique<json::array> ();
+ auto frames_arr = std::make_unique<json::array> ();
backtrace_state *state = nullptr;
state = backtrace_create_state (nullptr, 0, nullptr, nullptr);
@@ -1726,7 +1725,7 @@ sarif_builder::make_stack_from_backtrace ()
if (frames_arr->size () == 0)
return nullptr;
- auto stack = ::make_unique<json::object> ();
+ auto stack = std::make_unique<json::object> ();
stack->set ("frames", std::move (frames_arr));
return stack;
}
@@ -1875,7 +1874,7 @@ sarif_builder::make_result_object (const diagnostic_info &diagnostic,
diagnostic_t orig_diag_kind,
unsigned idx_within_parent)
{
- auto result_obj = ::make_unique<sarif_result> (idx_within_parent);
+ auto result_obj = std::make_unique<sarif_result> (idx_within_parent);
/* "ruleId" property (SARIF v2.1.0 section 3.27.5). */
/* Ideally we'd have an option_name for these. */
@@ -1916,7 +1915,7 @@ sarif_builder::make_result_object (const diagnostic_info &diagnostic,
/* "taxa" property (SARIF v2.1.0 section 3.27.8). */
if (int cwe_id = diagnostic.metadata->get_cwe ())
{
- auto taxa_arr = ::make_unique<json::array> ();
+ auto taxa_arr = std::make_unique<json::array> ();
taxa_arr->append<sarif_reporting_descriptor_reference>
(make_reporting_descriptor_reference_object_for_cwe_id (cwe_id));
result_obj->set<json::array> ("taxa", std::move (taxa_arr));
@@ -1947,7 +1946,7 @@ sarif_builder::make_result_object (const diagnostic_info &diagnostic,
/* "codeFlows" property (SARIF v2.1.0 section 3.27.18). */
if (const diagnostic_path *path = diagnostic.richloc->get_path ())
{
- auto code_flows_arr = ::make_unique<json::array> ();
+ auto code_flows_arr = std::make_unique<json::array> ();
const unsigned code_flow_index = 0;
code_flows_arr->append<sarif_code_flow>
(make_code_flow_object (*result_obj.get (),
@@ -1964,7 +1963,7 @@ sarif_builder::make_result_object (const diagnostic_info &diagnostic,
const rich_location *richloc = diagnostic.richloc;
if (richloc->get_num_fixit_hints ())
{
- auto fix_arr = ::make_unique<json::array> ();
+ auto fix_arr = std::make_unique<json::array> ();
fix_arr->append<sarif_fix> (make_fix_object (*richloc));
result_obj->set<json::array> ("fixes", std::move (fix_arr));
}
@@ -1981,7 +1980,7 @@ make_reporting_descriptor_object_for_warning (const diagnostic_info &diagnostic,
diagnostic_t /*orig_diag_kind*/,
const char *option_text)
{
- auto reporting_desc = ::make_unique<sarif_reporting_descriptor> ();
+ auto reporting_desc = std::make_unique<sarif_reporting_descriptor> ();
/* "id" property (SARIF v2.1.0 section 3.49.3). */
reporting_desc->set_string ("id", option_text);
@@ -2005,7 +2004,7 @@ make_reporting_descriptor_object_for_warning (const diagnostic_info &diagnostic,
std::unique_ptr<sarif_reporting_descriptor>
sarif_builder::make_reporting_descriptor_object_for_cwe_id (int cwe_id) const
{
- auto reporting_desc = ::make_unique<sarif_reporting_descriptor> ();
+ auto reporting_desc = std::make_unique<sarif_reporting_descriptor> ();
/* "id" property (SARIF v2.1.0 section 3.49.3). */
{
@@ -2032,7 +2031,7 @@ std::unique_ptr<sarif_reporting_descriptor_reference>
sarif_builder::
make_reporting_descriptor_reference_object_for_cwe_id (int cwe_id)
{
- auto desc_ref_obj = ::make_unique<sarif_reporting_descriptor_reference> ();
+ auto desc_ref_obj = std::make_unique<sarif_reporting_descriptor_reference> ();
/* "id" property (SARIF v2.1.0 section 3.52.4). */
{
@@ -2059,7 +2058,7 @@ std::unique_ptr<sarif_tool_component_reference>
sarif_builder::
make_tool_component_reference_object_for_cwe () const
{
- auto comp_ref_obj = ::make_unique<sarif_tool_component_reference> ();
+ auto comp_ref_obj = std::make_unique<sarif_tool_component_reference> ();
/* "name" property (SARIF v2.1.0 section 3.54.3). */
comp_ref_obj->set_string ("name", "cwe");
@@ -2077,7 +2076,7 @@ sarif_builder::make_locations_arr (sarif_location_manager &loc_mgr,
const diagnostic_info &diagnostic,
enum diagnostic_artifact_role role)
{
- auto locations_arr = ::make_unique<json::array> ();
+ auto locations_arr = std::make_unique<json::array> ();
const logical_location *logical_loc = nullptr;
if (auto client_data_hooks = m_context.get_client_data_hooks ())
logical_loc = client_data_hooks->get_current_logical_location ();
@@ -2101,7 +2100,7 @@ set_any_logical_locs_arr (sarif_location &location_obj,
{
if (!logical_loc)
return;
- auto location_locs_arr = ::make_unique<json::array> ();
+ auto location_locs_arr = std::make_unique<json::array> ();
location_locs_arr->append<sarif_logical_location>
(make_sarif_logical_location_object (*logical_loc));
location_obj.set<json::array> ("logicalLocations",
@@ -2161,7 +2160,7 @@ sarif_builder::make_location_object (sarif_location_manager &loc_mgr,
} the_renderer (rich_loc,
m_context.get_escape_format ());
- auto location_obj = ::make_unique<sarif_location> ();
+ auto location_obj = std::make_unique<sarif_location> ();
/* Get primary loc from RICH_LOC. */
location_t loc = rich_loc.get_loc ();
@@ -2199,7 +2198,7 @@ sarif_builder::make_location_object (sarif_location_manager &loc_mgr,
if (region)
{
if (!annotations_arr)
- annotations_arr = ::make_unique<json::array> ();
+ annotations_arr = std::make_unique<json::array> ();
region->set<sarif_message>
("message", make_message_object (text.get ()));
annotations_arr->append<sarif_region> (std::move (region));
@@ -2279,7 +2278,7 @@ sarif_builder::make_location_object (sarif_location_manager &loc_mgr,
location_t loc,
enum diagnostic_artifact_role role)
{
- auto location_obj = ::make_unique<sarif_location> ();
+ auto location_obj = std::make_unique<sarif_location> ();
/* "physicalLocation" property (SARIF v2.1.0 section 3.28.3). */
if (auto phs_loc_obj
@@ -2300,7 +2299,7 @@ sarif_builder::make_location_object (sarif_location_manager &loc_mgr,
const diagnostic_event &event,
enum diagnostic_artifact_role role)
{
- auto location_obj = ::make_unique<sarif_location> ();
+ auto location_obj = std::make_unique<sarif_location> ();
/* "physicalLocation" property (SARIF v2.1.0 section 3.28.3). */
location_t loc = event.get_location ();
@@ -2344,7 +2343,7 @@ maybe_make_physical_location_object (location_t loc,
if (loc <= BUILTINS_LOCATION || LOCATION_FILE (loc) == nullptr)
return nullptr;
- auto phys_loc_obj = ::make_unique<sarif_physical_location> ();
+ auto phys_loc_obj = std::make_unique<sarif_physical_location> ();
/* "artifactLocation" property (SARIF v2.1.0 section 3.29.3). */
phys_loc_obj->set<sarif_artifact_location>
@@ -2388,7 +2387,7 @@ sarif_builder::make_artifact_location_object (location_t loc)
std::unique_ptr<sarif_artifact_location>
sarif_builder::make_artifact_location_object (const char *filename)
{
- auto artifact_loc_obj = ::make_unique<sarif_artifact_location> ();
+ auto artifact_loc_obj = std::make_unique<sarif_artifact_location> ();
/* "uri" property (SARIF v2.1.0 section 3.4.3). */
artifact_loc_obj->set_string ("uri", filename);
@@ -2434,7 +2433,7 @@ make_pwd_uri_str ()
std::unique_ptr<sarif_artifact_location>
sarif_builder::make_artifact_location_object_for_pwd () const
{
- auto artifact_loc_obj = ::make_unique<sarif_artifact_location> ();
+ auto artifact_loc_obj = std::make_unique<sarif_artifact_location> ();
/* "uri" property (SARIF v2.1.0 section 3.4.3). */
if (char *pwd = make_pwd_uri_str ())
@@ -2494,7 +2493,7 @@ sarif_builder::maybe_make_region_object (location_t loc,
if (exploc_start.line <= 0)
return nullptr;
- auto region_obj = ::make_unique<sarif_region> ();
+ auto region_obj = std::make_unique<sarif_region> ();
/* "startLine" property (SARIF v2.1.0 section 3.30.5) */
region_obj->set_integer ("startLine", exploc_start.line);
@@ -2571,7 +2570,7 @@ maybe_make_region_object_for_context (location_t loc,
if (exploc_start.line <= 0)
return nullptr;
- auto region_obj = ::make_unique<sarif_region> ();
+ auto region_obj = std::make_unique<sarif_region> ();
/* "startLine" property (SARIF v2.1.0 section 3.30.5) */
region_obj->set_integer ("startLine", exploc_start.line);
@@ -2605,7 +2604,7 @@ sarif_builder::make_region_object_for_hint (const fixit_hint &hint) const
expanded_location exploc_start = expand_location (start_loc);
expanded_location exploc_next = expand_location (next_loc);
- auto region_obj = ::make_unique<sarif_region> ();
+ auto region_obj = std::make_unique<sarif_region> ();
/* "startLine" property (SARIF v2.1.0 section 3.30.5) */
region_obj->set_integer ("startLine", exploc_start.line);
@@ -2665,7 +2664,7 @@ maybe_get_sarif_kind (enum logical_location_kind kind)
std::unique_ptr<sarif_logical_location>
make_sarif_logical_location_object (const logical_location &logical_loc)
{
- auto logical_loc_obj = ::make_unique<sarif_logical_location> ();
+ auto logical_loc_obj = std::make_unique<sarif_logical_location> ();
/* "name" property (SARIF v2.1.0 section 3.33.4). */
if (const char *short_name = logical_loc.get_short_name ())
@@ -2726,7 +2725,7 @@ sarif_builder::make_code_flow_object (sarif_result &result,
const diagnostic_path &path)
{
auto code_flow_obj
- = ::make_unique <sarif_code_flow> (result, idx_within_parent);
+ = std::make_unique <sarif_code_flow> (result, idx_within_parent);
/* First pass:
Create threadFlows and threadFlowLocation objects within them,
@@ -2811,7 +2810,7 @@ sarif_builder::maybe_make_kinds_array (diagnostic_event::meaning m) const
&& m.m_property == diagnostic_event::PROPERTY_unknown)
return nullptr;
- auto kinds_arr = ::make_unique<json::array> ();
+ auto kinds_arr = std::make_unique<json::array> ();
if (const char *verb_str
= diagnostic_event::meaning::maybe_get_verb_str (m.m_verb))
kinds_arr->append_string (verb_str);
@@ -2861,7 +2860,7 @@ set_string_property_escaping_braces (json::object &obj,
std::unique_ptr<sarif_message>
sarif_builder::make_message_object (const char *msg) const
{
- auto message_obj = ::make_unique<sarif_message> ();
+ auto message_obj = std::make_unique<sarif_message> ();
/* "text" property (SARIF v2.1.0 section 3.11.8). */
set_string_property_escaping_braces (*message_obj,
@@ -2877,7 +2876,7 @@ sarif_builder::make_message_object (const char *msg) const
std::unique_ptr<sarif_message>
sarif_builder::make_message_object_for_diagram (const diagnostic_diagram &diagram)
{
- auto message_obj = ::make_unique<sarif_message> ();
+ auto message_obj = std::make_unique<sarif_message> ();
/* "text" property (SARIF v2.1.0 section 3.11.8). */
set_string_property_escaping_braces (*message_obj,
@@ -2908,7 +2907,7 @@ sarif_builder::make_message_object_for_diagram (const diagnostic_diagram &diagra
std::unique_ptr<sarif_multiformat_message_string>
sarif_builder::make_multiformat_message_string (const char *msg) const
{
- auto message_obj = ::make_unique<sarif_multiformat_message_string> ();
+ auto message_obj = std::make_unique<sarif_multiformat_message_string> ();
/* "text" property (SARIF v2.1.0 section 3.12.3). */
set_string_property_escaping_braces (*message_obj,
@@ -2960,7 +2959,7 @@ sarif_builder::
make_top_level_object (std::unique_ptr<sarif_invocation> invocation_obj,
std::unique_ptr<json::array> results)
{
- auto log_obj = ::make_unique<sarif_log> ();
+ auto log_obj = std::make_unique<sarif_log> ();
/* "$schema" property (SARIF v2.1.0 section 3.13.3) . */
log_obj->set_string ("$schema", sarif_version_to_url (get_version ()));
@@ -2969,7 +2968,7 @@ make_top_level_object (std::unique_ptr<sarif_invocation> invocation_obj,
log_obj->set_string ("version", sarif_version_to_property (get_version ()));
/* "runs" property (SARIF v2.1.0 section 3.13.4). */
- auto run_arr = ::make_unique<json::array> ();
+ auto run_arr = std::make_unique<json::array> ();
auto run_obj = make_run_object (std::move (invocation_obj),
std::move (results));
run_arr->append<sarif_run> (std::move (run_obj));
@@ -2985,7 +2984,7 @@ sarif_builder::
make_run_object (std::unique_ptr<sarif_invocation> invocation_obj,
std::unique_ptr<json::array> results)
{
- auto run_obj = ::make_unique<sarif_run> ();
+ auto run_obj = std::make_unique<sarif_run> ();
/* "tool" property (SARIF v2.1.0 section 3.14.6). */
run_obj->set<sarif_tool> ("tool", make_tool_object ());
@@ -2996,7 +2995,7 @@ make_run_object (std::unique_ptr<sarif_invocation> invocation_obj,
/* "invocations" property (SARIF v2.1.0 section 3.14.11). */
{
- auto invocations_arr = ::make_unique<json::array> ();
+ auto invocations_arr = std::make_unique<json::array> ();
invocations_arr->append (std::move (invocation_obj));
run_obj->set<json::array> ("invocations", std::move (invocations_arr));
}
@@ -3004,7 +3003,7 @@ make_run_object (std::unique_ptr<sarif_invocation> invocation_obj,
/* "originalUriBaseIds (SARIF v2.1.0 section 3.14.14). */
if (m_seen_any_relative_paths)
{
- auto orig_uri_base_ids = ::make_unique<json::object> ();
+ auto orig_uri_base_ids = std::make_unique<json::object> ();
orig_uri_base_ids->set<sarif_artifact_location>
(PWD_PROPERTY_NAME, make_artifact_location_object_for_pwd ());
run_obj->set<json::object> ("originalUriBaseIds",
@@ -3012,7 +3011,7 @@ make_run_object (std::unique_ptr<sarif_invocation> invocation_obj,
}
/* "artifacts" property (SARIF v2.1.0 section 3.14.15). */
- auto artifacts_arr = ::make_unique<json::array> ();
+ auto artifacts_arr = std::make_unique<json::array> ();
for (auto iter : m_filename_to_artifact_map)
{
sarif_artifact *artifact_obj = iter.second;
@@ -3035,7 +3034,7 @@ make_run_object (std::unique_ptr<sarif_invocation> invocation_obj,
std::unique_ptr<sarif_tool>
sarif_builder::make_tool_object ()
{
- auto tool_obj = ::make_unique<sarif_tool> ();
+ auto tool_obj = std::make_unique<sarif_tool> ();
/* "driver" property (SARIF v2.1.0 section 3.18.2). */
tool_obj->set<sarif_tool_component> ("driver",
@@ -3054,7 +3053,7 @@ sarif_builder::make_tool_object ()
{
/* Create a "toolComponent" object (SARIF v2.1.0 section 3.19)
for the plugin. */
- auto plugin_obj = ::make_unique<sarif_tool_component> ();
+ auto plugin_obj = std::make_unique<sarif_tool_component> ();
/* "name" property (SARIF v2.1.0 section 3.19.8). */
if (const char *short_name = p.get_short_name ())
@@ -3076,7 +3075,7 @@ sarif_builder::make_tool_object ()
vinfo->for_each_plugin (v);
if (v.m_plugin_objs.size () > 0)
{
- auto extensions_arr = ::make_unique<json::array> ();
+ auto extensions_arr = std::make_unique<json::array> ();
for (auto &iter : v.m_plugin_objs)
extensions_arr->append<sarif_tool_component> (std::move (iter));
tool_obj->set<json::array> ("extensions",
@@ -3096,7 +3095,7 @@ sarif_builder::make_tool_object ()
std::unique_ptr<sarif_tool_component>
sarif_builder::make_driver_tool_component_object ()
{
- auto driver_obj = ::make_unique<sarif_tool_component> ();
+ auto driver_obj = std::make_unique<sarif_tool_component> ();
if (auto client_data_hooks = m_context.get_client_data_hooks ())
if (const client_version_info *vinfo
@@ -3145,7 +3144,7 @@ sarif_builder::maybe_make_taxonomies_array () const
return nullptr;
/* "taxonomies" property (SARIF v2.1.0 section 3.14.8). */
- auto taxonomies_arr = ::make_unique<json::array> ();
+ auto taxonomies_arr = std::make_unique<json::array> ();
taxonomies_arr->append<sarif_tool_component> (std::move (cwe_obj));
return taxonomies_arr;
}
@@ -3162,7 +3161,7 @@ sarif_builder::maybe_make_cwe_taxonomy_object () const
if (m_cwe_id_set.is_empty ())
return nullptr;
- auto taxonomy_obj = ::make_unique<sarif_tool_component> ();
+ auto taxonomy_obj = std::make_unique<sarif_tool_component> ();
/* "name" property (SARIF v2.1.0 section 3.19.8). */
taxonomy_obj->set_string ("name", "CWE");
@@ -3180,7 +3179,7 @@ sarif_builder::maybe_make_cwe_taxonomy_object () const
" Common Weakness Enumeration"));
/* "taxa" property (SARIF v2.1.0 3.section 3.19.25). */
- auto taxa_arr = ::make_unique<json::array> ();
+ auto taxa_arr = std::make_unique<json::array> ();
for (auto cwe_id : m_cwe_id_set)
taxa_arr->append<sarif_reporting_descriptor>
(make_reporting_descriptor_object_for_cwe_id (cwe_id));
@@ -3254,10 +3253,10 @@ sarif_builder::maybe_make_artifact_content_object (const char *filename) const
if (!cpp_valid_utf8_p(utf8_content.get_buffer (), utf8_content.length ()))
return nullptr;
- auto artifact_content_obj = ::make_unique<sarif_artifact_content> ();
+ auto artifact_content_obj = std::make_unique<sarif_artifact_content> ();
artifact_content_obj->set<json::string>
("text",
- ::make_unique <json::string> (utf8_content.get_buffer (),
+ std::make_unique <json::string> (utf8_content.get_buffer (),
utf8_content.length ()));
return artifact_content_obj;
}
@@ -3312,7 +3311,7 @@ maybe_make_artifact_content_object (const char *filename,
return nullptr;
}
- auto artifact_content_obj = ::make_unique<sarif_artifact_content> ();
+ auto artifact_content_obj = std::make_unique<sarif_artifact_content> ();
artifact_content_obj->set_string ("text", text_utf8);
free (text_utf8);
@@ -3330,11 +3329,11 @@ maybe_make_artifact_content_object (const char *filename,
std::unique_ptr<sarif_fix>
sarif_builder::make_fix_object (const rich_location &richloc)
{
- auto fix_obj = ::make_unique<sarif_fix> ();
+ auto fix_obj = std::make_unique<sarif_fix> ();
/* "artifactChanges" property (SARIF v2.1.0 section 3.55.3). */
/* We assume that all fix-it hints in RICHLOC affect the same file. */
- auto artifact_change_arr = ::make_unique<json::array> ();
+ auto artifact_change_arr = std::make_unique<json::array> ();
artifact_change_arr->append<sarif_artifact_change>
(make_artifact_change_object (richloc));
fix_obj->set<json::array> ("artifactChanges",
@@ -3348,7 +3347,7 @@ sarif_builder::make_fix_object (const rich_location &richloc)
std::unique_ptr<sarif_artifact_change>
sarif_builder::make_artifact_change_object (const rich_location &richloc)
{
- auto artifact_change_obj = ::make_unique<sarif_artifact_change> ();
+ auto artifact_change_obj = std::make_unique<sarif_artifact_change> ();
/* "artifactLocation" property (SARIF v2.1.0 section 3.56.2). */
artifact_change_obj->set<sarif_artifact_location>
@@ -3356,7 +3355,7 @@ sarif_builder::make_artifact_change_object (const rich_location &richloc)
make_artifact_location_object (richloc.get_loc ()));
/* "replacements" property (SARIF v2.1.0 section 3.56.3). */
- auto replacement_arr = ::make_unique<json::array> ();
+ auto replacement_arr = std::make_unique<json::array> ();
for (unsigned int i = 0; i < richloc.get_num_fixit_hints (); i++)
{
const fixit_hint *hint = richloc.get_fixit_hint (i);
@@ -3374,7 +3373,7 @@ sarif_builder::make_artifact_change_object (const rich_location &richloc)
std::unique_ptr<sarif_replacement>
sarif_builder::make_replacement_object (const fixit_hint &hint) const
{
- auto replacement_obj = ::make_unique<sarif_replacement> ();
+ auto replacement_obj = std::make_unique<sarif_replacement> ();
/* "deletedRegion" property (SARIF v2.1.0 section 3.57.3). */
replacement_obj->set<sarif_region> ("deletedRegion",
@@ -3393,7 +3392,7 @@ sarif_builder::make_replacement_object (const fixit_hint &hint) const
std::unique_ptr<sarif_artifact_content>
sarif_builder::make_artifact_content_object (const char *text) const
{
- auto content_obj = ::make_unique<sarif_artifact_content> ();
+ auto content_obj = std::make_unique<sarif_artifact_content> ();
/* "text" property (SARIF v2.1.0 section 3.3.2). */
content_obj->set_string ("text", text);
@@ -3472,7 +3471,7 @@ public:
std::unique_ptr<diagnostic_per_format_buffer>
make_per_format_buffer () final override
{
- return ::make_unique<diagnostic_sarif_format_buffer> (m_builder);
+ return std::make_unique<diagnostic_sarif_format_buffer> (m_builder);
}
void set_buffer (diagnostic_per_format_buffer *base_buffer) final override
{
@@ -3750,12 +3749,12 @@ diagnostic_output_format_init_sarif_stderr (diagnostic_context &context,
const sarif_generation_options sarif_gen_opts;
diagnostic_output_format_init_sarif
(context,
- ::make_unique<sarif_stream_output_format> (context,
- line_maps,
- main_input_filename_,
- formatted,
- sarif_gen_opts,
- stderr));
+ std::make_unique<sarif_stream_output_format> (context,
+ line_maps,
+ main_input_filename_,
+ formatted,
+ sarif_gen_opts,
+ stderr));
}
/* Attempt to open BASE_FILE_NAME.sarif for writing.
@@ -3813,12 +3812,12 @@ diagnostic_output_format_init_sarif_file (diagnostic_context &context,
const sarif_generation_options sarif_gen_opts;
diagnostic_output_format_init_sarif
(context,
- ::make_unique<sarif_file_output_format> (context,
- line_maps,
- main_input_filename_,
- formatted,
- sarif_gen_opts,
- std::move (output_file)));
+ std::make_unique<sarif_file_output_format> (context,
+ line_maps,
+ main_input_filename_,
+ formatted,
+ sarif_gen_opts,
+ std::move (output_file)));
}
/* Populate CONTEXT in preparation for SARIF output to STREAM. */
@@ -3834,12 +3833,12 @@ diagnostic_output_format_init_sarif_stream (diagnostic_context &context,
const sarif_generation_options sarif_gen_opts;
diagnostic_output_format_init_sarif
(context,
- ::make_unique<sarif_stream_output_format> (context,
- line_maps,
- main_input_filename_,
- formatted,
- sarif_gen_opts,
- stream));
+ std::make_unique<sarif_stream_output_format> (context,
+ line_maps,
+ main_input_filename_,
+ formatted,
+ sarif_gen_opts,
+ stream));
}
std::unique_ptr<diagnostic_output_format>
@@ -3850,12 +3849,13 @@ make_sarif_sink (diagnostic_context &context,
const sarif_generation_options &sarif_gen_opts,
diagnostic_output_file output_file)
{
- auto sink = ::make_unique<sarif_file_output_format> (context,
- &line_maps,
- main_input_filename_,
- formatted,
- sarif_gen_opts,
- std::move (output_file));
+ auto sink
+ = std::make_unique<sarif_file_output_format> (context,
+ &line_maps,
+ main_input_filename_,
+ formatted,
+ sarif_gen_opts,
+ std::move (output_file));
sink->update_printer ();
return sink;
}
@@ -3881,11 +3881,11 @@ public:
test_sarif_diagnostic_context (const char *main_input_filename,
const sarif_generation_options &sarif_gen_opts)
{
- auto format = ::make_unique<buffered_output_format> (*this,
- line_table,
- main_input_filename,
- true,
- sarif_gen_opts);
+ auto format = std::make_unique<buffered_output_format> (*this,
+ line_table,
+ main_input_filename,
+ true,
+ sarif_gen_opts);
m_format = format.get (); // borrowed
diagnostic_output_format_init_sarif (*this, std::move (format));
}
@@ -4377,7 +4377,7 @@ test_message_with_embedded_link (const sarif_generation_options &sarif_gen_opts)
};
test_sarif_diagnostic_context dc ("test.c", sarif_gen_opts);
- dc.push_owned_urlifier (::make_unique<test_urlifier> ());
+ dc.push_owned_urlifier (std::make_unique<test_urlifier> ());
rich_location richloc (line_table, UNKNOWN_LOCATION);
dc.report (DK_ERROR, richloc, nullptr, 0,
"foo %<-foption%> %<unrecognized%> bar");
diff --git a/gcc/diagnostic-format-text.cc b/gcc/diagnostic-format-text.cc
index 9273973..5df3894 100644
--- a/gcc/diagnostic-format-text.cc
+++ b/gcc/diagnostic-format-text.cc
@@ -34,7 +34,6 @@ along with GCC; see the file COPYING3. If not see
#include "diagnostic-format-text.h"
#include "diagnostic-buffer.h"
#include "text-art/theme.h"
-#include "make-unique.h"
/* Disable warnings about quoting issues in the pp_xxx calls below
that (intentionally) don't follow GCC diagnostic conventions. */
@@ -193,7 +192,7 @@ diagnostic_text_output_format::set_buffer (diagnostic_per_format_buffer *base)
std::unique_ptr<diagnostic_per_format_buffer>
diagnostic_text_output_format::make_per_format_buffer ()
{
- return ::make_unique<diagnostic_text_format_buffer> (*this);
+ return std::make_unique<diagnostic_text_format_buffer> (*this);
}
/* Implementation of diagnostic_output_format::on_report_diagnostic vfunc
diff --git a/gcc/diagnostic.cc b/gcc/diagnostic.cc
index 91f02ad..429c4b1 100644
--- a/gcc/diagnostic.cc
+++ b/gcc/diagnostic.cc
@@ -49,7 +49,6 @@ along with GCC; see the file COPYING3. If not see
#include "pretty-print-urlifier.h"
#include "logical-location.h"
#include "diagnostic-buffer.h"
-#include "make-unique.h"
#ifdef HAVE_TERMIOS_H
# include <termios.h>
@@ -223,7 +222,7 @@ diagnostic_context::initialize (int n_opts)
{
/* Allocate a basic pretty-printer. Clients will replace this a
much more elaborated pretty-printer if they wish. */
- m_reference_printer = ::make_unique<pretty_printer> ().release ();
+ m_reference_printer = std::make_unique<pretty_printer> ().release ();
m_file_cache = new file_cache ();
m_diagnostic_counters.clear ();
diff --git a/gcc/dumpfile.cc b/gcc/dumpfile.cc
index 65bd5c5..ebee8e5 100644
--- a/gcc/dumpfile.cc
+++ b/gcc/dumpfile.cc
@@ -40,7 +40,6 @@ along with GCC; see the file COPYING3. If not see
#include "optinfo-emit-json.h"
#include "stringpool.h" /* for get_identifier. */
#include "spellcheck.h"
-#include "make-unique.h"
#include "pretty-print-format-impl.h"
/* If non-NULL, return one past-the-end of the matching SUBPART of
@@ -638,9 +637,9 @@ make_item_for_dump_gimple_stmt (gimple *stmt, int spc, dump_flags_t dump_flags)
pp_newline (&pp);
std::unique_ptr<optinfo_item> item
- = make_unique<optinfo_item> (OPTINFO_ITEM_KIND_GIMPLE,
- gimple_location (stmt),
- xstrdup (pp_formatted_text (&pp)));
+ = std::make_unique<optinfo_item> (OPTINFO_ITEM_KIND_GIMPLE,
+ gimple_location (stmt),
+ xstrdup (pp_formatted_text (&pp)));
return item;
}
@@ -686,9 +685,9 @@ make_item_for_dump_gimple_expr (gimple *stmt, int spc, dump_flags_t dump_flags)
pp_gimple_stmt_1 (&pp, stmt, spc, dump_flags);
std::unique_ptr<optinfo_item> item
- = make_unique<optinfo_item> (OPTINFO_ITEM_KIND_GIMPLE,
- gimple_location (stmt),
- xstrdup (pp_formatted_text (&pp)));
+ = std::make_unique<optinfo_item> (OPTINFO_ITEM_KIND_GIMPLE,
+ gimple_location (stmt),
+ xstrdup (pp_formatted_text (&pp)));
return item;
}
@@ -740,8 +739,8 @@ make_item_for_dump_generic_expr (tree node, dump_flags_t dump_flags)
loc = EXPR_LOCATION (node);
std::unique_ptr<optinfo_item> item
- = make_unique<optinfo_item> (OPTINFO_ITEM_KIND_TREE, loc,
- xstrdup (pp_formatted_text (&pp)));
+ = std::make_unique<optinfo_item> (OPTINFO_ITEM_KIND_TREE, loc,
+ xstrdup (pp_formatted_text (&pp)));
return item;
}
@@ -785,8 +784,8 @@ make_item_for_dump_symtab_node (symtab_node *node)
{
location_t loc = DECL_SOURCE_LOCATION (node->decl);
std::unique_ptr<optinfo_item> item
- = make_unique<optinfo_item> (OPTINFO_ITEM_KIND_SYMTAB_NODE, loc,
- xstrdup (node->dump_name ()));
+ = std::make_unique<optinfo_item> (OPTINFO_ITEM_KIND_SYMTAB_NODE, loc,
+ xstrdup (node->dump_name ()));
return item;
}
@@ -847,7 +846,7 @@ dump_pretty_printer::stash_item (pp_token_list &formatted_tok_list,
gcc_assert (item.get ());
auto custom_data
- = ::make_unique<wrapped_optinfo_item> (std::move (item));
+ = std::make_unique<wrapped_optinfo_item> (std::move (item));
formatted_tok_list.push_back<pp_token_custom_data> (std::move (custom_data));
}
@@ -1013,8 +1012,8 @@ emit_any_pending_textual_chunks ()
char *formatted_text = xstrdup (pp_formatted_text (pp));
std::unique_ptr<optinfo_item> item
- = make_unique<optinfo_item> (OPTINFO_ITEM_KIND_TEXT, UNKNOWN_LOCATION,
- formatted_text);
+ = std::make_unique<optinfo_item> (OPTINFO_ITEM_KIND_TEXT, UNKNOWN_LOCATION,
+ formatted_text);
pp->emit_item (std::move (item), m_optinfo);
/* Clear the pending text by unwinding formatted_text back to the start
@@ -1085,8 +1084,8 @@ make_item_for_dump_dec (const poly_int<N, C> &value)
}
auto item
- = make_unique<optinfo_item> (OPTINFO_ITEM_KIND_TEXT, UNKNOWN_LOCATION,
- xstrdup (pp_formatted_text (&pp)));
+ = std::make_unique<optinfo_item> (OPTINFO_ITEM_KIND_TEXT, UNKNOWN_LOCATION,
+ xstrdup (pp_formatted_text (&pp)));
return item;
}
@@ -1164,8 +1163,8 @@ dump_context::begin_scope (const char *name,
pp_printf (&pp, "%s %s %s", "===", name, "===");
pp_newline (&pp);
std::unique_ptr<optinfo_item> item
- = make_unique<optinfo_item> (OPTINFO_ITEM_KIND_TEXT, UNKNOWN_LOCATION,
- xstrdup (pp_formatted_text (&pp)));
+ = std::make_unique<optinfo_item> (OPTINFO_ITEM_KIND_TEXT, UNKNOWN_LOCATION,
+ xstrdup (pp_formatted_text (&pp)));
emit_item (*item.get (), MSG_NOTE);
if (optinfo_enabled_p ())
diff --git a/gcc/gcc-attribute-urlifier.cc b/gcc/gcc-attribute-urlifier.cc
index d066624..fd3d629 100644
--- a/gcc/gcc-attribute-urlifier.cc
+++ b/gcc/gcc-attribute-urlifier.cc
@@ -29,7 +29,6 @@ along with GCC; see the file COPYING3. If not see
#include "options.h"
#include "diagnostic.h"
#include "selftest.h"
-#include "make-unique.h"
#include "target.h"
/* class attribute_urlifier : public urlifier. */
diff --git a/gcc/gcc-urlifier.cc b/gcc/gcc-urlifier.cc
index a409458..677720b 100644
--- a/gcc/gcc-urlifier.cc
+++ b/gcc/gcc-urlifier.cc
@@ -28,7 +28,6 @@ along with GCC; see the file COPYING3. If not see
#include "options.h"
#include "diagnostic.h"
#include "selftest.h"
-#include "make-unique.h"
char *
make_doc_url (const char *doc_url_suffix)
@@ -215,7 +214,7 @@ gcc_urlifier::get_url_suffix_for_option (const char *p, size_t sz) const
std::unique_ptr<urlifier>
make_gcc_urlifier (unsigned int lang_mask)
{
- return ::make_unique<gcc_urlifier> (lang_mask);
+ return std::make_unique<gcc_urlifier> (lang_mask);
}
/* class auto_override_urlifier. */
diff --git a/gcc/jit/dummy-frontend.cc b/gcc/jit/dummy-frontend.cc
index 88784ec..bf31a9d 100644
--- a/gcc/jit/dummy-frontend.cc
+++ b/gcc/jit/dummy-frontend.cc
@@ -33,7 +33,6 @@ along with GCC; see the file COPYING3. If not see
#include "cgraph.h"
#include "target.h"
#include "diagnostic-format-text.h"
-#include "make-unique.h"
#include "print-tree.h"
#include <mpfr.h>
@@ -1085,8 +1084,9 @@ jit_langhook_init (void)
diagnostic_text_starter (global_dc) = jit_begin_diagnostic;
diagnostic_text_finalizer (global_dc) = jit_end_diagnostic;
auto sink
- = ::make_unique<jit_diagnostic_listener> (*global_dc,
- *gcc::jit::active_playback_ctxt);
+ = std::make_unique<jit_diagnostic_listener>
+ (*global_dc,
+ *gcc::jit::active_playback_ctxt);
global_dc->set_output_format (std::move (sink));
build_common_tree_nodes (flag_signed_char);
diff --git a/gcc/json-parsing.cc b/gcc/json-parsing.cc
index 0b9715c..fc78500 100644
--- a/gcc/json-parsing.cc
+++ b/gcc/json-parsing.cc
@@ -24,7 +24,6 @@ along with GCC; see the file COPYING3. If not see
#include "json-parsing.h"
#include "pretty-print.h"
#include "math.h"
-#include "make-unique.h"
#include "selftest.h"
using namespace json;
@@ -1037,7 +1036,7 @@ lexer::make_error (const char *msg)
location_map::range r;
r.m_start = p;
r.m_end = p;
- return ::make_unique<error> (r, xstrdup (msg));
+ return std::make_unique<error> (r, xstrdup (msg));
}
/* parser's ctor. */
@@ -1092,7 +1091,7 @@ parser::parse_value (int depth)
case TOK_STRING:
{
- auto val = ::make_unique<string> (tok->u.string);
+ auto val = std::make_unique<string> (tok->u.string);
m_lexer.consume ();
maybe_record_range (val.get (), tok->range);
return parser_result_t (std::move (val));
@@ -1103,7 +1102,7 @@ parser::parse_value (int depth)
case TOK_FLOAT_NUMBER:
{
- auto val = ::make_unique<float_number> (tok->u.float_number);
+ auto val = std::make_unique<float_number> (tok->u.float_number);
m_lexer.consume ();
maybe_record_range (val.get (), tok->range);
return parser_result_t (std::move (val));
@@ -1111,7 +1110,7 @@ parser::parse_value (int depth)
case TOK_INTEGER_NUMBER:
{
- auto val = ::make_unique<integer_number> (tok->u.integer_number);
+ auto val = std::make_unique<integer_number> (tok->u.integer_number);
m_lexer.consume ();
maybe_record_range (val.get (), tok->range);
return parser_result_t (std::move (val));
@@ -1119,7 +1118,7 @@ parser::parse_value (int depth)
case TOK_TRUE:
{
- auto val = ::make_unique<literal> (JSON_TRUE);
+ auto val = std::make_unique<literal> (JSON_TRUE);
m_lexer.consume ();
maybe_record_range (val.get (), tok->range);
return parser_result_t (std::move (val));
@@ -1127,7 +1126,7 @@ parser::parse_value (int depth)
case TOK_FALSE:
{
- auto val = ::make_unique<literal> (JSON_FALSE);
+ auto val = std::make_unique<literal> (JSON_FALSE);
m_lexer.consume ();
maybe_record_range (val.get (), tok->range);
return parser_result_t (std::move (val));
@@ -1135,7 +1134,7 @@ parser::parse_value (int depth)
case TOK_NULL:
{
- auto val = ::make_unique<literal> (JSON_NULL);
+ auto val = std::make_unique<literal> (JSON_NULL);
m_lexer.consume ();
maybe_record_range (val.get (), tok->range);
return parser_result_t (std::move (val));
@@ -1160,7 +1159,7 @@ parser::parse_object (int depth)
require (TOK_OPEN_CURLY);
- auto obj = ::make_unique<object> ();
+ auto obj = std::make_unique<object> ();
const token *tok = m_lexer.peek ();
if (tok->id == TOK_CLOSE_CURLY)
@@ -1223,7 +1222,7 @@ parser::parse_array (int depth)
if (auto err = require (TOK_OPEN_SQUARE))
return parser_result_t (std::move (err));
- auto arr = ::make_unique<array> ();
+ auto arr = std::make_unique<array> ();
const token *tok = m_lexer.peek ();
if (tok->id == TOK_CLOSE_SQUARE)
@@ -1340,7 +1339,7 @@ parser::error_at (const location_map::range &r, const char *fmt, ...)
char *formatted_msg = xvasprintf (fmt, ap);
va_end (ap);
- return ::make_unique<error> (r, formatted_msg);
+ return std::make_unique<error> (r, formatted_msg);
}
/* Record that JV has range R within the input file. */
diff --git a/gcc/json.cc b/gcc/json.cc
index 4cf962f..e66a7ae 100644
--- a/gcc/json.cc
+++ b/gcc/json.cc
@@ -24,7 +24,6 @@ along with GCC; see the file COPYING3. If not see
#include "json.h"
#include "pretty-print.h"
#include "math.h"
-#include "make-unique.h"
#include "selftest.h"
using namespace json;
@@ -510,7 +509,7 @@ test_formatting ()
{
object obj;
object *child = new object;
- std::unique_ptr<object> grandchild = ::make_unique<object> ();
+ std::unique_ptr<object> grandchild = std::make_unique<object> ();
obj.set_string ("str", "bar");
obj.set ("child", child);
@@ -518,7 +517,7 @@ test_formatting ()
array *arr = new array;
for (int i = 0; i < 3; i++)
- arr->append (::make_unique<integer_number> (i));
+ arr->append (std::make_unique<integer_number> (i));
grandchild->set ("arr", arr);
grandchild->set_integer ("int", 1066);
diff --git a/gcc/lazy-diagnostic-path.cc b/gcc/lazy-diagnostic-path.cc
index ba62097..1474f70 100644
--- a/gcc/lazy-diagnostic-path.cc
+++ b/gcc/lazy-diagnostic-path.cc
@@ -28,7 +28,6 @@ along with GCC; see the file COPYING3. If not see
#include "intl.h"
#include "diagnostic.h"
#include "lazy-diagnostic-path.h"
-#include "make-unique.h"
#include "selftest.h"
#include "selftest-diagnostic.h"
#include "simple-diagnostic-path.h"
@@ -100,7 +99,7 @@ public:
tree fntype_void_void
= build_function_type_array (void_type_node, 0, NULL);
tree fndecl_foo = build_fn_decl ("foo", fntype_void_void);
- auto path = ::make_unique<simple_diagnostic_path> (&m_pp);
+ auto path = std::make_unique<simple_diagnostic_path> (&m_pp);
path->add_event (UNKNOWN_LOCATION, fndecl_foo, 0, "first %qs", "free");
path->add_event (UNKNOWN_LOCATION, fndecl_foo, 0, "double %qs", "free");
return path;
@@ -167,7 +166,7 @@ test_emission (pretty_printer *event_pp)
is skipped. */
{
test_diagnostic_context dc;
- dc.set_option_manager (::make_unique<all_warnings_disabled> (), 0);
+ dc.set_option_manager (std::make_unique<all_warnings_disabled> (), 0);
test_rich_location rich_loc (*event_pp);
ASSERT_FALSE (rich_loc.m_path.generated_p ());
diff --git a/gcc/libgdiagnostics.cc b/gcc/libgdiagnostics.cc
index 9f70669..49524cc 100644
--- a/gcc/libgdiagnostics.cc
+++ b/gcc/libgdiagnostics.cc
@@ -33,7 +33,6 @@ along with GCC; see the file COPYING3. If not see
#include "diagnostic-format-text.h"
#include "logical-location.h"
#include "edit-context.h"
-#include "make-unique.h"
#include "libgdiagnostics.h"
class owned_nullable_string
@@ -398,11 +397,11 @@ public:
m_dc.m_client_aux_data = this;
m_dc.set_client_data_hooks
- (::make_unique<impl_diagnostic_client_data_hooks> (*this));
+ (std::make_unique<impl_diagnostic_client_data_hooks> (*this));
diagnostic_text_starter (&m_dc) = diagnostic_text_sink::text_starter;
- m_edit_context = ::make_unique <edit_context> (m_dc.get_file_cache ());
+ m_edit_context = std::make_unique <edit_context> (m_dc.get_file_cache ());
}
~diagnostic_manager ()
@@ -503,11 +502,11 @@ public:
return (*iter).second.get ();
std::unique_ptr<diagnostic_logical_location> logical_loc
- = ::make_unique<diagnostic_logical_location> (kind,
- parent,
- short_name,
- fully_qualified_name,
- decorated_name);
+ = std::make_unique<diagnostic_logical_location> (kind,
+ parent,
+ short_name,
+ fully_qualified_name,
+ decorated_name);
const diagnostic_logical_location *result = logical_loc.get ();
m_logical_locs.insert
(logical_locs_map_t::value_type (std::move (key),
@@ -785,11 +784,12 @@ struct diagnostic_execution_path : public diagnostic_path
const char *gmsgid,
va_list *args)
{
- m_events.push_back (::make_unique<libgdiagnostics_path_event> (physical_loc,
- logical_loc,
- stack_depth,
- gmsgid,
- args));
+ m_events.push_back
+ (std::make_unique<libgdiagnostics_path_event> (physical_loc,
+ logical_loc,
+ stack_depth,
+ gmsgid,
+ args));
return m_events.size () - 1;
}
@@ -860,7 +860,7 @@ public:
void add_rule (const char *title,
const char *url)
{
- std::unique_ptr<impl_rule> rule = ::make_unique<impl_rule> (title, url);
+ std::unique_ptr<impl_rule> rule = std::make_unique<impl_rule> (title, url);
m_metadata.add_rule (*rule.get ());
m_rules.push_back (std::move (rule));
}
@@ -882,7 +882,7 @@ public:
const char *text)
{
std::unique_ptr<range_label> label
- = ::make_unique <impl_range_label> (text);
+ = std::make_unique <impl_range_label> (text);
m_rich_loc.add_range (as_location_t (loc),
SHOW_RANGE_WITHOUT_CARET,
label.get ());
@@ -902,7 +902,7 @@ public:
diagnostic_execution_path *
add_execution_path ()
{
- m_path = ::make_unique<diagnostic_execution_path> ();
+ m_path = std::make_unique<diagnostic_execution_path> ();
m_rich_loc.set_path (m_path.get ());
return m_path.get ();
}
@@ -946,7 +946,7 @@ diagnostic_t_from_diagnostic_level (enum diagnostic_level level)
void
diagnostic_file::set_buffered_content (const char *buf, size_t sz)
{
- m_content = ::make_unique<content_buffer> (buf, sz);
+ m_content = std::make_unique<content_buffer> (buf, sz);
// Populate file_cache:
file_cache &fc = m_mgr.get_dc ().get_file_cache ();
@@ -1004,8 +1004,8 @@ diagnostic_text_sink::diagnostic_text_sink (diagnostic_manager &mgr,
m_source_printing (mgr.get_dc ().m_source_printing)
{
auto inner_sink
- = ::make_unique<diagnostic_text_output_format> (mgr.get_dc (),
- &m_source_printing);
+ = std::make_unique<diagnostic_text_output_format> (mgr.get_dc (),
+ &m_source_printing);
inner_sink->get_printer ()->set_output_stream (dst_stream);
m_inner_sink = inner_sink.get ();
set_colorize (colorize);
@@ -1287,10 +1287,10 @@ diagnostic_manager_add_sarif_sink (diagnostic_manager *diag_mgr,
break;
}
- diag_mgr->add_sink (make_unique<sarif_sink> (*diag_mgr,
- dst_stream,
- main_input_file,
- sarif_gen_opts));
+ diag_mgr->add_sink (std::make_unique<sarif_sink> (*diag_mgr,
+ dst_stream,
+ main_input_file,
+ sarif_gen_opts));
}
/* Public entrypoint. */
diff --git a/gcc/libsarifreplay.cc b/gcc/libsarifreplay.cc
index ce42bda..f5f1f20 100644
--- a/gcc/libsarifreplay.cc
+++ b/gcc/libsarifreplay.cc
@@ -25,7 +25,6 @@ along with GCC; see the file COPYING3. If not see
#define INCLUDE_STRING
#include "system.h"
#include "coretypes.h"
-#include "make-unique.h"
#include "libgdiagnostics++.h"
#include "json-parsing.h"
#include "intl.h"
@@ -51,7 +50,7 @@ read_file (const char *path, libgdiagnostics::manager &mgr)
}
/* Read content, allocating a buffer for it. */
- auto result = ::make_unique<std::vector<char>> ();
+ auto result = std::make_unique<std::vector<char>> ();
char buf[4096];
size_t iter_sz_in;
@@ -1350,7 +1349,7 @@ maybe_consume_embedded_link (const char *&iter_src)
}
iter_src = iter;
- return ::make_unique<embedded_link> (std::move (result));
+ return std::make_unique<embedded_link> (std::move (result));
}
/* Lookup the plain text string within a result.message (ยง3.27.11),
diff --git a/gcc/lto-wrapper.cc b/gcc/lto-wrapper.cc
index a980b20..27405e8 100644
--- a/gcc/lto-wrapper.cc
+++ b/gcc/lto-wrapper.cc
@@ -55,7 +55,6 @@ along with GCC; see the file COPYING3. If not see
#include "opts-diagnostic.h"
#include "opt-suggestions.h"
#include "opts-jobserver.h"
-#include "make-unique.h"
#include "lto-ltrans-cache.h"
/* Environment variable, used for passing the names of offload targets from GCC
diff --git a/gcc/make-unique.h b/gcc/make-unique.h
deleted file mode 100644
index 6f5aeee..0000000
--- a/gcc/make-unique.h
+++ /dev/null
@@ -1,35 +0,0 @@
-/* Minimal implementation of make_unique for C++11 compatibility.
- Copyright (C) 2022-2025 Free Software Foundation, Inc.
-
-This file is part of GCC.
-
-GCC is free software; you can redistribute it and/or modify it under
-the terms of the GNU General Public License as published by the Free
-Software Foundation; either version 3, or (at your option) any later
-version.
-
-GCC is distributed in the hope that it will be useful, but WITHOUT ANY
-WARRANTY; without even the implied warranty of MERCHANTABILITY or
-FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-for more details.
-
-You should have received a copy of the GNU General Public License
-along with GCC; see the file COPYING3. If not see
-<http://www.gnu.org/licenses/>. */
-
-#ifndef GCC_MAKE_UNIQUE
-#define GCC_MAKE_UNIQUE
-
-#include <type_traits>
-
-/* Minimal implementation of make_unique for C++11 compatibility
- (std::make_unique is C++14). */
-
-template<typename T, typename... Args>
-inline typename std::enable_if<!std::is_array<T>::value, std::unique_ptr<T>>::type
-make_unique(Args&&... args)
-{
- return std::unique_ptr<T> (new T (std::forward<Args> (args)...));
-}
-
-#endif /* ! GCC_MAKE_UNIQUE */
diff --git a/gcc/opts-diagnostic.cc b/gcc/opts-diagnostic.cc
index 4267db5..b51c8a8 100644
--- a/gcc/opts-diagnostic.cc
+++ b/gcc/opts-diagnostic.cc
@@ -39,7 +39,6 @@ along with GCC; see the file COPYING3. If not see
#include "pretty-print-markup.h"
#include "opts.h"
#include "options.h"
-#include "make-unique.h"
/* A namespace for handling the DSL of the arguments of
-fdiagnostics-add-output= and -fdiagnostics-set-output=. */
@@ -308,7 +307,7 @@ parse (const context &ctxt, const char *unparsed_arg)
}
else
result.m_scheme_name = unparsed_arg;
- return ::make_unique<scheme_name_and_params> (std::move (result));
+ return std::make_unique<scheme_name_and_params> (std::move (result));
}
/* class output_factory::scheme_handler. */
@@ -317,8 +316,8 @@ parse (const context &ctxt, const char *unparsed_arg)
output_factory::output_factory ()
{
- m_scheme_handlers.push_back (::make_unique<text_scheme_handler> ());
- m_scheme_handlers.push_back (::make_unique<sarif_scheme_handler> ());
+ m_scheme_handlers.push_back (std::make_unique<text_scheme_handler> ());
+ m_scheme_handlers.push_back (std::make_unique<sarif_scheme_handler> ());
}
const output_factory::scheme_handler *
@@ -405,7 +404,7 @@ text_scheme_handler::make_sink (const context &ctxt,
return nullptr;
}
- auto sink = ::make_unique<diagnostic_text_output_format> (ctxt.m_dc);
+ auto sink = std::make_unique<diagnostic_text_output_format> (ctxt.m_dc);
sink->set_show_nesting (show_nesting);
sink->set_show_locations_in_nesting (show_locations_in_nesting);
sink->set_show_nesting_levels (show_levels);
diff --git a/gcc/pretty-print.cc b/gcc/pretty-print.cc
index abd6c0b..1f38702 100644
--- a/gcc/pretty-print.cc
+++ b/gcc/pretty-print.cc
@@ -30,7 +30,6 @@ along with GCC; see the file COPYING3. If not see
#include "diagnostic-color.h"
#include "diagnostic-event-id.h"
#include "diagnostic-highlight-colors.h"
-#include "make-unique.h"
#include "selftest.h"
#if HAVE_ICONV
@@ -2521,7 +2520,7 @@ pretty_printer::~pretty_printer ()
std::unique_ptr<pretty_printer>
pretty_printer::clone () const
{
- return ::make_unique<pretty_printer> (*this);
+ return std::make_unique<pretty_printer> (*this);
}
/* Append a string delimited by START and END to the output area of
@@ -3542,7 +3541,7 @@ test_custom_tokens_1 ()
void add_to_phase_2 (pp_markup::context &ctxt) final override
{
- auto val_ptr = make_unique<value> (*this);
+ auto val_ptr = std::make_unique<value> (*this);
ctxt.m_formatted_token_list->push_back<pp_token_custom_data>
(std::move (val_ptr));
}
@@ -3622,7 +3621,7 @@ test_custom_tokens_2 ()
void add_to_phase_2 (pp_markup::context &ctxt) final override
{
- auto val_ptr = make_unique<value> (*this);
+ auto val_ptr = std::make_unique<value> (*this);
ctxt.m_formatted_token_list->push_back<pp_token_custom_data>
(std::move (val_ptr));
}
diff --git a/gcc/testsuite/gcc.dg/plugin/analyzer_cpython_plugin.cc b/gcc/testsuite/gcc.dg/plugin/analyzer_cpython_plugin.cc
index a20d0c1..0f1f864 100644
--- a/gcc/testsuite/gcc.dg/plugin/analyzer_cpython_plugin.cc
+++ b/gcc/testsuite/gcc.dg/plugin/analyzer_cpython_plugin.cc
@@ -46,7 +46,6 @@
#include "analyzer/call-details.h"
#include "analyzer/call-info.h"
#include "analyzer/exploded-graph.h"
-#include "make-unique.h"
int plugin_is_GPL_compatible;
@@ -207,7 +206,7 @@ public:
std::unique_ptr<stmt_finder>
clone () const final override
{
- return make_unique<refcnt_stmt_finder> (m_eg, m_var);
+ return std::make_unique<refcnt_stmt_finder> (m_eg, m_var);
}
const gimple *
@@ -451,8 +450,9 @@ check_refcnt (const region_model *model,
const auto &eg = ctxt->get_eg ();
refcnt_stmt_finder finder (*eg, reg_tree);
- auto pd = make_unique<refcnt_mismatch> (curr_region, ob_refcnt_sval,
- actual_refcnt_sval, reg_tree);
+ auto pd = std::make_unique<refcnt_mismatch> (curr_region, ob_refcnt_sval,
+ actual_refcnt_sval,
+ reg_tree);
if (pd && eg)
ctxt->warn (std::move (pd), &finder);
}
@@ -943,9 +943,9 @@ kf_PyList_Append::impl_call_post (const call_details &cd) const
/* Body of kf_PyList_Append::impl_call_post. */
if (cd.get_ctxt ())
{
- cd.get_ctxt ()->bifurcate (make_unique<realloc_failure> (cd));
- cd.get_ctxt ()->bifurcate (make_unique<realloc_success_no_move> (cd));
- cd.get_ctxt ()->bifurcate (make_unique<realloc_success_move> (cd));
+ cd.get_ctxt ()->bifurcate (std::make_unique<realloc_failure> (cd));
+ cd.get_ctxt ()->bifurcate (std::make_unique<realloc_success_no_move> (cd));
+ cd.get_ctxt ()->bifurcate (std::make_unique<realloc_success_move> (cd));
cd.get_ctxt ()->terminate_path ();
}
}
@@ -1078,8 +1078,8 @@ kf_PyList_New::impl_call_post (const call_details &cd) const
if (cd.get_ctxt ())
{
- cd.get_ctxt ()->bifurcate (make_unique<pyobj_init_fail> (cd));
- cd.get_ctxt ()->bifurcate (make_unique<success> (cd));
+ cd.get_ctxt ()->bifurcate (std::make_unique<pyobj_init_fail> (cd));
+ cd.get_ctxt ()->bifurcate (std::make_unique<success> (cd));
cd.get_ctxt ()->terminate_path ();
}
}
@@ -1147,8 +1147,8 @@ kf_PyLong_FromLong::impl_call_post (const call_details &cd) const
if (cd.get_ctxt ())
{
- cd.get_ctxt ()->bifurcate (make_unique<pyobj_init_fail> (cd));
- cd.get_ctxt ()->bifurcate (make_unique<success> (cd));
+ cd.get_ctxt ()->bifurcate (std::make_unique<pyobj_init_fail> (cd));
+ cd.get_ctxt ()->bifurcate (std::make_unique<success> (cd));
cd.get_ctxt ()->terminate_path ();
}
}
@@ -1290,14 +1290,14 @@ cpython_analyzer_init_cb (void *gcc_data, void * /*user_data */)
}
iface->register_known_function ("PyList_Append",
- make_unique<kf_PyList_Append> ());
- iface->register_known_function ("PyList_New", make_unique<kf_PyList_New> ());
+ std::make_unique<kf_PyList_Append> ());
+ iface->register_known_function ("PyList_New", std::make_unique<kf_PyList_New> ());
iface->register_known_function ("PyLong_FromLong",
- make_unique<kf_PyLong_FromLong> ());
+ std::make_unique<kf_PyLong_FromLong> ());
iface->register_known_function (
"__analyzer_cpython_dump_refcounts",
- make_unique<kf_analyzer_cpython_dump_refcounts> ());
+ std::make_unique<kf_analyzer_cpython_dump_refcounts> ());
}
} // namespace ana
diff --git a/gcc/testsuite/gcc.dg/plugin/analyzer_gil_plugin.cc b/gcc/testsuite/gcc.dg/plugin/analyzer_gil_plugin.cc
index b410f8b..3cac3f8f 100644
--- a/gcc/testsuite/gcc.dg/plugin/analyzer_gil_plugin.cc
+++ b/gcc/testsuite/gcc.dg/plugin/analyzer_gil_plugin.cc
@@ -10,7 +10,6 @@
#include "config.h"
#include "system.h"
#include "coretypes.h"
-#include "make-unique.h"
#include "diagnostic.h"
#include "tree.h"
#include "gimple.h"
@@ -325,9 +324,9 @@ gil_state_machine::check_for_pyobject_in_call (sm_context &sm_ctxt,
if (type_based_on_pyobject_p (type))
{
sm_ctxt.warn (node, &call, NULL_TREE,
- make_unique<fncall_without_gil> (*this, call,
- callee_fndecl,
- i));
+ std::make_unique<fncall_without_gil> (*this, call,
+ callee_fndecl,
+ i));
sm_ctxt.set_global_state (m_stop);
}
}
@@ -354,7 +353,7 @@ gil_state_machine::on_stmt (sm_context &sm_ctxt,
if (global_state == m_released_gil)
{
sm_ctxt.warn (node, stmt, NULL_TREE,
- make_unique<double_save_thread> (*this, call));
+ std::make_unique<double_save_thread> (*this, call));
sm_ctxt.set_global_state (m_stop);
}
else
@@ -410,7 +409,7 @@ gil_state_machine::check_for_pyobject_usage_without_gil (sm_context &sm_ctxt,
if (type_based_on_pyobject_p (type))
{
sm_ctxt.warn (node, stmt, NULL_TREE,
- make_unique<pyobject_usage_without_gil> (*this, op));
+ std::make_unique<pyobject_usage_without_gil> (*this, op));
sm_ctxt.set_global_state (m_stop);
}
}
@@ -426,7 +425,7 @@ gil_analyzer_init_cb (void *gcc_data, void */*user_data*/)
if (0)
inform (input_location, "got here: gil_analyzer_init_cb");
iface->register_state_machine
- (make_unique<gil_state_machine> (iface->get_logger ()));
+ (std::make_unique<gil_state_machine> (iface->get_logger ()));
}
} // namespace ana
diff --git a/gcc/testsuite/gcc.dg/plugin/analyzer_kernel_plugin.cc b/gcc/testsuite/gcc.dg/plugin/analyzer_kernel_plugin.cc
index f2aac5f..771ff75 100644
--- a/gcc/testsuite/gcc.dg/plugin/analyzer_kernel_plugin.cc
+++ b/gcc/testsuite/gcc.dg/plugin/analyzer_kernel_plugin.cc
@@ -44,7 +44,6 @@
#include "analyzer/region-model.h"
#include "analyzer/call-details.h"
#include "analyzer/call-info.h"
-#include "make-unique.h"
int plugin_is_GPL_compatible;
@@ -106,7 +105,7 @@ class copy_across_boundary_fn : public known_function
if (ctxt)
{
/* Bifurcate state, creating a "failure" out-edge. */
- ctxt->bifurcate (make_unique<copy_failure> (cd));
+ ctxt->bifurcate (std::make_unique<copy_failure> (cd));
/* The "unbifurcated" state is the "success" case. */
copy_success success (cd,
@@ -238,11 +237,13 @@ kernel_analyzer_init_cb (void *gcc_data, void */*user_data*/)
inform (input_location, "got here: kernel_analyzer_init_cb");
iface->register_known_function
("copy_from_user",
- make_unique<known_function_copy_from_user> ());
- iface->register_known_function ("copy_to_user",
- make_unique<known_function_copy_to_user> ());
- iface->register_known_function ("__check_object_size",
- make_unique<known_function___check_object_size> ());
+ std::make_unique<known_function_copy_from_user> ());
+ iface->register_known_function
+ ("copy_to_user",
+ std::make_unique<known_function_copy_to_user> ());
+ iface->register_known_function
+ ("__check_object_size",
+ std::make_unique<known_function___check_object_size> ());
}
} // namespace ana
diff --git a/gcc/testsuite/gcc.dg/plugin/analyzer_known_fns_plugin.cc b/gcc/testsuite/gcc.dg/plugin/analyzer_known_fns_plugin.cc
index 21e7b36..c7087f0 100644
--- a/gcc/testsuite/gcc.dg/plugin/analyzer_known_fns_plugin.cc
+++ b/gcc/testsuite/gcc.dg/plugin/analyzer_known_fns_plugin.cc
@@ -44,7 +44,6 @@
#include "analyzer/region-model.h"
#include "analyzer/call-details.h"
#include "analyzer/call-info.h"
-#include "make-unique.h"
int plugin_is_GPL_compatible;
@@ -168,7 +167,7 @@ public:
if (cd.get_ctxt ())
{
/* Bifurcate state, creating a "failure" out-edge. */
- cd.get_ctxt ()->bifurcate (make_unique<copy_failure> (cd));
+ cd.get_ctxt ()->bifurcate (std::make_unique<copy_failure> (cd));
/* The "unbifurcated" state is the "success" case. */
copy_success success (cd,
@@ -189,11 +188,12 @@ known_fn_analyzer_init_cb (void *gcc_data, void */*user_data*/)
LOG_SCOPE (iface->get_logger ());
if (0)
inform (input_location, "got here: known_fn_analyzer_init_cb");
- iface->register_known_function ("returns_42",
- make_unique<known_function_returns_42> ());
+ iface->register_known_function
+ ("returns_42",
+ std::make_unique<known_function_returns_42> ());
iface->register_known_function
("attempt_to_copy",
- make_unique<known_function_attempt_to_copy> ());
+ std::make_unique<known_function_attempt_to_copy> ());
}
} // namespace ana
diff --git a/gcc/testsuite/gcc.dg/plugin/diagnostic_group_plugin.cc b/gcc/testsuite/gcc.dg/plugin/diagnostic_group_plugin.cc
index 7e6d7e1..5ec3418 100644
--- a/gcc/testsuite/gcc.dg/plugin/diagnostic_group_plugin.cc
+++ b/gcc/testsuite/gcc.dg/plugin/diagnostic_group_plugin.cc
@@ -29,7 +29,6 @@
#include "diagnostic.h"
#include "diagnostic-format-text.h"
#include "context.h"
-#include "make-unique.h"
int plugin_is_GPL_compatible;
@@ -230,7 +229,8 @@ plugin_init (struct plugin_name_args *plugin_info,
diagnostic_text_starter (global_dc) = test_diagnostic_text_starter;
diagnostic_start_span (global_dc) = test_diagnostic_start_span_fn;
- global_dc->set_output_format (::make_unique<test_output_format> (*global_dc));
+ global_dc->set_output_format
+ (::std::make_unique<test_output_format> (*global_dc));
pass_info.pass = new pass_test_groups (g);
pass_info.reference_pass_name = "*warn_function_noreturn";
diff --git a/gcc/testsuite/gcc.dg/plugin/diagnostic_plugin_xhtml_format.cc b/gcc/testsuite/gcc.dg/plugin/diagnostic_plugin_xhtml_format.cc
index 2ce267c..24c6f8c 100644
--- a/gcc/testsuite/gcc.dg/plugin/diagnostic_plugin_xhtml_format.cc
+++ b/gcc/testsuite/gcc.dg/plugin/diagnostic_plugin_xhtml_format.cc
@@ -39,7 +39,6 @@ along with GCC; see the file COPYING3. If not see
#include "diagnostic-buffer.h"
#include "ordered-hash-map.h"
#include "sbitmap.h"
-#include "make-unique.h"
#include "selftest.h"
#include "selftest-diagnostic.h"
#include "selftest-diagnostic-show-locus.h"
@@ -179,7 +178,7 @@ void
node_with_children::add_text (label_text str)
{
gcc_assert (str.get ());
- add_child (::make_unique <text> (std::move (str)));
+ add_child (std::make_unique <text> (std::move (str)));
}
@@ -338,7 +337,7 @@ private:
static std::unique_ptr<xml::element>
make_div (label_text class_)
{
- auto div = ::make_unique<xml::element> ("div", false);
+ auto div = std::make_unique<xml::element> ("div", false);
div->set_attr ("class", std::move (class_));
return div;
}
@@ -346,7 +345,7 @@ make_div (label_text class_)
static std::unique_ptr<xml::element>
make_span (label_text class_)
{
- auto span = ::make_unique<xml::element> ("span", true);
+ auto span = std::make_unique<xml::element> ("span", true);
span->set_attr ("class", std::move (class_));
return span;
}
@@ -410,24 +409,24 @@ xhtml_builder::xhtml_builder (diagnostic_context &context,
{
gcc_assert (m_line_maps);
- m_document = ::make_unique<xml::document> ();
+ m_document = std::make_unique<xml::document> ();
{
- auto html_element = ::make_unique<xml::element> ("html", false);
+ auto html_element = std::make_unique<xml::element> ("html", false);
html_element->set_attr
("xmlns",
label_text::borrow ("http://www.w3.org/1999/xhtml"));
{
{
- auto head_element = ::make_unique<xml::element> ("head", false);
+ auto head_element = std::make_unique<xml::element> ("head", false);
{
- auto title_element = ::make_unique<xml::element> ("title", true);
+ auto title_element = std::make_unique<xml::element> ("title", true);
label_text title (label_text::borrow ("Title goes here")); // TODO
title_element->add_text (std::move (title));
head_element->add_child (std::move (title_element));
}
html_element->add_child (std::move (head_element));
- auto body_element = ::make_unique<xml::element> ("body", false);
+ auto body_element = std::make_unique<xml::element> ("body", false);
{
auto diagnostics_element
= make_div (label_text::borrow ("gcc-diagnostic-list"));
@@ -531,7 +530,7 @@ xhtml_builder::make_element_for_diagnostic (const diagnostic_info &diagnostic,
case pp_token::kind::begin_url:
{
pp_token_begin_url *sub = as_a <pp_token_begin_url *> (iter);
- auto anchor = ::make_unique<xml::element> ("a", true);
+ auto anchor = std::make_unique<xml::element> ("a", true);
anchor->set_attr ("href", std::move (sub->m_value));
push_element (std::move (anchor));
}
@@ -585,7 +584,7 @@ xhtml_builder::make_element_for_diagnostic (const diagnostic_info &diagnostic,
auto cwe_span = make_span (label_text::borrow ("gcc-cwe-metadata"));
cwe_span->add_text (label_text::borrow ("["));
{
- auto anchor = ::make_unique<xml::element> ("a", true);
+ auto anchor = std::make_unique<xml::element> ("a", true);
anchor->set_attr ("href", label_text::take (get_cwe_url (cwe)));
pretty_printer pp;
pp_printf (&pp, "CWE-%i", cwe);
@@ -614,7 +613,7 @@ xhtml_builder::make_element_for_diagnostic (const diagnostic_info &diagnostic,
{
if (option_url.get ())
{
- auto anchor = ::make_unique<xml::element> ("a", true);
+ auto anchor = std::make_unique<xml::element> ("a", true);
anchor->set_attr ("href", std::move (option_url));
anchor->add_text (std::move (option_text));
option_span->add_child (std::move (anchor));
@@ -627,7 +626,7 @@ xhtml_builder::make_element_for_diagnostic (const diagnostic_info &diagnostic,
}
{
- auto pre = ::make_unique<xml::element> ("pre", true);
+ auto pre = std::make_unique<xml::element> ("pre", true);
pre->set_attr ("class", label_text::borrow ("gcc-annotated-source"));
// TODO: ideally we'd like to capture elements within the following:
diagnostic_show_locus (&m_context, m_context.m_source_printing,
@@ -698,7 +697,7 @@ public:
std::unique_ptr<diagnostic_per_format_buffer>
make_per_format_buffer () final override
{
- return ::make_unique<diagnostic_xhtml_format_buffer> (m_builder);
+ return std::make_unique<diagnostic_xhtml_format_buffer> (m_builder);
}
void set_buffer (diagnostic_per_format_buffer *base_buffer) final override
{
@@ -844,9 +843,9 @@ diagnostic_output_format_init_xhtml_stderr (diagnostic_context &context,
const line_maps *line_maps)
{
gcc_assert (line_maps);
- auto format = ::make_unique<xhtml_stream_output_format> (context,
- line_maps,
- stderr);
+ auto format = std::make_unique<xhtml_stream_output_format> (context,
+ line_maps,
+ stderr);
diagnostic_output_format_init_xhtml (context, std::move (format));
}
@@ -859,9 +858,9 @@ diagnostic_output_format_init_xhtml_file (diagnostic_context &context,
const char *base_file_name)
{
gcc_assert (line_maps);
- auto format = ::make_unique<xhtml_file_output_format> (context,
- line_maps,
- base_file_name);
+ auto format = std::make_unique<xhtml_file_output_format> (context,
+ line_maps,
+ base_file_name);
diagnostic_output_format_init_xhtml (context, std::move (format));
}
@@ -878,8 +877,8 @@ class test_xhtml_diagnostic_context : public test_diagnostic_context
public:
test_xhtml_diagnostic_context ()
{
- auto format = ::make_unique<xhtml_buffered_output_format> (*this,
- line_table);
+ auto format = std::make_unique<xhtml_buffered_output_format> (*this,
+ line_table);
m_format = format.get (); // borrowed
diagnostic_output_format_init_xhtml (*this, std::move (format));
}
@@ -974,9 +973,9 @@ plugin_init (struct plugin_name_args *plugin_info,
return 1;
global_dc->set_output_format
- (::make_unique<xhtml_stream_output_format> (*global_dc,
- line_table,
- stderr));
+ (std::make_unique<xhtml_stream_output_format> (*global_dc,
+ line_table,
+ stderr));
#if CHECKING_P
selftest::xhtml_format_selftests ();
diff --git a/gcc/text-art/style.cc b/gcc/text-art/style.cc
index 1793405..ffc75b6 100644
--- a/gcc/text-art/style.cc
+++ b/gcc/text-art/style.cc
@@ -23,7 +23,6 @@ along with GCC; see the file COPYING3. If not see
#define INCLUDE_VECTOR
#include "system.h"
#include "coretypes.h"
-#include "make-unique.h"
#include "pretty-print.h"
#include "intl.h"
#include "selftest.h"
diff --git a/gcc/text-art/styled-string.cc b/gcc/text-art/styled-string.cc
index e13278b..3b7145f 100644
--- a/gcc/text-art/styled-string.cc
+++ b/gcc/text-art/styled-string.cc
@@ -22,7 +22,6 @@ along with GCC; see the file COPYING3. If not see
#define INCLUDE_VECTOR
#include "system.h"
#include "coretypes.h"
-#include "make-unique.h"
#include "pretty-print.h"
#include "intl.h"
#include "diagnostic.h"
diff --git a/gcc/text-art/table.cc b/gcc/text-art/table.cc
index 4b73bff..d3ddae0 100644
--- a/gcc/text-art/table.cc
+++ b/gcc/text-art/table.cc
@@ -22,7 +22,6 @@ along with GCC; see the file COPYING3. If not see
#define INCLUDE_VECTOR
#include "system.h"
#include "coretypes.h"
-#include "make-unique.h"
#include "pretty-print.h"
#include "diagnostic.h"
#include "selftest.h"
diff --git a/gcc/text-art/tree-widget.cc b/gcc/text-art/tree-widget.cc
index 597374f..33c918d 100644
--- a/gcc/text-art/tree-widget.cc
+++ b/gcc/text-art/tree-widget.cc
@@ -24,7 +24,6 @@ along with GCC; see the file COPYING3. If not see
#include "coretypes.h"
#include "pretty-print.h"
#include "selftest.h"
-#include "make-unique.h"
#include "text-art/selftests.h"
#include "text-art/tree-widget.h"
#include "text-art/dump-widget-info.h"
@@ -38,8 +37,8 @@ static const int margin_width = 3;
std::unique_ptr<tree_widget>
tree_widget::make (styled_string str, const theme &theme, style::id_t style_id)
{
- return ::make_unique <tree_widget>
- (::make_unique <text_widget> (std::move (str)),
+ return std::make_unique <tree_widget>
+ (std::make_unique <text_widget> (std::move (str)),
theme,
style_id);
}
diff --git a/gcc/text-art/widget.cc b/gcc/text-art/widget.cc
index d980b53..3c68018 100644
--- a/gcc/text-art/widget.cc
+++ b/gcc/text-art/widget.cc
@@ -24,7 +24,6 @@ along with GCC; see the file COPYING3. If not see
#include "coretypes.h"
#include "pretty-print.h"
#include "selftest.h"
-#include "make-unique.h"
#include "text-art/selftests.h"
#include "text-art/widget.h"
@@ -191,7 +190,7 @@ static void
test_wrapper_widget ()
{
style_manager sm;
- wrapper_widget w (::make_unique<test_widget> (canvas::size_t (3, 3), 'B'));
+ wrapper_widget w (std::make_unique<test_widget> (canvas::size_t (3, 3), 'B'));
canvas c (w.to_canvas (sm));
ASSERT_CANVAS_STREQ
(c, false,
@@ -207,7 +206,7 @@ test_vbox_1 ()
vbox_widget w;
for (int i = 0; i < 5; i++)
w.add_child
- (::make_unique <text_widget>
+ (std::make_unique <text_widget>
(styled_string::from_fmt (sm, nullptr,
"this is line %i", i)));
canvas c (w.to_canvas (sm));
@@ -225,9 +224,9 @@ test_vbox_2 ()
{
style_manager sm;
vbox_widget w;
- w.add_child (::make_unique<test_widget> (canvas::size_t (1, 3), 'A'));
- w.add_child (::make_unique<test_widget> (canvas::size_t (4, 1), 'B'));
- w.add_child (::make_unique<test_widget> (canvas::size_t (1, 2), 'C'));
+ w.add_child (std::make_unique<test_widget> (canvas::size_t (1, 3), 'A'));
+ w.add_child (std::make_unique<test_widget> (canvas::size_t (4, 1), 'B'));
+ w.add_child (std::make_unique<test_widget> (canvas::size_t (1, 2), 'C'));
canvas c (w.to_canvas (sm));
ASSERT_CANVAS_STREQ
(c, false,
diff --git a/gcc/timevar.cc b/gcc/timevar.cc
index 2e11be9..16ae5c8 100644
--- a/gcc/timevar.cc
+++ b/gcc/timevar.cc
@@ -24,7 +24,6 @@ along with GCC; see the file COPYING3. If not see
#include "timevar.h"
#include "options.h"
#include "json.h"
-#include "make-unique.h"
/* Non-NULL if timevars should be used. In GCC, this happens with
the -ftime-report flag. */
@@ -139,7 +138,7 @@ timer::named_items::print (FILE *fp, const timevar_time_def *total)
std::unique_ptr<json::value>
timer::named_items::make_json () const
{
- auto arr = ::make_unique<json::array> ();
+ auto arr = std::make_unique<json::array> ();
for (const char *item_name : m_names)
{
hash_map_t &mut_map = const_cast <hash_map_t &> (m_hash_map);
@@ -703,7 +702,7 @@ timer::print (FILE *fp)
std::unique_ptr<json::object>
make_json_for_timevar_time_def (const timevar_time_def &ttd)
{
- auto obj = ::make_unique<json::object> ();
+ auto obj = std::make_unique<json::object> ();
obj->set_float ("wall", nanosec_to_floating_sec (ttd.wall));
obj->set_integer ("ggc_mem", ttd.ggc_mem);
return obj;
@@ -717,7 +716,7 @@ make_json_for_timevar_time_def (const timevar_time_def &ttd)
std::unique_ptr<json::value>
timer::timevar_def::make_json () const
{
- auto timevar_obj = ::make_unique<json::object> ();
+ auto timevar_obj = std::make_unique<json::object> ();
timevar_obj->set_string ("name", name);
timevar_obj->set ("elapsed", make_json_for_timevar_time_def (elapsed));
@@ -732,14 +731,14 @@ timer::timevar_def::make_json () const
}
if (any_children_with_time)
{
- auto children_arr = ::make_unique<json::array> ();
+ auto children_arr = std::make_unique<json::array> ();
for (auto i : *children)
{
/* Don't emit timing variables if we're going to get a row of
zeroes. */
if (all_zero (i.second))
continue;
- auto child_obj = ::make_unique<json::object> ();
+ auto child_obj = std::make_unique<json::object> ();
child_obj->set_string ("name", i.first->name);
child_obj->set ("elapsed",
make_json_for_timevar_time_def (i.second));
@@ -759,7 +758,7 @@ std::unique_ptr<json::value>
timer::make_json () const
{
#if defined (HAVE_WALL_TIME)
- auto report_obj = ::make_unique<json::object> ();
+ auto report_obj = std::make_unique<json::object> ();
json::array *json_arr = new json::array ();
report_obj->set ("timevars", json_arr);
@@ -803,7 +802,7 @@ timer::make_json () const
get_time (&total_now);
timevar_diff (&total_elapsed, m_timevars[TV_TOTAL].start_time, total_now);
- auto total_obj = ::make_unique<json::object> ();
+ auto total_obj = std::make_unique<json::object> ();
total_obj->set_string ("name", "TOTAL");
total_obj->set ("elapsed", make_json_for_timevar_time_def (total_elapsed));
json_arr->append (std::move (total_obj));
diff --git a/gcc/toplev.cc b/gcc/toplev.cc
index 6d8b885..7e457b5 100644
--- a/gcc/toplev.cc
+++ b/gcc/toplev.cc
@@ -94,7 +94,6 @@ along with GCC; see the file COPYING3. If not see
#include "dbgcnt.h"
#include "gcc-urlifier.h"
#include "unique-argv.h"
-#include "make-unique.h"
#include "selftest.h"
@@ -1095,9 +1094,9 @@ general_init (const char *argv0, bool init_signals, unique_argv original_argv)
global_dc->m_internal_error = internal_error_function;
const unsigned lang_mask = lang_hooks.option_lang_mask ();
global_dc->set_option_manager
- (::make_unique<compiler_diagnostic_option_manager> (*global_dc,
- lang_mask,
- &global_options),
+ (std::make_unique<compiler_diagnostic_option_manager> (*global_dc,
+ lang_mask,
+ &global_options),
lang_mask);
global_dc->push_owned_urlifier (make_gcc_urlifier (lang_mask));
diff --git a/gcc/tree-diagnostic-client-data-hooks.cc b/gcc/tree-diagnostic-client-data-hooks.cc
index 80717c1..11701f5 100644
--- a/gcc/tree-diagnostic-client-data-hooks.cc
+++ b/gcc/tree-diagnostic-client-data-hooks.cc
@@ -31,7 +31,6 @@ along with GCC; see the file COPYING3. If not see
#include "langhooks.h"
#include "plugin.h"
#include "timevar.h"
-#include "make-unique.h"
/* Concrete class for supplying a diagnostic_context with information
about a specific plugin within the client, when the client is the
@@ -169,5 +168,5 @@ private:
std::unique_ptr<diagnostic_client_data_hooks>
make_compiler_data_hooks ()
{
- return ::make_unique<compiler_data_hooks> ();
+ return std::make_unique<compiler_data_hooks> ();
}