diff options
author | Douglas Gregor <doug.gregor@gmail.com> | 2006-10-16 19:08:22 +0000 |
---|---|---|
committer | Benjamin Kosnik <bkoz@gcc.gnu.org> | 2006-10-16 19:08:22 +0000 |
commit | 499c96f56b64575eb6dbb7ae0d8b88aca7691e7f (patch) | |
tree | 97aa987e97c9fa8875bbd7caafc23bdc6db11927 /libstdc++-v3/scripts | |
parent | 5f90c88f61f38c8b08a7d3883ed0b1943b8e2dc2 (diff) | |
download | gcc-499c96f56b64575eb6dbb7ae0d8b88aca7691e7f.zip gcc-499c96f56b64575eb6dbb7ae0d8b88aca7691e7f.tar.gz gcc-499c96f56b64575eb6dbb7ae0d8b88aca7691e7f.tar.bz2 |
Makefile.am (tr1_headers): Add new tuple_defs.h.
2006-10-16 Douglas Gregor <doug.gregor@gmail.com>
* include/Makefile.am (tr1_headers): Add new tuple_defs.h.
* include/Makefile.in (tr1_headers): Regenerate.
* include/tr1/tuple (tuple): Move declaration to tuple_defs.h.
(get): Ditto.
(operator==): Ditto.
(operator<): Ditto.
(operator!=): Ditto.
(operator>): Ditto.
(operator<=): Ditto.
(operator>=): Ditto.
(__stripped_tuple_type): Ditto.
Include tuple.defs.h
* include/tr1/tuple_iterate.h (tuple): Use
_GLIBCXX_TUPLE_ALL_TEMPLATE_PARAMS_UNNAMED macro instead of 10
"typename"s.
(tuple_element): Use _GLIBCXX_TUPLE_ALL_TEMPLATE_PARAMS and
_GLIBCXX_TYPLE_ALL_TEMPLATE_ARGS instead of 10
parameters/arguments.
* include/tr1/tuple_defs.h: New header, contains declarations and
definitions for the tuple template with all arguments.
* include/tr1/repeat.h (_GLIBCXX_TUPLE_ALL_TEMPLATE_PARAMS): New.
(_GLIBCXX_TUPLE_ALL_TEMPLATE_PARAMS_UNNAMED): New.
(_GLIBCXX_TUPLE_ALL_TEMPLATE_ARGS): New.
(_GLIBCXX_TEMPLATE_PARAMS_NULL_CLASS): New.
(_GLIBCXX_TEMPLATE_ARGS_STRIPPED): New.
* scripts/gen_includers.pl: Update.
* scripts/gen_includers2.pl: New.
From-SVN: r117790
Diffstat (limited to 'libstdc++-v3/scripts')
-rw-r--r-- | libstdc++-v3/scripts/gen_includers.pl | 32 | ||||
-rw-r--r-- | libstdc++-v3/scripts/gen_includers2.pl | 31 |
2 files changed, 56 insertions, 7 deletions
diff --git a/libstdc++-v3/scripts/gen_includers.pl b/libstdc++-v3/scripts/gen_includers.pl index bfc3a7e..477f028 100644 --- a/libstdc++-v3/scripts/gen_includers.pl +++ b/libstdc++-v3/scripts/gen_includers.pl @@ -4,6 +4,7 @@ use English; $max = shift @ARGV; $template_params = "typename _T1"; +$template_params_unnamed = "typename"; $template_args = "_T1"; $params = "_T1 __a1"; $ref_params = "_T1& __a1"; @@ -16,6 +17,8 @@ $bind_v_args = "_Mu<_T1>()(_M_arg1, ::std::tr1::tie(_GLIBCXX_BIND_ARGS))"; $tuple_add_cref = "typename __add_c_ref<_T1>::type __a1"; $tuple_copy_init = "_M_arg1(__in._M_arg1)"; $tuple_assign = "_M_arg1 = __in._M_arg1;"; +$template_params_null_class = "typename _T1 = _NullClass"; +$template_args_stripped = "typename __strip_reference_wrapper<_T1>::__type"; $template_params_u = "typename _U1"; $template_args_u = "_U1"; $ref_wrap_params = "ref(__a1)"; @@ -28,6 +31,7 @@ for ($num_args = 2; $num_args <= $max; ++$num_args) { $params_shifted = $params; $args_shifted = $args; $template_params .= ", typename _T$num_args"; + $template_params_unnamed .= ", typename"; $template_args .= ", _T$num_args"; $params .= ", _T$num_args __a$num_args"; $ref_params .=", _T$num_args& __a$num_args"; @@ -40,11 +44,16 @@ for ($num_args = 2; $num_args <= $max; ++$num_args) { $tuple_add_cref .= ", typename __add_c_ref<_T$num_args>::type __a$num_args"; $tuple_copy_init .= ", _M_arg$num_args(__in._M_arg$num_args)"; $tuple_assign .= " _M_arg$num_args = __in._M_arg$num_args;"; + $template_params_null_class .= ", typename _T$num_args = _NullClass"; + $template_args_stripped .= ", typename __strip_reference_wrapper<_T$num_args>::__type"; $template_params_u .= ", typename _U$num_args"; $template_args_u .= ", _U$num_args"; $ref_wrap_params .= ", ref(__a$num_args)"; $ref_template_args .= ", _T$num_args&"; + if ($num_args == $max) { + print "#define _GLIBCXX_LAST_INCLUDE\n" + } print "#define _GLIBCXX_NUM_ARGS $num_args\n"; print "#define _GLIBCXX_COMMA ,\n"; print "#define _GLIBCXX_TEMPLATE_PARAMS $template_params\n"; @@ -65,25 +74,23 @@ for ($num_args = 2; $num_args <= $max; ++$num_args) { print "#define _GLIBCXX_TUPLE_ADD_CREF $tuple_add_cref\n"; print "#define _GLIBCXX_TUPLE_COPY_INIT $tuple_copy_init\n"; print "#define _GLIBCXX_TUPLE_ASSIGN $tuple_assign\n"; + print "#define _GLIBCXX_TEMPLATE_PARAMS_NULL_CLASS $template_params_null_class\n"; + print "#define _GLIBCXX_TEMPLATE_ARGS_STRIPPED $template_args_stripped\n"; print "#define _GLIBCXX_TEMPLATE_PARAMS_U $template_params_u\n"; print "#define _GLIBCXX_TEMPLATE_ARGS_U $template_args_u\n"; print "#define _GLIBCXX_REF_WRAP_PARAMS $ref_wrap_params\n"; print "#define _GLIBCXX_REF_TEMPLATE_ARGS $ref_template_args\n"; print "#define _GLIBCXX_NUM_ARGS_PLUS_1 $next_args\n"; print "#define _GLIBCXX_T_NUM_ARGS_PLUS_1 _T$next_args\n"; - if ($num_args == $max) { - print "#define _GLIBCXX_LAST_INCLUDE\n" - } print "#include _GLIBCXX_REPEAT_HEADER\n"; - if ($num_args == $max) { - print "#undef _GLIBCXX_LAST_INCLUDE\n" - } print "#undef _GLIBCXX_T_NUM_ARGS_PLUS_1\n"; print "#undef _GLIBCXX_NUM_ARGS_PLUS_1\n"; print "#undef _GLIBCXX_REF_TEMPLATE_ARGS\n"; print "#undef _GLIBCXX_REF_WRAP_PARAMS\n"; print "#undef _GLIBCXX_TEMPLATE_ARGS_U\n"; print "#undef _GLIBCXX_TEMPLATE_PARAMS_U\n"; + print "#undef _GLIBCXX_TEMPLATE_ARGS_STRIPPED\n"; + print "#undef _GLIBCXX_TEMPLATE_PARAMS_NULL_CLASS\n"; print "#undef _GLIBCXX_TUPLE_ASSIGN\n"; print "#undef _GLIBCXX_TUPLE_COPY_INIT\n"; print "#undef _GLIBCXX_TUPLE_ADD_CREF\n"; @@ -104,5 +111,16 @@ for ($num_args = 2; $num_args <= $max; ++$num_args) { print "#undef _GLIBCXX_TEMPLATE_PARAMS\n"; print "#undef _GLIBCXX_COMMA\n"; print "#undef _GLIBCXX_NUM_ARGS\n"; - print "\n"; + if ($num_args == $max) { + print "#undef _GLIBCXX_LAST_INCLUDE\n" + } } + +print "\n"; +print "#ifndef _GLIBCXX_TUPLE_ALL_TEMPLATE_PARAMS\n"; +print "# define _GLIBCXX_TUPLE_ALL_TEMPLATE_PARAMS $template_params\n"; +print "# define _GLIBCXX_TUPLE_ALL_TEMPLATE_PARAMS_UNNAMED $template_params_unnamed\n"; +print "# define _GLIBCXX_TUPLE_ALL_TEMPLATE_ARGS $template_args\n"; +print "#endif\n"; +print "\n"; + diff --git a/libstdc++-v3/scripts/gen_includers2.pl b/libstdc++-v3/scripts/gen_includers2.pl new file mode 100644 index 0000000..88e9bec --- /dev/null +++ b/libstdc++-v3/scripts/gen_includers2.pl @@ -0,0 +1,31 @@ +#!/usr/bin/perl -w +use English; + +$max = shift @ARGV; + +$template_params = "typename _U1"; +$template_args = "_U1"; +$params = "_U1& __u1"; +$args = "__u1"; + +for ($num_args = 2; $num_args <= $max; ++$num_args) { + $template_params .= ", typename _U$num_args"; + $template_args .= ", _U$num_args"; + $params .= ", _U$num_args& __u$num_args"; + $args .= ", __u$num_args"; + print "#define _GLIBCXX_BIND_NUM_ARGS $num_args\n"; + print "#define _GLIBCXX_BIND_COMMA ,\n"; + print "#define _GLIBCXX_BIND_TEMPLATE_PARAMS $template_params\n"; + print "#define _GLIBCXX_BIND_TEMPLATE_ARGS $template_args\n"; + print "#define _GLIBCXX_BIND_PARAMS $params\n"; + print "#define _GLIBCXX_BIND_ARGS $args\n"; + print "#include _GLIBCXX_BIND_REPEAT_HEADER\n"; + print "#undef _GLIBCXX_BIND_ARGS\n"; + print "#undef _GLIBCXX_BIND_PARAMS\n"; + print "#undef _GLIBCXX_BIND_TEMPLATE_ARGS\n"; + print "#undef _GLIBCXX_BIND_TEMPLATE_PARAMS\n"; + print "#undef _GLIBCXX_BIND_COMMA\n"; + print "#undef _GLIBCXX_BIND_NUM_ARGS\n"; + print "\n"; +} + |