Significantly reduce code size of programs which use string, complex,
or the Allocator heavily. (For common types, these are already instantiated in libstdc++, and do not need implicit instantiation.)
This commit is contained in:
parent
d8f58a3506
commit
ef1a003862
9
gnu/dist/libstdc++/std/bastring.h
vendored
9
gnu/dist/libstdc++/std/bastring.h
vendored
@ -615,6 +615,15 @@ getline (istream&, basic_string <charT, traits, Allocator>&, charT delim = '\n')
|
||||
|
||||
} // extern "C++"
|
||||
|
||||
#ifdef __GNUG__
|
||||
#define __INST char
|
||||
#include <std/bastring_inst.h>
|
||||
#undef __INST
|
||||
#define __INST wchar_t
|
||||
#include <std/bastring_inst.h>
|
||||
#undef __INST
|
||||
#endif
|
||||
|
||||
#include <std/bastring.cc>
|
||||
|
||||
#endif
|
||||
|
31
gnu/dist/libstdc++/std/bastring_inst.h
vendored
Normal file
31
gnu/dist/libstdc++/std/bastring_inst.h
vendored
Normal file
@ -0,0 +1,31 @@
|
||||
// GNU C++ "extern" instantiation declarations for basic_string.
|
||||
|
||||
extern template class string_char_traits <__INST>;
|
||||
extern template class basic_string <__INST>;
|
||||
|
||||
extern template basic_string<__INST> operator+ (const basic_string<__INST>&, const basic_string<__INST>&);
|
||||
extern template basic_string<__INST> operator+ (const __INST*, const basic_string<__INST>&);
|
||||
extern template basic_string<__INST> operator+ (__INST, const basic_string<__INST>&);
|
||||
extern template basic_string<__INST> operator+ (const basic_string<__INST>&, const __INST*);
|
||||
extern template basic_string<__INST> operator+ (const basic_string<__INST>&, __INST);
|
||||
extern template bool operator== (const basic_string<__INST>&, const basic_string<__INST>&);
|
||||
extern template bool operator== (const __INST*, const basic_string<__INST>&);
|
||||
extern template bool operator== (const basic_string<__INST>&, const __INST*);
|
||||
extern template bool operator!= (const basic_string<__INST>&, const basic_string<__INST>&);
|
||||
extern template bool operator!= (const __INST*, const basic_string<__INST>&);
|
||||
extern template bool operator!= (const basic_string<__INST>&, const __INST*);
|
||||
extern template bool operator< (const basic_string<__INST>&, const basic_string<__INST>&);
|
||||
extern template bool operator< (const __INST*, const basic_string<__INST>&);
|
||||
extern template bool operator< (const basic_string<__INST>&, const __INST*);
|
||||
extern template bool operator> (const basic_string<__INST>&, const basic_string<__INST>&);
|
||||
extern template bool operator> (const __INST*, const basic_string<__INST>&);
|
||||
extern template bool operator> (const basic_string<__INST>&, const __INST*);
|
||||
extern template bool operator<= (const basic_string<__INST>&, const basic_string<__INST>&);
|
||||
extern template bool operator<= (const __INST*, const basic_string<__INST>&);
|
||||
extern template bool operator<= (const basic_string<__INST>&, const __INST*);
|
||||
extern template bool operator>= (const basic_string<__INST>&, const basic_string<__INST>&);
|
||||
extern template bool operator>= (const __INST*, const basic_string<__INST>&);
|
||||
extern template bool operator>= (const basic_string<__INST>&, const __INST*);
|
||||
extern template istream& operator>> (istream&, basic_string<__INST>&);
|
||||
extern template ostream& operator<< (ostream&, const basic_string<__INST>&);
|
||||
extern template istream& getline (istream&, basic_string<__INST>&, __INST);
|
12
gnu/dist/libstdc++/std/complext.h
vendored
12
gnu/dist/libstdc++/std/complext.h
vendored
@ -397,4 +397,16 @@ template <class _FLT> ostream& operator << (ostream&, const complex<_FLT>&);
|
||||
#include <std/dcomplex.h>
|
||||
#include <std/ldcomplex.h>
|
||||
|
||||
#ifdef __GNUG__
|
||||
#define __INST float
|
||||
#include <std/complext_inst.h>
|
||||
#undef __INST
|
||||
#define __INST double
|
||||
#include <std/complext_inst.h>
|
||||
#undef __INST
|
||||
#define __INST long double
|
||||
#include <std/complext_inst.h>
|
||||
#undef __INST
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
46
gnu/dist/libstdc++/std/complext_inst.h
vendored
Normal file
46
gnu/dist/libstdc++/std/complext_inst.h
vendored
Normal file
@ -0,0 +1,46 @@
|
||||
// GNU C++ "extern" instantiation declarations for complex.
|
||||
|
||||
extern template class complex<__INST>;
|
||||
|
||||
extern template complex <__INST>& __doapl (complex <__INST>*, const complex <__INST>&);
|
||||
extern template complex <__INST>& __doaml (complex <__INST>*, const complex <__INST>&);
|
||||
extern template complex <__INST>& __doami (complex <__INST>*, const complex <__INST>&);
|
||||
extern template complex <__INST>& __doadv (complex <__INST>*, const complex <__INST>&);
|
||||
extern template complex <__INST> operator+ (const complex <__INST>&, const complex <__INST>&);
|
||||
extern template complex <__INST> operator+ (const complex <__INST>&, __INST);
|
||||
extern template complex <__INST> operator+ (__INST, const complex <__INST>&);
|
||||
extern template complex <__INST> operator- (const complex <__INST>&, const complex <__INST>&);
|
||||
extern template complex <__INST> operator- (const complex <__INST>&, __INST);
|
||||
extern template complex <__INST> operator- (__INST, const complex <__INST>&);
|
||||
extern template complex <__INST> operator* (const complex <__INST>&, const complex <__INST>&);
|
||||
extern template complex <__INST> operator* (const complex <__INST>&, __INST);
|
||||
extern template complex <__INST> operator* (__INST, const complex <__INST>&);
|
||||
extern template complex <__INST> operator/ (const complex <__INST>&, const complex <__INST>&);
|
||||
extern template complex <__INST> operator/ (const complex <__INST>&, __INST);
|
||||
extern template complex <__INST> operator/ (__INST, const complex <__INST>&);
|
||||
extern template complex <__INST> operator+ (const complex <__INST>&);
|
||||
extern template complex <__INST> operator- (const complex <__INST>&);
|
||||
extern template bool operator== (const complex <__INST>&, const complex <__INST>&);
|
||||
extern template bool operator== (const complex <__INST>&, __INST);
|
||||
extern template bool operator== (__INST, const complex <__INST>&);
|
||||
extern template bool operator!= (const complex <__INST>&, const complex <__INST>&);
|
||||
extern template bool operator!= (const complex <__INST>&, __INST);
|
||||
extern template bool operator!= (__INST, const complex <__INST>&);
|
||||
extern template __INST abs (const complex <__INST>&);
|
||||
extern template __INST arg (const complex <__INST>&);
|
||||
extern template complex <__INST> polar (__INST, __INST);
|
||||
extern template complex <__INST> conj (const complex <__INST>&);
|
||||
extern template __INST norm (const complex <__INST>&);
|
||||
extern template complex <__INST> cos (const complex <__INST>&);
|
||||
extern template complex <__INST> cosh (const complex <__INST>&);
|
||||
extern template complex <__INST> exp (const complex <__INST>&);
|
||||
extern template complex <__INST> log (const complex <__INST>&);
|
||||
extern template complex <__INST> pow (const complex <__INST>&, const complex <__INST>&);
|
||||
extern template complex <__INST> pow (const complex <__INST>&, __INST);
|
||||
extern template complex <__INST> pow (const complex <__INST>&, int);
|
||||
extern template complex <__INST> pow (__INST, const complex <__INST>&);
|
||||
extern template complex <__INST> sin (const complex <__INST>&);
|
||||
extern template complex <__INST> sinh (const complex <__INST>&);
|
||||
extern template complex <__INST> sqrt (const complex <__INST>&);
|
||||
extern template istream& operator>> (istream&, complex<__INST>&);
|
||||
extern template ostream& operator<< (ostream&, const complex<__INST>&);
|
6
gnu/dist/libstdc++/stl/stl_alloc.h
vendored
6
gnu/dist/libstdc++/stl/stl_alloc.h
vendored
@ -691,6 +691,12 @@ __STL_END_NAMESPACE
|
||||
|
||||
#undef __PRIVATE
|
||||
|
||||
#ifdef __GNUG__
|
||||
// instantiated in stlinst.cc
|
||||
extern template __malloc_alloc_template<0>;
|
||||
extern template __default_alloc_template<__NODE_ALLOCATOR_THREADS, 0>;
|
||||
#endif
|
||||
|
||||
#endif /* __SGI_STL_INTERNAL_ALLOC_H */
|
||||
|
||||
// Local Variables:
|
||||
|
@ -1,9 +1,10 @@
|
||||
# $NetBSD: Makefile,v 1.2 1998/08/28 15:31:30 tv Exp $
|
||||
# $NetBSD: Makefile,v 1.3 1999/01/19 15:27:24 tv Exp $
|
||||
|
||||
NOPROG= yes
|
||||
|
||||
INCS= bastring.cc bastring.h complext.cc complext.h dcomplex.h fcomplex.h \
|
||||
ldcomplex.h straits.h
|
||||
INCS+= bastring_inst.h complext_inst.h
|
||||
INCSDIR=/usr/include/g++/std
|
||||
|
||||
.PATH: ${.CURDIR}/../../../dist/libstdc++/std
|
||||
|
Loading…
Reference in New Issue
Block a user