diff options
author | aaw <aaw@138bc75d-0d04-0410-961f-82ee72b054a4> | 2007-09-29 03:47:05 +0000 |
---|---|---|
committer | aaw <aaw@138bc75d-0d04-0410-961f-82ee72b054a4> | 2007-09-29 03:47:05 +0000 |
commit | 1fab06aaf36ca06985faf4a832f50a6de6eeab58 (patch) | |
tree | 117f5e7112f351b5d67c496778a7e3a085dcdc1b /gcc/cp | |
parent | dfa26c6cc44dc1bb920d5209a45289a8c4566ea0 (diff) | |
download | gcc-1fab06aaf36ca06985faf4a832f50a6de6eeab58.tar.gz |
Revert
2007-09-27 Ollie Wild <aaw@google.com>
gcc/
* varasm.c (compare_constant): Removed call to
lang_hooks.expand_constant.
(copy_constants): Removed call to lang_hooks.expand_constant.
(compute_reloc_for_constant): Removed call to
lang_hooks.expand_constant.
(output_addressed_constants): Removed call to
lang_hooks.expand_constant.
(constructor_static_from_elts_p): Removed call to
lang_hooks.expand_constant.
(output_constant): Removed calls to lang_hooks.expand_constant.
* langhooks.h (struct lang_hooks): Removed field expand_constant.
* langhooks-def.h (lhd_return_tree): Removed.
(LANG_HOOKS_EXPAND_CONSTANT): Removed.
(LANG_HOOKS_INITIALIZER): Removed LANG_HOOKS_EXPAND_CONSTANT.
* langhooks.c (lhd_return_tree): Removed.
gcc/cp/
* typeck2.c (digest_init): Call cplus_expand_constant after
convert_for_initialization.
* cp-objcp-common.h (LANG_HOOKS_EXPAND_CONSTANT): Removed.
* expr.c (cplus_expand_constant): Updated function description.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@128881 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cp')
-rw-r--r-- | gcc/cp/ChangeLog | 10 | ||||
-rw-r--r-- | gcc/cp/cp-objcp-common.h | 2 | ||||
-rw-r--r-- | gcc/cp/expr.c | 3 | ||||
-rw-r--r-- | gcc/cp/typeck2.c | 19 |
4 files changed, 16 insertions, 18 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 44a4d901aa7..5827a57964e 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,13 @@ +2007-09-28 Ollie Wild <aaw@google.com> + + Revert + 2007-09-27 Ollie Wild <aaw@google.com> + + * typeck2.c (digest_init): Call cplus_expand_constant after + convert_for_initialization. + * cp-objcp-common.h (LANG_HOOKS_EXPAND_CONSTANT): Removed. + * expr.c (cplus_expand_constant): Updated function description. + 2007-09-28 Jason Merrill <jason@redhat.com> PR c++/10179 diff --git a/gcc/cp/cp-objcp-common.h b/gcc/cp/cp-objcp-common.h index 60d78181ad1..7f8138c6e60 100644 --- a/gcc/cp/cp-objcp-common.h +++ b/gcc/cp/cp-objcp-common.h @@ -50,6 +50,8 @@ extern tree objcp_tsubst_copy_and_build (tree, tree, tsubst_flags_t, #define LANG_HOOKS_POST_OPTIONS c_common_post_options #undef LANG_HOOKS_GET_ALIAS_SET #define LANG_HOOKS_GET_ALIAS_SET cxx_get_alias_set +#undef LANG_HOOKS_EXPAND_CONSTANT +#define LANG_HOOKS_EXPAND_CONSTANT cplus_expand_constant #undef LANG_HOOKS_EXPAND_EXPR #define LANG_HOOKS_EXPAND_EXPR cxx_expand_expr #undef LANG_HOOKS_EXPAND_DECL diff --git a/gcc/cp/expr.c b/gcc/cp/expr.c index b5186462e5e..267b847770e 100644 --- a/gcc/cp/expr.c +++ b/gcc/cp/expr.c @@ -33,7 +33,8 @@ along with GCC; see the file COPYING3. If not see #include "except.h" #include "tm_p.h" -/* Expand C++-specific constants. Currently, this means PTRMEM_CST. */ +/* Hook used by output_constant to expand language-specific + constants. */ tree cplus_expand_constant (tree cst) diff --git a/gcc/cp/typeck2.c b/gcc/cp/typeck2.c index adbe9de7541..53e22023f27 100644 --- a/gcc/cp/typeck2.c +++ b/gcc/cp/typeck2.c @@ -703,23 +703,8 @@ digest_init (tree type, tree init) /* Handle scalar types (including conversions) and references. */ if (TREE_CODE (type) != COMPLEX_TYPE && (SCALAR_TYPE_P (type) || code == REFERENCE_TYPE)) - { - tree *exp; - - init = convert_for_initialization (0, type, init, LOOKUP_NORMAL, - "initialization", NULL_TREE, 0); - exp = &init; - - /* Skip any conversions since we'll be outputting the underlying - constant. */ - while (TREE_CODE (*exp) == NOP_EXPR || TREE_CODE (*exp) == CONVERT_EXPR - || TREE_CODE (*exp) == NON_LVALUE_EXPR) - exp = &TREE_OPERAND (*exp, 0); - - *exp = cplus_expand_constant (*exp); - - return init; - } + return convert_for_initialization (0, type, init, LOOKUP_NORMAL, + "initialization", NULL_TREE, 0); /* Come here only for aggregates: records, arrays, unions, complex numbers and vectors. */ |