This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

V3 PATCH: Explicitly instantiate more stuff



This patch removes the use of -fimplicit-templates, and explicitly
instantiates a bunch more functions.

Tested on i686-pc-linux-gnu until -no-undefined yielded only symbols
from ld-linux.so.

--
Mark Mitchell                   mark@codesourcery.com
CodeSourcery, LLC               http://www.codesourcery.com

2001-02-05  Mark Mitchell  <mark@codesourcery.com>

	* include/bits/locale_facets.tcc: Remove `static' keyword on
	function definitions.
	* include/bits/std_streambuf.h: Likewise.
	* src/Makefile.am: Remove use of -fimplicit-templates.
	* src/Makefile.in: Regenerated.
	* src/locale-inst.cc: Explicitly instantiate more functions.
	* src/msic-inst.cc: Likewise.
	* src/string-inst.cc: Likewise.
	
Index: libstdc++-v3/include/bits/locale_facets.tcc
===================================================================
RCS file: /cvs/gcc/gcc/libstdc++-v3/include/bits/locale_facets.tcc,v
retrieving revision 1.6
diff -c -p -r1.6 locale_facets.tcc
*** locale_facets.tcc	2001/01/30 09:18:50	1.6
--- locale_facets.tcc	2001/02/06 05:45:21
*************** namespace std
*** 970,976 ****
  
    // Generic helper function
    template<typename _CharT, typename _OutIter>
!     static _OutIter
      _S_output_float(_OutIter __s, ios_base& __io, _CharT __fill,
                      const char* __sptr, size_t __slen)
      {
--- 970,976 ----
  
    // Generic helper function
    template<typename _CharT, typename _OutIter>
!     _OutIter
      _S_output_float(_OutIter __s, ios_base& __io, _CharT __fill,
                      const char* __sptr, size_t __slen)
      {
*************** namespace std
*** 980,986 ****
  
    // Partial specialization for ostreambuf_iterator.
    template<typename _CharT>
!     static ostreambuf_iterator<_CharT>
      _S_output_float(ostreambuf_iterator<_CharT> __s, ios_base& __io, 
  		    _CharT __fill, const char* __sptr, size_t __slen)
      {
--- 980,986 ----
  
    // Partial specialization for ostreambuf_iterator.
    template<typename _CharT>
!     ostreambuf_iterator<_CharT>
      _S_output_float(ostreambuf_iterator<_CharT> __s, ios_base& __io, 
  		    _CharT __fill, const char* __sptr, size_t __slen)
      {
Index: libstdc++-v3/include/bits/std_streambuf.h
===================================================================
RCS file: /cvs/gcc/gcc/libstdc++-v3/include/bits/std_streambuf.h,v
retrieving revision 1.3
diff -c -p -r1.3 std_streambuf.h
*** std_streambuf.h	2001/01/16 07:55:26	1.3
--- std_streambuf.h	2001/02/06 05:45:22
***************
*** 43,49 ****
  namespace std {
  
    template<typename _CharT, typename _Traits>
!     static streamsize
      _S_copy_streambufs(basic_ios<_CharT, _Traits>& _ios,
  		       basic_streambuf<_CharT, _Traits>* __sbin,
  		       basic_streambuf<_CharT, _Traits>* __sbout);
--- 43,49 ----
  namespace std {
  
    template<typename _CharT, typename _Traits>
!     streamsize
      _S_copy_streambufs(basic_ios<_CharT, _Traits>& _ios,
  		       basic_streambuf<_CharT, _Traits>* __sbin,
  		       basic_streambuf<_CharT, _Traits>* __sbout);
Index: libstdc++-v3/src/Makefile.am
===================================================================
RCS file: /cvs/gcc/gcc/libstdc++-v3/src/Makefile.am,v
retrieving revision 1.67
diff -c -p -r1.67 Makefile.am
*** Makefile.am	2001/02/03 09:01:44	1.67
--- Makefile.am	2001/02/06 05:45:23
*************** myinstallheaders: 
*** 308,320 ****
  # for things like vptrs, type_info bits, etc. when using
  # -fno-implicit-templates.
  misc-inst.o: misc-inst.cc
! 	$(CXXCOMPILE) -fimplicit-templates -c $<
  misc-inst.lo: misc-inst.cc
! 	$(LTCXXCOMPILE) -fimplicit-templates -c $<
  locale-inst.o: locale-inst.cc
! 	$(CXXCOMPILE) -fimplicit-templates -c $<
  locale-inst.lo: locale-inst.cc
! 	$(LTCXXCOMPILE) -fimplicit-templates -c $<
  
  # Use special rules for the deprecated source files so that they find
  # deprecated include files.
--- 308,320 ----
  # for things like vptrs, type_info bits, etc. when using
  # -fno-implicit-templates.
  misc-inst.o: misc-inst.cc
! 	$(CXXCOMPILE) -c $<
  misc-inst.lo: misc-inst.cc
! 	$(LTCXXCOMPILE) -c $<
  locale-inst.o: locale-inst.cc
! 	$(CXXCOMPILE) -c $<
  locale-inst.lo: locale-inst.cc
! 	$(LTCXXCOMPILE) -c $<
  
  # Use special rules for the deprecated source files so that they find
  # deprecated include files.
*************** strstream.o: strstream.cc
*** 325,333 ****
  
  # Make wstring-inst.cc from string-inst.cc
  wstring-inst.o: string-inst.cc
! 	$(CXXCOMPILE) -fimplicit-templates -c -DC=wchar_t $< -o $@
  wstring-inst.lo: string-inst.cc
! 	$(LTCXXCOMPILE) -fimplicit-templates -c -DC=wchar_t $< -o $@
  
  
  # Alexandre put this in here for some libtool-related reason.
--- 325,333 ----
  
  # Make wstring-inst.cc from string-inst.cc
  wstring-inst.o: string-inst.cc
! 	$(CXXCOMPILE) -c -DC=wchar_t $< -o $@
  wstring-inst.lo: string-inst.cc
! 	$(LTCXXCOMPILE) -c -DC=wchar_t $< -o $@
  
  
  # Alexandre put this in here for some libtool-related reason.
Index: libstdc++-v3/src/Makefile.in
===================================================================
RCS file: /cvs/gcc/gcc/libstdc++-v3/src/Makefile.in,v
retrieving revision 1.91
diff -c -p -r1.91 Makefile.in
*** Makefile.in	2001/02/03 09:01:44	1.91
--- Makefile.in	2001/02/06 05:45:23
*************** myinstallheaders: 
*** 572,584 ****
  # for things like vptrs, type_info bits, etc. when using
  # -fno-implicit-templates.
  misc-inst.o: misc-inst.cc
! 	$(CXXCOMPILE) -fimplicit-templates -c $<
  misc-inst.lo: misc-inst.cc
! 	$(LTCXXCOMPILE) -fimplicit-templates -c $<
  locale-inst.o: locale-inst.cc
! 	$(CXXCOMPILE) -fimplicit-templates -c $<
  locale-inst.lo: locale-inst.cc
! 	$(LTCXXCOMPILE) -fimplicit-templates -c $<
  
  # Use special rules for the deprecated source files so that they find
  # deprecated include files.
--- 572,584 ----
  # for things like vptrs, type_info bits, etc. when using
  # -fno-implicit-templates.
  misc-inst.o: misc-inst.cc
! 	$(CXXCOMPILE) -c $<
  misc-inst.lo: misc-inst.cc
! 	$(LTCXXCOMPILE) -c $<
  locale-inst.o: locale-inst.cc
! 	$(CXXCOMPILE) -c $<
  locale-inst.lo: locale-inst.cc
! 	$(LTCXXCOMPILE) -c $<
  
  # Use special rules for the deprecated source files so that they find
  # deprecated include files.
*************** strstream.o: strstream.cc
*** 589,597 ****
  
  # Make wstring-inst.cc from string-inst.cc
  wstring-inst.o: string-inst.cc
! 	$(CXXCOMPILE) -fimplicit-templates -c -DC=wchar_t $< -o $@
  wstring-inst.lo: string-inst.cc
! 	$(LTCXXCOMPILE) -fimplicit-templates -c -DC=wchar_t $< -o $@
  
  # Alexandre put this in here for some libtool-related reason.
  all: libstdc++.INC
--- 589,597 ----
  
  # Make wstring-inst.cc from string-inst.cc
  wstring-inst.o: string-inst.cc
! 	$(CXXCOMPILE) -c -DC=wchar_t $< -o $@
  wstring-inst.lo: string-inst.cc
! 	$(LTCXXCOMPILE) -c -DC=wchar_t $< -o $@
  
  # Alexandre put this in here for some libtool-related reason.
  all: libstdc++.INC
Index: libstdc++-v3/src/locale-inst.cc
===================================================================
RCS file: /cvs/gcc/gcc/libstdc++-v3/src/locale-inst.cc,v
retrieving revision 1.12
diff -c -p -r1.12 locale-inst.cc
*** locale-inst.cc	2001/01/30 09:18:51	1.12
--- locale-inst.cc	2001/02/06 05:45:23
*************** namespace std {
*** 282,286 ****
--- 282,312 ----
      locale::facet** 
      fill_n<locale::facet**, unsigned long, locale::facet*>
      (locale::facet**, unsigned long, locale::facet* const&);
+ 
+   template
+     const numpunct<char>& 
+     use_facet(const locale&);
+ 
+   template
+     void __sink_unused_warning<locale::facet*>(locale::facet*);
+ 
+   template
+     __normal_iterator<locale::facet**, 
+                       vector<locale::facet*> >
+     fill_n(__normal_iterator<locale::facet**, 
+ 	                     vector<locale::facet*> >,
+ 	   unsigned, locale::facet* const&);
+ 
+   template
+     void
+     fill (__normal_iterator<locale::facet**, 
+ 	                    vector<locale::facet*> >,
+ 	  __normal_iterator<locale::facet**, 
+ 	                    vector<locale::facet*> >,
+ 	  locale::facet* const&);
+ 
+   template
+     const collate<char>&
+     use_facet<collate<char> >(const locale&);
  } //std
  
Index: libstdc++-v3/src/misc-inst.cc
===================================================================
RCS file: /cvs/gcc/gcc/libstdc++-v3/src/misc-inst.cc,v
retrieving revision 1.4
diff -c -p -r1.4 misc-inst.cc
*** misc-inst.cc	2000/07/26 20:55:48	1.4
--- misc-inst.cc	2001/02/06 05:45:23
***************
*** 1,6 ****
  // Explicit instantiation file.
  
! // Copyright (C) 1997-1999, 2000 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
--- 1,6 ----
  // Explicit instantiation file.
  
! // Copyright (C) 1997-1999, 2000, 2001 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
***************
*** 43,48 ****
--- 43,49 ----
  #include <bits/basic_ios.tcc>
  #include <bits/std_istream.h>
  #include <bits/std_ostream.h>
+ #include <bits/std_string.h>
  
  // NB: unnecessary if the .h headers include these
  #ifndef  _GLIBCPP_FULLY_COMPLIANT_HEADERS
*************** namespace std {
*** 239,244 ****
--- 240,308 ----
      (vector<string>::const_iterator, vector<string>::const_iterator, 
       string*, _Bool<false>);
  
+   template
+     void 
+     __sink_unused_warning<char>(char);
+ #ifdef _GLIBCPP_USE_WCHAR_T
+   template
+     void 
+     __sink_unused_warning<wchar_t>(wchar_t);
+ #endif
+ 
+   template
+     void
+     __sink_unused_warning<ostreambuf_iterator<char> > 
+     (ostreambuf_iterator<char>);
+ #ifdef _GLIBCPP_USE_WCHAR_T
+   template
+     void
+     __sink_unused_warning<ostreambuf_iterator<wchar_t> > 
+     (ostreambuf_iterator<wchar_t>);
+ #endif
+ 
+   template
+     void 
+     _S_pad_char (basic_ios<char>&, char*, const char*, int, int);
+ #ifdef _GLIBCPP_USE_WCHAR_T
+   template
+     void 
+     _S_pad_char (basic_ios<wchar_t>&, wchar_t*, const wchar_t*, int, int);
+ #endif
+ 
+   template
+     ostreambuf_iterator<char>
+     _S_pad_numeric (ostreambuf_iterator<char>, _Ios_Fmtflags, char, int,
+ 		    const char*, const char*, const char*);
+ #ifdef _GLIBCPP_USE_WCHAR_T
+   template
+     ostreambuf_iterator<wchar_t>
+     _S_pad_numeric (ostreambuf_iterator<wchar_t>, _Ios_Fmtflags, wchar_t, int,
+ 		    const wchar_t*, const wchar_t*, const wchar_t*);
+ #endif
+ 
+   template
+     ostreambuf_iterator<char>
+     _S_output_float (ostreambuf_iterator<char>, ios_base&, char, 
+ 		     const char*, unsigned);
+ #ifdef _GLIBCPP_USE_WCHAR_T
+   template
+     ostreambuf_iterator<wchar_t>
+     _S_output_float (ostreambuf_iterator<wchar_t>, ios_base&, wchar_t, 
+ 		     const wchar_t*, unsigned);
+ #endif
+ 
+   template
+     int
+     _S_copy_streambufs(basic_ios<char>&, 
+ 		       basic_streambuf<char>*,
+ 		       basic_streambuf<char>*); 
+ #ifdef _GLIBCPP_USE_WCHAR_T
+   template
+     int
+     _S_copy_streambufs(basic_ios<wchar_t>&, 
+ 		       basic_streambuf<wchar_t>*,
+ 		       basic_streambuf<wchar_t>*); 
+ #endif
  } //std
  
  
Index: libstdc++-v3/src/string-inst.cc
===================================================================
RCS file: /cvs/gcc/gcc/libstdc++-v3/src/string-inst.cc,v
retrieving revision 1.13
diff -c -p -r1.13 string-inst.cc
*** string-inst.cc	2001/02/05 19:46:22	1.13
--- string-inst.cc	2001/02/06 05:45:23
*************** namespace std 
*** 71,76 ****
--- 71,79 ----
      S::_S_construct<S::iterator>
      (S::iterator, S::iterator, const allocator<C>&, forward_iterator_tag);
  
+   template
+     S::basic_string(C*, C*, const allocator<C>&);
+ 
    template 
      S::basic_string(S::iterator, S::iterator, const allocator<C>&);
  
*************** namespace std 
*** 87,92 ****
--- 90,104 ----
      C*
      S::_S_construct(const C*, const C*, const allocator<C>&, 
  		    forward_iterator_tag);
+ 
+   template
+     C*
+     S::_S_construct (C*, C*, const allocator<C>&, 
+ 		     forward_iterator_tag);
+ 
+   template
+     void
+     __destroy_aux<S*>(S*, S*, _Bool<false>);
  } // namespace std
  
  

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]