Commit Graph

3 Commits

Author SHA1 Message Date
Jakub Jelinek
85ec4feb11 Update copyright years.
From-SVN: r256169
2018-01-03 11:03:58 +01:00
David Malcolm
b367de5dc3 Add INCLUDE_UNIQUE_PTR and use it (PR bootstrap/82610)
gcc/ChangeLog:
	PR bootstrap/82610
	* system.h: Conditionally include "unique-ptr.h" if
	INCLUDE_UNIQUE_PTR is defined.
	* unique-ptr-tests.cc: Remove include of "unique-ptr.h" in favor
	of defining INCLUDE_UNIQUE_PTR before including "system.h".

include/ChangeLog:
	* unique-ptr.h: Make include of <memory> conditional on C++11 or
	later.

From-SVN: r254024
2017-10-23 20:25:58 +00:00
David Malcolm
46d2b77d71 Add gnu::unique_ptr
This is a version of the patch posted by Trevor Saunders on 2017-07-31,
for which he wrote:
> For most of the history of this see
>   https://sourceware.org/ml/gdb-patches/2016-10/msg00223.html
> The changes are mostly s/gdb/gtl/g

This version was updated by me (dmalcolm) adding these changes:
- renaming of "gtl" to "gnu" (3 letters, and one of the ones Richi
  proposed, and not a match for "*tl")
- renaming of DEFINE_GDB_UNIQUE_PTR to DEFINE_GNU_UNIQUE_PTR
- renaming of xfree_deleter to xmalloc_deleter, and making it
  use "free" rather than "xfree" (which doesn't exist)
- added a gcc/unique-ptr-tests.cc
- implement unique_xmalloc_ptr<T[]> (taken from gdb, but changing
  "xfree" to "free", and adding support for pre-C++-11)

gcc/ChangeLog:

	David Malcolm <dmalcolm@redhat.com>

	* Makefile.in (OBJS): Add unique-ptr-tests.o.
	* selftest-run-tests.c (selftest::run_tests): Call
	selftest::unique_ptr_tests_cc_tests.
	* selftest.h (selftest::unique_ptr_tests_cc_tests): New decl.
	* unique-ptr-tests.cc: New file.

include/ChangeLog:

	Trevor Saunders  <tbsaunde+gcc@tbsaunde.org>
	David Malcolm <dmalcolm@redhat.com>

	* unique-ptr.h: New file.

From-SVN: r253797
2017-10-16 20:50:40 +00:00