This is the mail archive of the libstdc++@sourceware.cygnus.com 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]

Re: -ffunction-sections -fdata-sections vs. string-inst



Here's a new patch. . .  

Index: ChangeLog
===================================================================
RCS file: /cvs/gcc/egcs/libstdc++-v3/ChangeLog,v
retrieving revision 1.65
diff -u -p -c -p -r1.65 ChangeLog
*** ChangeLog	2000/06/14 01:16:03	1.65
--- ChangeLog	2000/06/15 06:33:40
***************
*** 1,3 ****
--- 1,20 ----
+ 2000-06-14  Benjamin Kosnik  <bkoz@purist.soma.redhat.com>
+ 
+       	* src/Makefile.am (string_sources): Simplify, assuming that with
+ 	-ffunction-sections, -fdata-sections, -Wl,--gc-sections, all this
+ 	hacking is not necessary.
+         (wstring_sources): Same.
+         (OPTIMIZE_CXXFLAGS): Enable -fdata-sections -ffunction-sections
+ 	-Wl,--gc-sections.
+ 	* src/string-inst.cc: Remove macro blocks.
+ 	* mkcheck.in (CXX_FLAG): Add bits here.
+ 	
+ 	* src/string-inst.cc: Remove iostream-related string instantiations.
+ 	* src/misc-inst.cc: Add here.
+ 
+ 	* acinclude.m4 (GLIBCPP_CHECK_COMPILER_VERSION): Change FMTFLAGS
+ 	to WFMT_FLAGS.
+ 
  2000-06-13  Steven King  <sxking@uswest.net>
  
          * acinclude.m4:  Fixup some of the builtin math tests and add tests for
Index: acinclude.m4
===================================================================
RCS file: /cvs/gcc/egcs/libstdc++-v3/acinclude.m4,v
retrieving revision 1.28
diff -u -p -c -p -r1.28 acinclude.m4
*** acinclude.m4	2000/06/14 01:16:03	1.28
--- acinclude.m4	2000/06/15 06:34:01
*************** AC_SUBST(GLIBCPP_CXXFLAGS)
*** 155,173 ****
  
  dnl
  dnl Check to see if g++ can compile this library, and if so, if any version-
! dnl specific precautions need to be taken. In particular, test for
! dnl newer compiler features, or features that are present in newer
  dnl compiler version but not older compiler versions should be placed
  dnl here.
  dnl
! dnl Define FMTFLAGS='-fdiagnostics-show-location=once' if possible
  dnl Define WERROR='-Werror' if possible; g++'s that lack the new inlining
! dnl    code or the new system_header pragma will die.  Other options dealing
! dnl    with warnings, errors, and compiler complaints may be folded into
! dnl    the WERROR variable.
  dnl
! dnl GLIBCPP_CHECK_COMPILER_VERSION
! AC_DEFUN(GLIBCPP_CHECK_COMPILER_VERSION, [
    # All these tests are for C++; save the language and the compiler flags.
    # The CXXFLAGS thing is suspicious, but based on similar bits 
    # found in GLIBCPP_CONFIGURE.
--- 155,190 ----
  
  dnl
  dnl Check to see if g++ can compile this library, and if so, if any version-
! dnl specific precautions need to be taken. 
! dnl 
! dnl GLIBCPP_CHECK_COMPILER_VERSION
! AC_DEFUN(GLIBCPP_CHECK_COMPILER_VERSION, [
! 
!   # Sanity check that g++ is capable of dealing with v-3.
!   AC_MSG_CHECKING([for g++ that will successfully compile this code])
!   AC_EGREP_CPP([ok], [
!   #if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 95) 
!     ok
!   #endif
!   ], gpp_satisfactory=yes, AC_MSG_ERROR("please upgrade to gcc-2.95 or above"))
!   AC_MSG_RESULT($gpp_satisfactory)
! ])
! 
! 
! dnl
! dnl Test for newer compiler features, or features that are present in newer
  dnl compiler version but not older compiler versions should be placed
  dnl here.
  dnl
! dnl Define WFMT_FLAGS='-fdiagnostics-show-location=once' if possible
! dnl 
  dnl Define WERROR='-Werror' if possible; g++'s that lack the new inlining
! dnl code or the new system_header pragma will die.  
  dnl
! dnl Define SECTION_FLAGS='-ffunction-sections -fdata-sections' if
! dnl compiler supports it.  
! dnl GLIBCPP_CHECK_COMPILER_FEATURES
! AC_DEFUN(GLIBCPP_CHECK_COMPILER_FEATURES, [
    # All these tests are for C++; save the language and the compiler flags.
    # The CXXFLAGS thing is suspicious, but based on similar bits 
    # found in GLIBCPP_CONFIGURE.
*************** AC_DEFUN(GLIBCPP_CHECK_COMPILER_VERSION,
*** 177,191 ****
    ac_save_CXXFLAGS="$CXXFLAGS"
    WERROR='-Werror'
  
-   # Sanity check that g++ is capable of dealing with v-3.
-   AC_MSG_CHECKING([for g++ that will successfully compile this code])
-   AC_EGREP_CPP([ok], [
-   #if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 95) 
-     ok
-   #endif
-   ], gpp_satisfactory=yes, AC_MSG_ERROR("please upgrade to gcc-2.95 or above"))
-   AC_MSG_RESULT($gpp_satisfactory)
- 
    # Check for pragma system_header.
    AC_MSG_CHECKING([for g++ that supports pragma system_header])
    CXXFLAGS='-Wunknown-pragmas -Werror'
--- 194,199 ----
*************** AC_DEFUN(GLIBCPP_CHECK_COMPILER_VERSION,
*** 214,228 ****
      CXXFLAGS=''
    fi
    if test "$ac_gabydiags" = "yes"; then
!     FMTFLAGS='-fdiagnostics-show-location=once'
    fi
    AC_MSG_RESULT($ac_gabydiags)
  
    AC_LANG_RESTORE
    AC_SUBST(WERROR)
!   AC_SUBST(FMTFLAGS)
  ])
  
  dnl
  dnl Check to see what builtin math functions are supported
  dnl
--- 222,287 ----
      CXXFLAGS=''
    fi
    if test "$ac_gabydiags" = "yes"; then
!     WFMT_FLAGS='-fdiagnostics-show-location=once'
    fi
    AC_MSG_RESULT($ac_gabydiags)
  
+   # Check for -ffunction-sections -fdata-sections
+   AC_MSG_CHECKING([for g++ that supports -ffunction-sections -fdata-sections])
+   CXXFLAGS='-ffunction-sections -fdata-sections'
+   AC_TRY_COMPILE(, [int foo;
+   ], [ac_fdsections=yes], [ac_fdsections=no])
+   if test "$ac_test_CXXFLAGS" = set; then
+     CXXFLAGS="$ac_save_CXXFLAGS"
+   else
+     # this is the suspicious part
+     CXXFLAGS=''
+   fi
+   if test "$ac_fdsections" = "yes"; then
+     SECTION_FLAGS='-ffunction-sections -fdata-sections'
+   fi
+   AC_MSG_RESULT($ac_fdsections)
+ 
    AC_LANG_RESTORE
    AC_SUBST(WERROR)
!   AC_SUBST(WFMT_FLAGS)
!   AC_SUBST(SECTION_FLAGS)
  ])
  
+ 
+ dnl
+ dnl Check to see if tricky linker opts can be used.
+ dnl
+ dnl Define SECTION_LDFLAGS='-Wl,--gc-sections' if possible
+ dnl GLIBCPP_CHECK_LINKER_FEATURES
+ AC_DEFUN(GLIBCPP_CHECK_LINKER_FEATURES, [
+   # All these tests are for C++; save the language and the compiler flags.
+   # The CXXFLAGS thing is suspicious, but based on similar bits 
+   # found in GLIBCPP_CONFIGURE.
+   AC_LANG_SAVE
+   AC_LANG_CPLUSPLUS
+ 
+   # Check for -Wl,--gc-sections
+   AC_MSG_CHECKING([for ld that supports -Wl,--gc-sections])
+   CXXFLAGS='-Wl,--gc-sections'
+   AC_TRY_COMPILE(, [int foo;
+   ], [ac_sectionLDflags=yes], [ac_sectionLFflags=no])
+   if test "$ac_test_CXXFLAGS" = set; then
+     CXXFLAGS="$ac_save_CXXFLAGS"
+   else
+     # this is the suspicious part
+     CXXFLAGS=''
+   fi
+   if test "$ac_sectionLDflags" = "yes"; then
+     SECTION_LDFLAGS='-Wl,--gc-sections'
+   fi
+   AC_MSG_RESULT($ac_sectionLDflags)
+ 
+   AC_LANG_RESTORE
+   AC_SUBST(SECTION_LDFLAGS)
+ ])
+ 
+ 
  dnl
  dnl Check to see what builtin math functions are supported
  dnl
*************** dnl
*** 841,847 ****
  dnl GLIBCPP_CHECK_CPU
  AC_DEFUN(GLIBCPP_CHECK_CPU, [
      AC_MSG_CHECKING([for cpu primitives directory])
!     CPUFLAGS=			
      case "$target_cpu" in
        alpha*)
  	cpu_include_dir="config/cpu/alpha"
--- 900,906 ----
  dnl GLIBCPP_CHECK_CPU
  AC_DEFUN(GLIBCPP_CHECK_CPU, [
      AC_MSG_CHECKING([for cpu primitives directory])
!     CPU_FLAGS=			
      case "$target_cpu" in
        alpha*)
  	cpu_include_dir="config/cpu/alpha"
*************** AC_DEFUN(GLIBCPP_CHECK_CPU, [
*** 857,863 ****
          ;;
        powerpc | rs6000)
  	cpu_include_dir="config/cpu/powerpc"
!     	CPUFLAGS='-mcpu=powerpc'
          ;;
        sparc64 | ultrasparc)
  	cpu_include_dir="config/cpu/sparc/sparc64"
--- 916,922 ----
          ;;
        powerpc | rs6000)
  	cpu_include_dir="config/cpu/powerpc"
!     	CPU_FLAGS='-mcpu=powerpc'
          ;;
        sparc64 | ultrasparc)
  	cpu_include_dir="config/cpu/sparc/sparc64"
*************** AC_DEFUN(GLIBCPP_CHECK_CPU, [
*** 871,877 ****
      esac
      AC_MSG_RESULT($cpu_include_dir)
      AC_SUBST(cpu_include_dir)
!     AC_SUBST(CPUFLAGS)
  ])
  
   
--- 930,936 ----
      esac
      AC_MSG_RESULT($cpu_include_dir)
      AC_SUBST(cpu_include_dir)
!     AC_SUBST(CPU_FLAGS)
  ])
  
   
*************** enable_debug=GLIBCPP_ENABLE_DEBUG_DEFAUL
*** 1270,1282 ****
  dnl Option parsed, now set things appropriately
  case "$enable_debug" in
      yes) 
! 	DEBUGFLAGS='-O0 -ggdb'			
  	;;
      no)   
! 	DEBUGFLAGS='-g'
          ;;
  esac
! AC_SUBST(DEBUGFLAGS)
  ])
  
  
--- 1329,1341 ----
  dnl Option parsed, now set things appropriately
  case "$enable_debug" in
      yes) 
! 	DEBUG_FLAGS='-O0 -ggdb'			
  	;;
      no)   
! 	DEBUG_FLAGS='-g'
          ;;
  esac
! AC_SUBST(DEBUG_FLAGS)
  ])
  
  
Index: configure.in
===================================================================
RCS file: /cvs/gcc/egcs/libstdc++-v3/configure.in,v
retrieving revision 1.8
diff -u -p -c -p -r1.8 configure.in
*** configure.in	2000/05/25 13:09:00	1.8
--- configure.in	2000/06/15 06:34:48
*************** else
*** 106,111 ****
--- 106,113 ----
    AC_CHECK_HEADERS([nan.h ieeefp.h endian.h sys/isa_defs.h machine/endian.h \
    machine/param.h sys/machine.h fp.h locale.h float.h inttypes.h])
  
+   GLIBCPP_CHECK_COMPILER_FEATURES
+   GLIBCPP_CHECK_LINKER_FEATURES
    GLIBCPP_CHECK_COMPLEX_SUPPORT
    GLIBCPP_CHECK_COMPLEX_FLOAT_SUPPORT
    GLIBCPP_CHECK_BUILTIN_MATH_SUPPORT
Index: mkcheck.in
===================================================================
RCS file: /cvs/gcc/egcs/libstdc++-v3/mkcheck.in,v
retrieving revision 1.12
diff -u -p -c -p -r1.12 mkcheck.in
*** mkcheck.in	2000/06/12 23:56:56	1.12
--- mkcheck.in	2000/06/15 06:35:07
*************** fi
*** 69,75 ****
  # gcc compiler flags
  #CXX_FLAG="-fsquangle -fhonor-std -fnew-exceptions -g -O2 -DDEBUG_ASSERT "
  #CXX_FLAG="-g -O2 -DDEBUG_ASSERT "
! CXX_FLAG="-g -DDEBUG_ASSERT "
  
  # a specific flag(s) to force the use of shared libraries, if any
  SH_FLAG=""
--- 69,75 ----
  # gcc compiler flags
  #CXX_FLAG="-fsquangle -fhonor-std -fnew-exceptions -g -O2 -DDEBUG_ASSERT "
  #CXX_FLAG="-g -O2 -DDEBUG_ASSERT "
! CXX_FLAG="-g -DDEBUG_ASSERT @SECTION_FLAGS@ @SECTION_LDFLAGS@"
  
  # a specific flag(s) to force the use of shared libraries, if any
  SH_FLAG=""
Index: src/Makefile.am
===================================================================
RCS file: /cvs/gcc/egcs/libstdc++-v3/src/Makefile.am,v
retrieving revision 1.15
diff -u -p -c -p -r1.15 Makefile.am
*** Makefile.am	2000/05/25 13:09:01	1.15
--- Makefile.am	2000/06/15 06:35:27
*************** EXTRA_LTLIBRARIES = libinst-string.la li
*** 38,62 ****
  
  
  # Using these options is probably a good idea for thrill-seekers. Just
! # uncomment the lines below and make, everything else is ready to go...
! # OPTIMIZE_CXXFLAGS = \
! #	-O3 -fstrict-aliasing \
! #	-fdata-sections -ffunction-sections -fvtable-gc -Wl,--gc-sections
  
  # These bits are all figured out from configure. Look in acinclude.m4
  # or configure.in to see how they are set.
  AC_CXXFLAGS = \
! 	@WERROR@ @FMTFLAGS@ @CSHADOWFLAGS@ @CPUFLAGS@ \
! 	@EXTRA_CXX_FLAGS@ @DEBUGFLAGS@ 
  
  # Need to manually set this option because AC_CXXFLAGS has to be at
! # the end of the compile line so that -O2 can be over-riden as the
  # occasion call for it. (ie, --enable-debug)
  AM_CXXFLAGS = \
! 	$(FORMAT_CXXFLAGS) \
! 	-fno-implicit-templates \
  	-Wall -Wno-format -W -Wwrite-strings -Winline \
! 	$(OPTIMIZE_CXXFLAGS) $(AC_CXXFLAGS) 
  
  
  # Passed down for cross compilers, canadian crosses.
--- 38,60 ----
  
  
  # Using these options is probably a good idea for thrill-seekers. Just
! # uncomment the lines below and make, everything else is ready to go... 
! # OPTIMIZE_CXXFLAGS = -O3 -fstrict-aliasing -fvtable-gc 
  
  # These bits are all figured out from configure. Look in acinclude.m4
  # or configure.in to see how they are set.
+ # NB: DEBUGFLAGS have to be at the end so that -O2 can be overridden.
  AC_CXXFLAGS = \
! 	@WERROR@ @WFMT_FLAGS@ @CPU_FLAGS@ @EXTRA_CXX_FLAGS@ \
! 	@SECTION_FLAGS@ @SECTION_LDFLAGS@ @DEBUG_FLAGS@ 
  
  # Need to manually set this option because AC_CXXFLAGS has to be at
! # the end of the compile line so that -O2 can be overridden as the
  # occasion call for it. (ie, --enable-debug)
  AM_CXXFLAGS = \
! 	-fno-implicit-templates $(OPTIMIZE_CXXFLAGS) \
  	-Wall -Wno-format -W -Wwrite-strings -Winline \
! 	$(AC_CXXFLAGS) 
  
  
  # Passed down for cross compilers, canadian crosses.
*************** INCLUDES = \
*** 79,86 ****
  # Need to explicitly set this so that AM_CXXFLAGS is last. (That way,
  # things like -O2 passed down from the toplevel can be overridden by
  # --enable-debug.)
! CXXCOMPILE = $(CXX) $(DEFS) $(INCLUDES) \
! 	     $(AM_CPPFLAGS) $(CPPFLAGS) $(CXXFLAGS) $(AM_CXXFLAGS) 
  
  LTCXXCOMPILE = $(LIBTOOL) --mode=compile $(CXX) $(DEFS) $(INCLUDES) \
  	       $(AM_CPPFLAGS) $(CPPFLAGS) $(CXXFLAGS) $(AM_CXXFLAGS) 
--- 77,84 ----
  # Need to explicitly set this so that AM_CXXFLAGS is last. (That way,
  # things like -O2 passed down from the toplevel can be overridden by
  # --enable-debug.)
! CXXCOMPILE = $(CXX) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
! 	     $(CXXFLAGS) $(AM_CXXFLAGS) 
  
  LTCXXCOMPILE = $(LIBTOOL) --mode=compile $(CXX) $(DEFS) $(INCLUDES) \
  	       $(AM_CPPFLAGS) $(CPPFLAGS) $(CXXFLAGS) $(AM_CXXFLAGS) 
*************** sources = \
*** 195,257 ****
  	complex.cc complexf.cc complexl.cc complex_io.cc \
  	stdexcept.cc ios.cc stdstreams.cc strstream.cc \
  	locale.cc localename.cc  \
! 	locale-inst.cc stl-inst.cc misc-inst.cc valarray-inst.cc 
  
- string_sources = \
- 	stringMAIN.cc stringCTORNC.cc stringCTORAL.cc \
- 	stringCTORCPR.cc stringCTORCPRAL.cc stringCTORPRAL.cc \
- 	stringCTORPAL.cc stringCTORPP.cc stringCTORII.cc \
- 	stringMUTATE.cc stringRESERVE.cc \
- 	stringSWAP.cc stringSLOP.cc \
- 	stringRESIZE.cc stringAPPCOPY.cc stringAPPCPR.cc stringAPPPR.cc \
- 	stringAPPDUP.cc stringAPPII.cc stringASSCP.cc stringASSII.cc \
- 	stringINSII.cc stringREPRR.cc stringREPIIDUP.cc stringREPII.cc \
- 	stringREPIII.cc stringREP4I.cc stringREPIIPP.cc stringREPIIPP2.cc \
- 	stringCOPY.cc stringCONII.cc stringCONIIF.cc stringCONPPF.cc \
- 	stringCONPPF2.cc stringCONSC.cc \
- 	stringFIND.cc stringFINDC.cc stringRFIND.cc \
- 	stringRFINDC.cc stringFFO.cc stringFLO.cc stringFFNO.cc \
- 	stringFLNO.cc stringFLNOC.cc stringCOMPARE.cc stringCOMPARE2.cc \
- 	stringCOMPAREP.cc stringCOMPAREP2.cc stringADDPS.cc stringADDCS.cc \
- 	stringEXTRACT.cc stringINSERT.cc stringGETLINE.cc stringSCOPY.cc \
- 	stringEQ.cc
- 
  wstring_sources = \
! 	wstringMAIN.cc wstringCTORNC.cc wstringCTORAL.cc \
! 	wstringCTORCPR.cc wstringCTORCPRAL.cc wstringCTORPRAL.cc \
! 	wstringCTORPAL.cc wstringCTORPP.cc \
! 	wstringCTORII.cc \
! 	wstringMUTATE.cc wstringRESERVE.cc \
! 	wstringSWAP.cc wstringSLOP.cc \
! 	wstringRESIZE.cc wstringAPPCOPY.cc wstringAPPCPR.cc wstringAPPPR.cc \
! 	wstringAPPDUP.cc wstringAPPII.cc wstringASSCP.cc wstringASSII.cc \
! 	wstringINSII.cc wstringREPRR.cc wstringREPIIDUP.cc wstringREPII.cc \
! 	wstringREPIII.cc wstringREP4I.cc wstringREPIIPP.cc wstringREPIIPP2.cc \
! 	wstringCOPY.cc wstringCONII.cc wstringCONIIF.cc wstringCONPPF.cc \
! 	wstringCONPPF2.cc wstringCONSC.cc \
! 	wstringFIND.cc wstringFINDC.cc wstringRFIND.cc \
! 	wstringRFINDC.cc wstringFFO.cc wstringFLO.cc wstringFFNO.cc \
! 	wstringFLNO.cc wstringFLNOC.cc wstringCOMPARE.cc wstringCOMPARE2.cc \
! 	wstringCOMPAREP.cc wstringCOMPAREP2.cc wstringADDPS.cc \
! 	wstringADDCS.cc wstringEXTRACT.cc wstringINSERT.cc wstringGETLINE.cc \
! 	wstringSCOPY.cc wstringEQ.cc
  
  VPATH += $(top_srcdir) $(top_srcdir)/std $(top_srcdir)/src
  VPATH += $(top_srcdir)/@ctype_include_dir@
  
  
  # Actual sources for the distro, but don't build these.
! EXTRA_sources = string-inst.cc 
  
  libstdc___la_SOURCES = $(sources)
  
- libinst_string_la_SOURCES = $(string_sources)
- 
  libinst_wstring_la_SOURCES = $(wstring_sources)
  
  libstdc___la_LIBADD = \
  	../math/libmath.la ../libio/libio.la \
! 	libinst-string.la @libinst_wstring_la@
  
  libstdc___la_LDFLAGS = -version-info 3:0:0 -lm
  
--- 193,217 ----
  	complex.cc complexf.cc complexl.cc complex_io.cc \
  	stdexcept.cc ios.cc stdstreams.cc strstream.cc \
  	locale.cc localename.cc  \
! 	locale-inst.cc stl-inst.cc misc-inst.cc valarray-inst.cc string-inst.cc
  
  wstring_sources = \
! 	wstring-inst.cc
  
  VPATH += $(top_srcdir) $(top_srcdir)/std $(top_srcdir)/src
  VPATH += $(top_srcdir)/@ctype_include_dir@
  
  
  # Actual sources for the distro, but don't build these.
! #EXTRA_sources = string-inst.cc 
  
  libstdc___la_SOURCES = $(sources)
  
  libinst_wstring_la_SOURCES = $(wstring_sources)
  
  libstdc___la_LIBADD = \
  	../math/libmath.la ../libio/libio.la \
! 	@libinst_wstring_la@
  
  libstdc___la_LDFLAGS = -version-info 3:0:0 -lm
  
*************** locale-inst.o: locale-inst.cc
*** 333,567 ****
  locale-inst.lo: locale-inst.cc
  	$(LTCXXCOMPILE) -fimplicit-templates -c $<
  
! stringMAIN.lo \
! stringCTORNC.lo \
! stringCTORAL.lo \
! stringCTORCPR.lo \
! stringCTORCPRAL.lo \
! stringCTORPRAL.lo \
! stringCTORPAL.lo \
! stringCTORPP.lo \
! stringCTORII.lo \
! stringMUTATE.lo \
! stringRESERVE.lo \
! stringSWAP.lo \
! stringSLOP.lo \
! stringRESIZE.lo \
! stringAPPCOPY.lo \
! stringAPPCPR.lo \
! stringAPPPR.lo \
! stringAPPDUP.lo \
! stringAPPII.lo \
! stringASSCP.lo \
! stringASSII.lo \
! stringINSII.lo \
! stringREPRR.lo \
! stringREPIIDUP.lo \
! stringREPII.lo \
! stringREPIII.lo \
! stringREP4I.lo \
! stringREPIIPP.lo \
! stringREPIIPP2.lo \
! stringCOPY.lo \
! stringCONII.lo \
! stringCONIIF.lo \
! stringCONPPF.lo \
! stringCONPPF2.lo \
! stringCONSC.lo \
! stringFIND.lo \
! stringFINDC.lo \
! stringRFIND.lo \
! stringRFINDC.lo \
! stringFFO.lo \
! stringFLO.lo \
! stringFFNO.lo \
! stringFLNO.lo \
! stringFLNOC.lo \
! stringCOMPARE.lo \
! stringCOMPARE2.lo \
! stringCOMPAREP.lo \
! stringCOMPAREP2.lo \
! stringADDPS.lo \
! stringADDCS.lo \
! stringEXTRACT.lo \
! stringINSERT.lo \
! stringGETLINE.lo \
! stringSCOPY.lo \
! stringEQ.lo : string-inst.cc
! 	$(LTCXXCOMPILE) -fimplicit-templates \
! 	-c -D`echo $@ | tr -dc '0-9A-Z'` $< -o $@
! 
! wstringMAIN.lo \
! wstringCTORNC.lo \
! wstringCTORAL.lo \
! wstringCTORCPR.lo \
! wstringCTORCPRAL.lo \
! wstringCTORPRAL.lo \
! wstringCTORPAL.lo \
! wstringCTORPP.lo \
! wstringCTORII.lo \
! wstringMUTATE.lo \
! wstringRESERVE.lo \
! wstringSWAP.lo \
! wstringSLOP.lo \
! wstringRESIZE.lo \
! wstringAPPCOPY.lo \
! wstringAPPCPR.lo \
! wstringAPPPR.lo \
! wstringAPPDUP.lo \
! wstringAPPII.lo \
! wstringASSCP.lo \
! wstringASSII.lo \
! wstringINSII.lo \
! wstringREPRR.lo \
! wstringREPIIDUP.lo \
! wstringREPII.lo \
! wstringREPIII.lo \
! wstringREP4I.lo \
! wstringREPIIPP.lo \
! wstringREPIIPP2.lo \
! wstringCOPY.lo \
! wstringCONII.lo \
! wstringCONIIF.lo \
! wstringCONPPF.lo \
! wstringCONPPF2.lo \
! wstringCONSC.lo \
! wstringFIND.lo \
! wstringFINDC.lo \
! wstringRFIND.lo \
! wstringRFINDC.lo \
! wstringFFO.lo \
! wstringFLO.lo \
! wstringFFNO.lo \
! wstringFLNO.lo \
! wstringFLNOC.lo \
! wstringCOMPARE.lo \
! wstringCOMPARE2.lo \
! wstringCOMPAREP.lo \
! wstringCOMPAREP2.lo \
! wstringADDPS.lo \
! wstringADDCS.lo \
! wstringEXTRACT.lo \
! wstringINSERT.lo \
! wstringGETLINE.lo \
! wstringSCOPY.lo \
! wstringEQ.lo : string-inst.cc
! 	$(LTCXXCOMPILE) -fimplicit-templates \
! 	-c -D`echo $@ | tr -dc '0-9A-Z'` -DC=wchar_t $< -o $@
! 
! stringMAIN.o \
! stringCTORNC.o \
! stringCTORAL.o \
! stringCTORCPR.o \
! stringCTORCPRAL.o \
! stringCTORPRAL.o \
! stringCTORPAL.o \
! stringCTORPP.o \
! stringCTORII.o \
! stringMUTATE.o \
! stringRESERVE.o \
! stringSWAP.o \
! stringSLOP.o \
! stringRESIZE.o \
! stringAPPCOPY.o \
! stringAPPCPR.o \
! stringAPPPR.o \
! stringAPPDUP.o \
! stringAPPII.o \
! stringASSCP.o \
! stringASSII.o \
! stringINSII.o \
! stringREPRR.o \
! stringREPIIDUP.o \
! stringREPII.o \
! stringREPIII.o \
! stringREP4I.o \
! stringREPIIPP.o \
! stringREPIIPP2.o \
! stringCOPY.o \
! stringCONII.o \
! stringCONIIF.o \
! stringCONPPF.o \
! stringCONPPF2.o \
! stringCONSC.o \
! stringFIND.o \
! stringFINDC.o \
! stringRFIND.o \
! stringRFINDC.o \
! stringFFO.o \
! stringFLO.o \
! stringFFNO.o \
! stringFLNO.o \
! stringFLNOC.o \
! stringCOMPARE.o \
! stringCOMPARE2.o \
! stringCOMPAREP.o \
! stringCOMPAREP2.o \
! stringADDPS.o \
! stringADDCS.o \
! stringEXTRACT.o \
! stringINSERT.o \
! stringGETLINE.o \
! stringSCOPY.o \
! stringEQ.o : string-inst.cc
! 	$(CXXCOMPILE) -fimplicit-templates \
! 	-c -D`echo $@ | tr -dc '0-9A-Z'` $< -o $@
! 
! wstringMAIN.o \
! wstringCTORNC.o \
! wstringCTORAL.o \
! wstringCTORCPR.o \
! wstringCTORCPRAL.o \
! wstringCTORPRAL.o \
! wstringCTORPAL.o \
! wstringCTORPP.o \
! wstringCTORII.o \
! wstringMUTATE.o \
! wstringRESERVE.o \
! wstringSWAP.o \
! wstringSLOP.o \
! wstringRESIZE.o \
! wstringAPPCOPY.o \
! wstringAPPCPR.o \
! wstringAPPPR.o \
! wstringAPPDUP.o \
! wstringAPPII.o \
! wstringASSCP.o \
! wstringASSII.o \
! wstringINSII.o \
! wstringREPRR.o \
! wstringREPIIDUP.o \
! wstringREPII.o \
! wstringREPIII.o \
! wstringREP4I.o \
! wstringREPIIPP.o \
! wstringREPIIPP2.o \
! wstringCOPY.o \
! wstringCONII.o \
! wstringCONIIF.o \
! wstringCONPPF.o \
! wstringCONPPF2.o \
! wstringCONSC.o \
! wstringFIND.o \
! wstringFINDC.o \
! wstringRFIND.o \
! wstringRFINDC.o \
! wstringFFO.o \
! wstringFLO.o \
! wstringFFNO.o \
! wstringFLNO.o \
! wstringFLNOC.o \
! wstringCOMPARE.o \
! wstringCOMPARE2.o \
! wstringCOMPAREP.o \
! wstringCOMPAREP2.o \
! wstringADDPS.o \
! wstringADDCS.o \
! wstringEXTRACT.o \
! wstringINSERT.o \
! wstringGETLINE.o \
! wstringSCOPY.o \
! wstringEQ.o : string-inst.cc
! 	$(CXXCOMPILE) -fimplicit-templates \
! 	-c -D`echo $@ | tr -dc '0-9A-Z'` -DC=wchar_t $< -o $@
  
--- 293,301 ----
  locale-inst.lo: locale-inst.cc
  	$(LTCXXCOMPILE) -fimplicit-templates -c $<
  
! # We have to instantiate wstring bits too. . . 
! 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 $@
  
Index: src/string-inst.cc
===================================================================
RCS file: /cvs/gcc/egcs/libstdc++-v3/src/string-inst.cc,v
retrieving revision 1.5
diff -u -p -c -p -r1.5 string-inst.cc
*** string-inst.cc	2000/06/03 01:52:32	1.5
--- string-inst.cc	2000/06/15 06:35:37
***************
*** 36,50 ****
  
  #include <bits/std_string.h>
  #include <bits/std_algorithm.h>
- #include <bits/std_istream.h>
- #include <bits/std_ostream.h>
  
- // NB: Unnecessary if the .h headers include these
- #ifndef  _GLIBCPP_FULLY_COMPLIANT_HEADERS
- #include <bits/istream.tcc>
- #include <bits/ostream.tcc>
- #endif
- 
  // Instantiation configuration.
  #ifndef C
  # define C char
--- 36,42 ----
*************** namespace std 
*** 55,61 ****
  {
    typedef basic_string<C> S;
  
- #ifdef MAIN
    template C S::_Rep::_S_terminal;
    template S::size_type S::_Rep::_S_max_size;
    template S::size_type S::_S_empty_rep_storage[];
--- 47,52 ----
*************** namespace std 
*** 64,222 ****
    template S::_Rep* S::_Rep::_S_create(size_t, S::allocator_type const&);
    template void S::_Rep::_M_destroy(S::allocator_type const&) throw();
    template void __destroy_aux(S*, S*, __false_type);
- #endif
  
- #ifdef CTORNC
    template 
      S::basic_string(S::size_type, C, S::allocator_type const&);
- #endif
  
- #ifdef CTORAL
    template 
      S::basic_string(S::allocator_type const&);
- #endif
  
- #ifdef CTORCPR
    template 
      S::basic_string(S const&, S::size_type, S::size_type);
- #endif
  
- #ifdef CTORCPRAL
    template 
      S::basic_string(
        S const&, S::size_type, S::size_type, S::allocator_type const&);
- #endif
  
- #ifdef CTORPRAL
    template 
      S::basic_string(
        C const*, S::size_type, S::allocator_type const&);
- #endif
  
- #ifdef CTORPAL
    template 
      S::basic_string(
        C const*, S::allocator_type const&);
- #endif
  
- #ifdef CTORPP
    template 
      S::basic_string
      (C*, C*, const allocator<C>&);
- #endif
  
- #ifdef CTORII
    template 
      S::basic_string
      (S::iterator, S::iterator, const allocator<C>&);
- #endif
  
- #ifdef MUTATE
    template
      void S::_M_leak_hard();
    template
      void S::_M_mutate(S::size_type, S::size_type, S::size_type);
    template
      C* S::_Rep::_M_clone(S::allocator_type const&, S::size_type);
- #endif
  
- #ifdef RESERVE
    template
      void S::reserve(S::size_type);
- #endif
  
- #ifdef SWAP
    template
      void S::swap(S&);
- #endif
  
- #ifdef SLOP
  # ifdef _GLIBCPP_ALLOC_CONTROL
      template
        bool (* S::_Rep::_S_excess_slop)(size_t, size_t); 
      template
        bool S::_Rep::_S_default_excess(size_t, size_t); 
  # endif
- #endif
  
- #ifdef RESIZE
    template
      void S::resize(S::size_type, C);
- #endif
  
- #ifdef APPCOPY
    template
      S& S::append(S const&);
- #endif
  
- #ifdef APPCPR
    template
      S& S::append(S const&, S::size_type, S::size_type);
- #endif
  
- #ifdef APPPR
    template
      S& S::append(C const*, S::size_type);
- #endif
  
- #ifdef APPDUP
    template
      S& S::append(S::size_type, C);
- #endif
  
- #ifdef APPII
    template 
      S& 
      S::append<S::iterator>
      (S::iterator, S::iterator);
- #endif
  
- #ifdef ASSCP
    template
      S& 
      S::assign(S const&);
- #endif
  
- #ifdef ASSII
    template 
      S& 
      S::assign<S::iterator>
      (S::iterator, S::iterator);
- #endif
  
- #ifdef INSII
    template 
      void
      S::insert<S::iterator> //c*
      (S::iterator, S::iterator, S::iterator); //it, c+, c+ and temptype = char*
- #endif
  
- #ifdef REPRR
    template
      S& S::replace(
        S::size_type, S::size_type, S const&, S::size_type, S::size_type);
- #endif
  
- #ifdef REPIIDUP
    template 
      S& S::replace(S::iterator, S::iterator, S::size_type, C);
- #endif
  
- #ifdef REPII
    template 
      S&
      S::replace<S::iterator> // c*
      (S::iterator, S::iterator, S::iterator, S::iterator); //it, it, c+, c+ 
- #endif
  
- #ifdef REPIII
    template 
      S& 
      S::_M_replace<S::iterator>
      (S::iterator, S::iterator, S::iterator, S::iterator, forward_iterator_tag);
- #endif
  
- #ifdef REP4I
    // Only one template keyword allowed here. 
    // See core issue #46 (NAD)
    // http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/cwg_closed.html#46
--- 55,161 ----
*************** namespace std 
*** 225,286 ****
      S::_M_replace<S::const_iterator>
      (S::iterator, S::iterator, 
       S::const_iterator, S::const_iterator, forward_iterator_tag);
- #endif
  
- #ifdef REPIIPP
    template 
      S& 
      S::_M_replace<C*>
      (S::iterator, S::iterator, C*, C*, forward_iterator_tag);
! #endif
!   
! #ifdef REPIIPP2
    template 
      S& 
      S::_M_replace<const C*>
      (S::iterator, S::iterator, const C*, const C*, forward_iterator_tag);
- #endif
  
- #ifdef COPY
    template
      S::size_type  S::copy(C*, S::size_type, S::size_type) const;
- #endif
  
- #ifdef CONII
    template 
      C* 
      S::_S_construct<S::iterator>
      (S::iterator, S::iterator, const allocator<C>&);
! #endif
!   
! #ifdef CONIIF
    template 
      C* 
      S::_S_construct<S::iterator>
      (S::iterator, S::iterator, const allocator<C>&, forward_iterator_tag);
- #endif
  
- #ifdef CONPPF
    template 
      C* 
      S::_S_construct<C*>
      (C*, C*, const allocator<C>&, forward_iterator_tag);
- #endif
  
- #ifdef CONPPF2
    template 
      C* 
      S::_S_construct<const C*>
      (const C*, const C*, const allocator<C>&, forward_iterator_tag);
- #endif
  
- #ifdef CONSC
    template 
      C* 
      S::_S_construct(S::size_type, C, S::allocator_type const&);
- #endif
  
- #ifdef FIND
    // These members are explicitly specialized, and can only be in one
    // translation unit or else we get multiple copies. . . 
  #if _GLIBCPP_INSTANTIATING_CHAR
--- 164,207 ----
      S::_M_replace<S::const_iterator>
      (S::iterator, S::iterator, 
       S::const_iterator, S::const_iterator, forward_iterator_tag);
  
    template 
      S& 
      S::_M_replace<C*>
      (S::iterator, S::iterator, C*, C*, forward_iterator_tag);
! 
    template 
      S& 
      S::_M_replace<const C*>
      (S::iterator, S::iterator, const C*, const C*, forward_iterator_tag);
  
    template
      S::size_type  S::copy(C*, S::size_type, S::size_type) const;
  
    template 
      C* 
      S::_S_construct<S::iterator>
      (S::iterator, S::iterator, const allocator<C>&);
! 
    template 
      C* 
      S::_S_construct<S::iterator>
      (S::iterator, S::iterator, const allocator<C>&, forward_iterator_tag);
  
    template 
      C* 
      S::_S_construct<C*>
      (C*, C*, const allocator<C>&, forward_iterator_tag);
  
    template 
      C* 
      S::_S_construct<const C*>
      (const C*, const C*, const allocator<C>&, forward_iterator_tag);
  
    template 
      C* 
      S::_S_construct(S::size_type, C, S::allocator_type const&);
  
    // These members are explicitly specialized, and can only be in one
    // translation unit or else we get multiple copies. . . 
  #if _GLIBCPP_INSTANTIATING_CHAR
*************** namespace std 
*** 300,400 ****
  		     _Char_traits_match<wchar_t, traits_type>(__c));
      }
  #endif
- #endif 
  
- #ifdef FINDC
    template
      S::size_type S::find(C, S::size_type) const;
- #endif
  
- #ifdef RFIND
    template
      S::size_type S::rfind(C const*, S::size_type, S::size_type) const;
- #endif
  
- #ifdef RFINDC
    template
      S::size_type S::rfind(C, S::size_type) const;
- #endif
  
- #ifdef FFO
    template
      S::size_type S::find_first_of(C const*, S::size_type, S::size_type) const;
- #endif
  
- #ifdef FLO
    template
      S::size_type S::find_last_of(C const*, S::size_type, S::size_type) const;
- #endif
  
- #ifdef FFNO
    template
      S::size_type S::find_first_not_of(
        C const*, S::size_type, S::size_type) const;
- #endif
  
- #ifdef FLNO
    template
      S::size_type S::find_last_not_of(
        C const*, S::size_type, S::size_type) const;
- #endif
  
- #ifdef FLNOC
    template
      S::size_type S::find_last_not_of(C, S::size_type) const;
- #endif
  
- #ifdef COMPARE
    template
      int S::compare(S::size_type, S::size_type, S const&) const;
- #endif
  
- #ifdef COMPARE2
    template
      int S::compare(S::size_type, S::size_type, S const&, S::size_type, 
  		   S::size_type) const;
- #endif
  
- #ifdef COMPAREP
    template
      int S::compare(C const*) const;
- #endif
  
- #ifdef COMPAREP2
    template
      int S::compare(
        S::size_type, S::size_type, C const*, S::size_type) const;
- #endif
  
- #ifdef ADDPS
    template S operator+(const C*, const S&);
- #endif
  
- #ifdef ADDCS
    template S operator+(C, const S&);
- #endif
  
- #ifdef EQ
    template bool operator==(const S::iterator&, const S::iterator&);
    template bool operator==(const S::const_iterator&, const S::const_iterator&);
- #endif
  
- #ifdef EXTRACT
-   template basic_istream<C>& operator>>(basic_istream<C>&, S&);
- #endif
- 
- #ifdef INSERT
-   template basic_ostream<C>& operator<<(basic_ostream<C>&, const S&);
- #endif
- 
- #ifdef GETLINE
-   template basic_istream<C>& getline(basic_istream<C>&, S&, C);
-   template basic_istream<C>& getline(basic_istream<C>&, S&);
- #endif
- 
- #ifdef SCOPY
    template void _S_string_copy(const S&, C*, allocator<C>::size_type);
- #endif
  
  } // std
  
--- 221,275 ----
Index: src/misc-inst.cc
===================================================================
RCS file: /cvs/gcc/egcs/libstdc++-v3/src/misc-inst.cc,v
retrieving revision 1.2
diff -u -p -c -p -r1.2 misc-inst.cc
*** misc-inst.cc	2000/04/28 02:53:12	1.2
--- misc-inst.cc	2000/06/15 06:35:48
***************
*** 1,6 ****
  // Explicit instantiation file.
  
! // Copyright (C) 1997-1999 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 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
*************** namespace std {
*** 185,190 ****
--- 185,220 ----
    template class basic_ostringstream<wchar_t>; 
  #endif
  
+ 
+   //
+   // string related to iostreams
+   //
+   template 
+     basic_istream<char>& 
+     operator>>(basic_istream<char>&, string&);
+   template 
+     basic_ostream<char>& 
+     operator<<(basic_ostream<char>&, const string&);
+   template 
+     basic_istream<char>& 
+     getline(basic_istream<char>&, string&, char);
+   template 
+     basic_istream<char>& 
+     getline(basic_istream<char>&, string&);
+ #ifdef _GLIBCPP_USE_WCHAR_T
+   template 
+     basic_istream<wchar_t>& 
+     operator>>(basic_istream<wchar_t>&, wstring&);
+   template 
+     basic_ostream<wchar_t>& 
+     operator<<(basic_ostream<wchar_t>&, const wstring&);
+   template 
+     basic_istream<wchar_t>& 
+     getline(basic_istream<wchar_t>&, wstring&, wchar_t);
+   template 
+     basic_istream<wchar_t>& 
+     getline(basic_istream<wchar_t>&, wstring&);
+ #endif
  
    //
    // algorithm

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