From dfaa3c47cc0a5e858ff45e0f2ab4d686048f718e Mon Sep 17 00:00:00 2001 From: Jonathan Wakely Date: Tue, 24 Jul 2018 22:09:55 +0100 Subject: Add initial version of C++17 header This is missing the synchronized_pool_resource and unsynchronized_pool_resource classes but is otherwise complete. This is a new implementation, not based on the existing code in , but memory_resource and polymorphic_allocator ended up looking almost the same anyway. The constant_init kluge in src/c++17/memory_resource.cc is apparently due to Richard Smith and ensures that the objects are constructed during constant initialiation phase and not destroyed (because the constant_init destructor doesn't destroy the union member and the storage is not reused). * config/abi/pre/gnu.ver: Export new symbols. * configure: Regenerate. * include/Makefile.am: Add new header. * include/Makefile.in: Regenerate. * include/precompiled/stdc++.h: Include for C++17. * include/std/memory_resource: New header. (memory_resource, polymorphic_allocator, new_delete_resource) (null_memory_resource, set_default_resource, get_default_resource) (pool_options, monotonic_buffer_resource): Define. * src/Makefile.am: Add c++17 directory. * src/Makefile.in: Regenerate. * src/c++11/Makefile.am: Fix comment. * src/c++17/Makefile.am: Add makefile for new sub-directory. * src/c++17/Makefile.in: Generate. * src/c++17/memory_resource.cc: New. (newdel_res_t, null_res_t, constant_init, newdel_res, null_res) (default_res, new_delete_resource, null_memory_resource) (set_default_resource, get_default_resource): Define. * testsuite/20_util/memory_resource/1.cc: New test. * testsuite/20_util/memory_resource/2.cc: New test. * testsuite/20_util/monotonic_buffer_resource/1.cc: New test. * testsuite/20_util/monotonic_buffer_resource/allocate.cc: New test. * testsuite/20_util/monotonic_buffer_resource/deallocate.cc: New test. * testsuite/20_util/monotonic_buffer_resource/release.cc: New test. * testsuite/20_util/monotonic_buffer_resource/upstream_resource.cc: New test. * testsuite/20_util/polymorphic_allocator/1.cc: New test. * testsuite/20_util/polymorphic_allocator/resource.cc: New test. * testsuite/20_util/polymorphic_allocator/select.cc: New test. * testsuite/util/testsuite_allocator.h (__gnu_test::memory_resource): Define concrete memory resource for testing. (__gnu_test::default_resource_mgr): Define RAII helper for changing default resource. From-SVN: r262953 --- libstdc++-v3/src/Makefile.in | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) (limited to 'libstdc++-v3/src/Makefile.in') diff --git a/libstdc++-v3/src/Makefile.in b/libstdc++-v3/src/Makefile.in index d427ed539da..901533e528b 100644 --- a/libstdc++-v3/src/Makefile.in +++ b/libstdc++-v3/src/Makefile.in @@ -152,7 +152,7 @@ AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \ $(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS ETAGS = etags CTAGS = ctags -DIST_SUBDIRS = c++98 c++11 filesystem +DIST_SUBDIRS = c++98 c++11 c++17 filesystem ABI_TWEAKS_SRCDIR = @ABI_TWEAKS_SRCDIR@ ACLOCAL = @ACLOCAL@ ALLOCATOR_H = @ALLOCATOR_H@ @@ -379,7 +379,7 @@ WARN_CXXFLAGS = \ AM_CPPFLAGS = $(GLIBCXX_INCLUDES) $(CPPFLAGS) @ENABLE_FILESYSTEM_TS_FALSE@filesystem_dir = @ENABLE_FILESYSTEM_TS_TRUE@filesystem_dir = filesystem -SUBDIRS = c++98 c++11 $(filesystem_dir) +SUBDIRS = c++98 c++11 c++17 $(filesystem_dir) @VTV_CYGMIN_FALSE@toolexeclib_LTLIBRARIES = libstdc++.la # Cross compiler support. @@ -419,13 +419,15 @@ libstdc___la_LIBADD = \ $(GLIBCXX_LIBS) \ $(top_builddir)/libsupc++/libsupc++convenience.la \ $(top_builddir)/src/c++98/libc++98convenience.la \ - $(top_builddir)/src/c++11/libc++11convenience.la + $(top_builddir)/src/c++11/libc++11convenience.la \ + $(top_builddir)/src/c++17/libc++17convenience.la libstdc___la_DEPENDENCIES = \ ${version_dep} \ $(top_builddir)/libsupc++/libsupc++convenience.la \ $(top_builddir)/src/c++98/libc++98convenience.la \ - $(top_builddir)/src/c++11/libc++11convenience.la + $(top_builddir)/src/c++11/libc++11convenience.la \ + $(top_builddir)/src/c++17/libc++17convenience.la libstdc___la_LDFLAGS = \ -version-info $(libtool_VERSION) ${version_arg} -lm @@ -440,8 +442,8 @@ libstdc___la_LINK = $(CXXLINK) $(libstdc___la_LDFLAGS) # Thus, the shared libs have more compat symbols, which can be found # segregated in the sources with -D_GLIBCXX_SHARED. # -# In the sub-directories of libsupc++, src/c++98, src/c++11, only -# -prefer-pic objects are generated for the convenience libraries. +# In the sub-directories of libsupc++, src/c++98, src/c++11, src/c++17, +# only -prefer-pic objects are generated for the convenience libraries. # # In the main src directory, make shared and static objects just for # the compat libraries. Shared objects are compiled with -prefer-pic @@ -900,6 +902,7 @@ uninstall-am: uninstall-toolexeclibLTLIBRARIES vpath % $(top_srcdir)/src/c++98 vpath % $(top_srcdir)/src/c++11 +vpath % $(top_srcdir)/src/c++17 @ENABLE_FILESYSTEM_TS_TRUE@vpath % $(top_srcdir)/src/filesystem # Use special rules for compatibility-ldbl.cc compilation, as we need to -- cgit v1.2.3