From 99b0a02c9b9300328196ea4f66c33bc31ac5fc58 Mon Sep 17 00:00:00 2001 From: Benjamin Kosnik Date: Fri, 8 Mar 2013 21:39:24 +0000 Subject: * include/bits/memoryfwd.h: New. Centralize forward declarations. * include/bits/algorithmfwd.h: Consistent comments. * include/bits/localefwd.h: Same. * include/ext/vstring_fwd.h: Same. * include/parallel/algorithmfwd.h: Same. * include/parallel/numericfwd.h: Same. * include/std/iosfwd: Same. * include/bits/alloc_traits.h: Include memoryfwd.h, remove allocator forward decl. * include/ext/alloc_traits.h: Remove allocator forward decl. * include/bits/stl_construct.h: Same. * include/bits/stringfwd.h: Include memoryfwd.h, remove allocator forward decl. Consistent comments. * doc/doxygen/user.cfg.in (TEMPLATE_RELATIONS): To NO. * include/Makefile.am (bits_headers): Add memoryfwd.h. * include/Makefile.in: Regenerate. * configure: Same. e enter the commit message for your changes. Lines starting git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@196559 138bc75d-0d04-0410-961f-82ee72b054a4 --- libstdc++-v3/ChangeLog | 23 ++++++++ libstdc++-v3/configure | 8 +-- libstdc++-v3/doc/doxygen/user.cfg.in | 2 +- libstdc++-v3/include/Makefile.am | 1 + libstdc++-v3/include/Makefile.in | 43 +++------------ libstdc++-v3/include/bits/algorithmfwd.h | 2 +- libstdc++-v3/include/bits/alloc_traits.h | 4 +- libstdc++-v3/include/bits/allocator.h | 23 ++------ libstdc++-v3/include/bits/localefwd.h | 4 +- libstdc++-v3/include/bits/memoryfwd.h | 78 ++++++++++++++++++++++++++++ libstdc++-v3/include/bits/stl_construct.h | 4 +- libstdc++-v3/include/bits/stringfwd.h | 6 +-- libstdc++-v3/include/ext/alloc_traits.h | 9 +--- libstdc++-v3/include/ext/vstring_fwd.h | 2 +- libstdc++-v3/include/parallel/algorithmfwd.h | 2 +- libstdc++-v3/include/parallel/numericfwd.h | 2 +- libstdc++-v3/include/std/iosfwd | 2 +- 17 files changed, 132 insertions(+), 83 deletions(-) create mode 100644 libstdc++-v3/include/bits/memoryfwd.h diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index 342c6a42d62..601c4deecee 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,3 +1,26 @@ +2013-03-08 Benjamin Kosnik + + * include/bits/memoryfwd.h: New. Centralize forward declarations. + * include/bits/algorithmfwd.h: Consistent comments. + * include/bits/localefwd.h: Same. + * include/ext/vstring_fwd.h: Same. + * include/parallel/algorithmfwd.h: Same. + * include/parallel/numericfwd.h: Same. + * include/std/iosfwd: Same. + + * include/bits/alloc_traits.h: Include memoryfwd.h, remove allocator + forward decl. + * include/ext/alloc_traits.h: Remove allocator forward decl. + * include/bits/stl_construct.h: Same. + * include/bits/stringfwd.h: Include memoryfwd.h, remove allocator + forward decl. Consistent comments. + + * doc/doxygen/user.cfg.in (TEMPLATE_RELATIONS): To NO. + + * include/Makefile.am (bits_headers): Add memoryfwd.h. + * include/Makefile.in: Regenerate. + * configure: Same. + 2013-03-08 François Dumont * include/bits/vector.tcc (vector<>operator=(const vector<>&): diff --git a/libstdc++-v3/configure b/libstdc++-v3/configure index 52b828905c2..fa44bacc448 100755 --- a/libstdc++-v3/configure +++ b/libstdc++-v3/configure @@ -3530,11 +3530,11 @@ MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"} # We need awk for the "check" target. The system "awk" is bad on # some platforms. -# Always define AMTAR for backward compatibility. Yes, it's still used -# in the wild :-( We should find a proper way to deprecate it ... -AMTAR='$${TAR-tar}' +# Always define AMTAR for backward compatibility. -am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -' +AMTAR=${AMTAR-"${am_missing_run}tar"} + +am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -' diff --git a/libstdc++-v3/doc/doxygen/user.cfg.in b/libstdc++-v3/doc/doxygen/user.cfg.in index 4a3afc4de93..45efb632b87 100644 --- a/libstdc++-v3/doc/doxygen/user.cfg.in +++ b/libstdc++-v3/doc/doxygen/user.cfg.in @@ -1957,7 +1957,7 @@ UML_LIMIT_NUM_FIELDS = 10 # If set to YES, the inheritance and collaboration graphs will show the # relations between templates and their instances. -TEMPLATE_RELATIONS = YES +TEMPLATE_RELATIONS = NO # If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDE_GRAPH, and HAVE_DOT # tags are set to YES then doxygen will generate a graph for each documented diff --git a/libstdc++-v3/include/Makefile.am b/libstdc++-v3/include/Makefile.am index 53422177444..6bd3b438065 100644 --- a/libstdc++-v3/include/Makefile.am +++ b/libstdc++-v3/include/Makefile.am @@ -113,6 +113,7 @@ bits_headers = \ ${bits_srcdir}/locale_facets_nonio.tcc \ ${bits_srcdir}/localefwd.h \ ${bits_srcdir}/mask_array.h \ + ${bits_srcdir}/memoryfwd.h \ ${bits_srcdir}/move.h \ ${bits_srcdir}/ostream.tcc \ ${bits_srcdir}/ostream_insert.h \ diff --git a/libstdc++-v3/include/Makefile.in b/libstdc++-v3/include/Makefile.in index 30d90968a81..6e3c8945356 100644 --- a/libstdc++-v3/include/Makefile.in +++ b/libstdc++-v3/include/Makefile.in @@ -1,9 +1,9 @@ -# Makefile.in generated by automake 1.11.6 from Makefile.am. +# Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software -# Foundation, Inc. +# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, +# Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -15,23 +15,6 @@ @SET_MAKE@ VPATH = @srcdir@ -am__make_dryrun = \ - { \ - am__dry=no; \ - case $$MAKEFLAGS in \ - *\\[\ \ ]*) \ - echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \ - | grep '^AM OK$$' >/dev/null || am__dry=yes;; \ - *) \ - for am__flg in $$MAKEFLAGS; do \ - case $$am__flg in \ - *=*|--*) ;; \ - *n*) am__dry=yes; break;; \ - esac; \ - done;; \ - esac; \ - test $$am__dry = yes; \ - } pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ @@ -84,11 +67,6 @@ CONFIG_CLEAN_VPATH_FILES = depcomp = am__depfiles_maybe = SOURCES = -am__can_run_installinfo = \ - case $$AM_UPDATE_INFO_DIR in \ - n|no|NO) false;; \ - *) (install-info --version) >/dev/null 2>&1;; \ - esac ABI_TWEAKS_SRCDIR = @ABI_TWEAKS_SRCDIR@ ACLOCAL = @ACLOCAL@ ALLOCATOR_H = @ALLOCATOR_H@ @@ -397,6 +375,7 @@ bits_headers = \ ${bits_srcdir}/locale_facets_nonio.tcc \ ${bits_srcdir}/localefwd.h \ ${bits_srcdir}/mask_array.h \ + ${bits_srcdir}/memoryfwd.h \ ${bits_srcdir}/move.h \ ${bits_srcdir}/ostream.tcc \ ${bits_srcdir}/ostream_insert.h \ @@ -1214,7 +1193,6 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; -$(top_srcdir)/fragment.am: $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh @@ -1250,15 +1228,10 @@ install-am: all-am installcheck: installcheck-am install-strip: - if test -z '$(STRIP)'; then \ - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - install; \ - else \ - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ - fi + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: diff --git a/libstdc++-v3/include/bits/algorithmfwd.h b/libstdc++-v3/include/bits/algorithmfwd.h index 7b8448ce385..e6321b2eb50 100644 --- a/libstdc++-v3/include/bits/algorithmfwd.h +++ b/libstdc++-v3/include/bits/algorithmfwd.h @@ -1,4 +1,4 @@ -// declarations -*- C++ -*- +// Forward declarations -*- C++ -*- // Copyright (C) 2007-2013 Free Software Foundation, Inc. // diff --git a/libstdc++-v3/include/bits/alloc_traits.h b/libstdc++-v3/include/bits/alloc_traits.h index 26c64f257b5..33ea145d521 100644 --- a/libstdc++-v3/include/bits/alloc_traits.h +++ b/libstdc++-v3/include/bits/alloc_traits.h @@ -32,6 +32,7 @@ #if __cplusplus >= 201103L +#include #include #include @@ -39,9 +40,6 @@ namespace std _GLIBCXX_VISIBILITY(default) { _GLIBCXX_BEGIN_NAMESPACE_VERSION - template - class allocator; - template class __alloctr_rebind_helper { diff --git a/libstdc++-v3/include/bits/allocator.h b/libstdc++-v3/include/bits/allocator.h index 97477fb7976..28df242b1bc 100644 --- a/libstdc++-v3/include/bits/allocator.h +++ b/libstdc++-v3/include/bits/allocator.h @@ -43,8 +43,8 @@ #ifndef _ALLOCATOR_H #define _ALLOCATOR_H 1 -// Define the base class to std::allocator. -#include +#include // Define the base class to std::allocator. +#include #if __cplusplus >= 201103L #include #endif @@ -54,17 +54,10 @@ namespace std _GLIBCXX_VISIBILITY(default) _GLIBCXX_BEGIN_NAMESPACE_VERSION /** - * @defgroup allocators Allocators - * @ingroup memory - * - * Classes encapsulating memory operations. - * - * @{ + * @addtogroup allocators + * @{ */ - template - class allocator; - /// allocator specialization. template<> class allocator @@ -150,13 +143,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION operator!=(const allocator<_Tp>&, const allocator<_Tp>&) { return false; } - /// Declare uses_allocator so it can be specialized in \ etc. - template - struct uses_allocator; - - /** - * @} - */ + /// @} group allocator // Inhibit implicit instantiations for required instantiations, // which are defined via explicit instantiations elsewhere. diff --git a/libstdc++-v3/include/bits/localefwd.h b/libstdc++-v3/include/bits/localefwd.h index e0a233b3e95..ca06dc11bea 100644 --- a/libstdc++-v3/include/bits/localefwd.h +++ b/libstdc++-v3/include/bits/localefwd.h @@ -1,4 +1,4 @@ -// Locale support -*- C++ -*- +// Forward declarations -*- C++ -*- // Copyright (C) 1997-2013 Free Software Foundation, Inc. // @@ -185,6 +185,6 @@ _GLIBCXX_END_NAMESPACE_LDBL class messages_byname; _GLIBCXX_END_NAMESPACE_VERSION -} // namespace +} // namespace std #endif diff --git a/libstdc++-v3/include/bits/memoryfwd.h b/libstdc++-v3/include/bits/memoryfwd.h new file mode 100644 index 00000000000..7c859705a27 --- /dev/null +++ b/libstdc++-v3/include/bits/memoryfwd.h @@ -0,0 +1,78 @@ +// Forward declarations -*- C++ -*- + +// Copyright (C) 2001-2013 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library 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. + +// This library 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. + +// Under Section 7 of GPL version 3, you are granted additional +// permissions described in the GCC Runtime Library Exception, version +// 3.1, as published by the Free Software Foundation. + +// You should have received a copy of the GNU General Public License and +// a copy of the GCC Runtime Library Exception along with this program; +// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see +// . + +/* + * Copyright (c) 1996-1997 + * Silicon Graphics Computer Systems, Inc. + * + * Permission to use, copy, modify, distribute and sell this software + * and its documentation for any purpose is hereby granted without fee, + * provided that the above copyright notice appear in all copies and + * that both that copyright notice and this permission notice appear + * in supporting documentation. Silicon Graphics makes no + * representations about the suitability of this software for any + * purpose. It is provided "as is" without express or implied warranty. + */ + +/** @file bits/memoryfwd.h + * This is an internal header file, included by other library headers. + * Do not attempt to use it directly. @headername{memory} + */ + +#ifndef _MEMORYFWD_H +#define _MEMORYFWD_H 1 + +#pragma GCC system_header + +#include + +namespace std _GLIBCXX_VISIBILITY(default) +{ +_GLIBCXX_BEGIN_NAMESPACE_VERSION + + /** + * @defgroup allocators Allocators + * @ingroup memory + * + * Classes encapsulating memory operations. + * + * @{ + */ + + template + class allocator; + + template<> + class allocator; + + /// Declare uses_allocator so it can be specialized in \ etc. + template + struct uses_allocator; + + /// @} group memory + +_GLIBCXX_END_NAMESPACE_VERSION +} // namespace std + +#endif diff --git a/libstdc++-v3/include/bits/stl_construct.h b/libstdc++-v3/include/bits/stl_construct.h index 5dd56268507..c1863e64926 100644 --- a/libstdc++-v3/include/bits/stl_construct.h +++ b/libstdc++-v3/include/bits/stl_construct.h @@ -133,8 +133,6 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION * destroy() even if _Tp has a trivial destructor. */ - template class allocator; - template void _Destroy(_ForwardIterator __first, _ForwardIterator __last, @@ -154,7 +152,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION } _GLIBCXX_END_NAMESPACE_VERSION -} // namespace +} // namespace std #endif /* _STL_CONSTRUCT_H */ diff --git a/libstdc++-v3/include/bits/stringfwd.h b/libstdc++-v3/include/bits/stringfwd.h index 5d5b83f5e96..9601116d0a0 100644 --- a/libstdc++-v3/include/bits/stringfwd.h +++ b/libstdc++-v3/include/bits/stringfwd.h @@ -1,4 +1,4 @@ -// String support -*- C++ -*- +// Forward declarations -*- C++ -*- // Copyright (C) 2001-2013 Free Software Foundation, Inc. // @@ -37,14 +37,12 @@ #pragma GCC system_header #include +#include namespace std _GLIBCXX_VISIBILITY(default) { _GLIBCXX_BEGIN_NAMESPACE_VERSION - template - class allocator; - /** * @defgroup strings Strings * diff --git a/libstdc++-v3/include/ext/alloc_traits.h b/libstdc++-v3/include/ext/alloc_traits.h index 706bfd3e5a9..333473ad87b 100644 --- a/libstdc++-v3/include/ext/alloc_traits.h +++ b/libstdc++-v3/include/ext/alloc_traits.h @@ -38,13 +38,6 @@ # include // for __alloc_swap #endif -namespace std _GLIBCXX_VISIBILITY(default) -{ -_GLIBCXX_BEGIN_NAMESPACE_VERSION - template struct allocator; -_GLIBCXX_END_NAMESPACE_VERSION -} // namespace - namespace __gnu_cxx _GLIBCXX_VISIBILITY(default) { _GLIBCXX_BEGIN_NAMESPACE_VERSION @@ -244,6 +237,6 @@ template }; _GLIBCXX_END_NAMESPACE_VERSION -} // namespace +} // namespace std #endif diff --git a/libstdc++-v3/include/ext/vstring_fwd.h b/libstdc++-v3/include/ext/vstring_fwd.h index 61bc2fecbbd..b917e93a96e 100644 --- a/libstdc++-v3/include/ext/vstring_fwd.h +++ b/libstdc++-v3/include/ext/vstring_fwd.h @@ -1,4 +1,4 @@ -// Versatile string forward -*- C++ -*- +// Forward declarations -*- C++ -*- // Copyright (C) 2005-2013 Free Software Foundation, Inc. // diff --git a/libstdc++-v3/include/parallel/algorithmfwd.h b/libstdc++-v3/include/parallel/algorithmfwd.h index 9706185447a..01a8a5a78fd 100644 --- a/libstdc++-v3/include/parallel/algorithmfwd.h +++ b/libstdc++-v3/include/parallel/algorithmfwd.h @@ -1,4 +1,4 @@ -// parallel extensions -*- C++ -*- +// Forward declarations -*- C++ -*- // Copyright (C) 2007-2013 Free Software Foundation, Inc. // diff --git a/libstdc++-v3/include/parallel/numericfwd.h b/libstdc++-v3/include/parallel/numericfwd.h index 13141690934..6b3d2f156ec 100644 --- a/libstdc++-v3/include/parallel/numericfwd.h +++ b/libstdc++-v3/include/parallel/numericfwd.h @@ -1,4 +1,4 @@ -// parallel extensions -*- C++ -*- +// Forward declarations -*- C++ -*- // Copyright (C) 2007-2013 Free Software Foundation, Inc. // diff --git a/libstdc++-v3/include/std/iosfwd b/libstdc++-v3/include/std/iosfwd index 156ed92594b..c5fe26d8bc6 100644 --- a/libstdc++-v3/include/std/iosfwd +++ b/libstdc++-v3/include/std/iosfwd @@ -1,4 +1,4 @@ -// Forwarding declarations -*- C++ -*- +// Forward declarations -*- C++ -*- // Copyright (C) 1997-2013 Free Software Foundation, Inc. // -- cgit v1.2.3