aboutsummaryrefslogtreecommitdiff
path: root/gcc/explow.c
diff options
context:
space:
mode:
authorJason Merrill <jason@redhat.com>2002-08-02 07:57:22 -0400
committerJason Merrill <jason@gcc.gnu.org>2002-08-02 07:57:22 -0400
commita77a9a18c058d41eeb634e6c6a6f56d9bae04d55 (patch)
tree72cdfa1019e7a95a9c990b7e0b9711b69f589e01 /gcc/explow.c
parent367aa58580632b0bef67f5bbcc41009eb8a09381 (diff)
downloadgcc-a77a9a18c058d41eeb634e6c6a6f56d9bae04d55.zip
gcc-a77a9a18c058d41eeb634e6c6a6f56d9bae04d55.tar.gz
gcc-a77a9a18c058d41eeb634e6c6a6f56d9bae04d55.tar.bz2
langhooks-def.h (LANG_HOOKS_EXPR_SIZE): New macro.
* langhooks-def.h (LANG_HOOKS_EXPR_SIZE): New macro. * langhooks.c (lhd_expr_size): Define default. * langhooks.h (struct lang_hooks): Add expr_size. * explow.c (expr_size): Call it. * expr.c (store_expr): Don't copy an expression of size zero. (expand_expr) [CONSTRUCTOR]: Use expr_size to calculate how much to store. * Makefile.in (builtins.o): Depend on langhooks.h. * cp-lang.c (LANG_HOOKS_EXPR_SIZE): Define. (cp_expr_size): New fn. * call.c (build_over_call): Lose empty class hackery. (convert_arg_to_ellipsis): Promote non-POD warning to error. * typeck.c (build_modify_expr): Don't use save_expr on an lvalue. From-SVN: r55983
Diffstat (limited to 'gcc/explow.c')
-rw-r--r--gcc/explow.c10
1 files changed, 2 insertions, 8 deletions
diff --git a/gcc/explow.c b/gcc/explow.c
index 3cda410..5bc3451 100644
--- a/gcc/explow.c
+++ b/gcc/explow.c
@@ -34,6 +34,7 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#include "insn-config.h"
#include "ggc.h"
#include "recog.h"
+#include "langhooks.h"
static rtx break_out_memory_refs PARAMS ((rtx));
static void emit_stack_probe PARAMS ((rtx));
@@ -285,20 +286,13 @@ rtx
expr_size (exp)
tree exp;
{
- tree size;
-
- if (TREE_CODE_CLASS (TREE_CODE (exp)) == 'd'
- && DECL_SIZE_UNIT (exp) != 0)
- size = DECL_SIZE_UNIT (exp);
- else
- size = size_in_bytes (TREE_TYPE (exp));
+ tree size = (*lang_hooks.expr_size) (exp);
if (TREE_CODE (size) != INTEGER_CST
&& contains_placeholder_p (size))
size = build (WITH_RECORD_EXPR, sizetype, size, exp);
return expand_expr (size, NULL_RTX, TYPE_MODE (sizetype), 0);
-
}
/* Return a copy of X in which all memory references