summaryrefslogtreecommitdiff
path: root/gnu/dist/libstdc++/std
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/dist/libstdc++/std
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/dist/libstdc++/std')
-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
4 files changed, 98 insertions, 0 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>&);