summaryrefslogtreecommitdiff
path: root/gnu
diff options
context:
space:
mode:
authortv <tv@NetBSD.org>1999-01-19 15:27:24 +0000
committertv <tv@NetBSD.org>1999-01-19 15:27:24 +0000
commitef1a00386231a1a2c09a7c565cd9976703fbbc44 (patch)
treefe1ff1cf389a6deb172291293408e1a35faa061a /gnu
parentd8f58a35065838361936f7b149627618cf0843e6 (diff)
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.)
Diffstat (limited to 'gnu')
-rw-r--r--gnu/dist/libstdc++/std/bastring.h9
-rw-r--r--gnu/dist/libstdc++/std/bastring_inst.h31
-rw-r--r--gnu/dist/libstdc++/std/complext.h12
-rw-r--r--gnu/dist/libstdc++/std/complext_inst.h46
-rw-r--r--gnu/dist/libstdc++/stl/stl_alloc.h6
-rw-r--r--gnu/lib/libstdc++/std/Makefile3
6 files changed, 106 insertions, 1 deletions
diff --git a/gnu/dist/libstdc++/std/bastring.h b/gnu/dist/libstdc++/std/bastring.h
index f188628cc77..986730faacb 100644
--- a/gnu/dist/libstdc++/std/bastring.h
+++ b/gnu/dist/libstdc++/std/bastring.h
@@ -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
diff --git a/gnu/dist/libstdc++/std/bastring_inst.h b/gnu/dist/libstdc++/std/bastring_inst.h
new file mode 100644
index 00000000000..702b2bbb289
--- /dev/null
+++ b/gnu/dist/libstdc++/std/bastring_inst.h
@@ -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);
diff --git a/gnu/dist/libstdc++/std/complext.h b/gnu/dist/libstdc++/std/complext.h
index 6c55037bf94..d691622243e 100644
--- a/gnu/dist/libstdc++/std/complext.h
+++ b/gnu/dist/libstdc++/std/complext.h
@@ -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
diff --git a/gnu/dist/libstdc++/std/complext_inst.h b/gnu/dist/libstdc++/std/complext_inst.h
new file mode 100644
index 00000000000..7cc377ca7c4
--- /dev/null
+++ b/gnu/dist/libstdc++/std/complext_inst.h
@@ -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>&);
diff --git a/gnu/dist/libstdc++/stl/stl_alloc.h b/gnu/dist/libstdc++/stl/stl_alloc.h
index 2c3de40f61b..d2a35bd2ee1 100644
--- a/gnu/dist/libstdc++/stl/stl_alloc.h
+++ b/gnu/dist/libstdc++/stl/stl_alloc.h
@@ -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:
diff --git a/gnu/lib/libstdc++/std/Makefile b/gnu/lib/libstdc++/std/Makefile
index b811c7eb95f..49c0a693bcf 100644
--- a/gnu/lib/libstdc++/std/Makefile
+++ b/gnu/lib/libstdc++/std/Makefile
@@ -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