aboutsummaryrefslogtreecommitdiff
path: root/gcc/c-common.c
diff options
context:
space:
mode:
authorIan Lance Taylor <ian@airs.com>2005-04-17 21:27:47 +0000
committerIan Lance Taylor <ian@gcc.gnu.org>2005-04-17 21:27:47 +0000
commit03a0866432efadc888d6a65651943b89e2ae6eb0 (patch)
tree8d0efbde4233e83950ce2bef9c8a5c3377334df2 /gcc/c-common.c
parent81a60083ea5e7aa3ccd994dd6fefc3d4099303af (diff)
downloadgcc-03a0866432efadc888d6a65651943b89e2ae6eb0.zip
gcc-03a0866432efadc888d6a65651943b89e2ae6eb0.tar.gz
gcc-03a0866432efadc888d6a65651943b89e2ae6eb0.tar.bz2
c-common.def (SIZEOF_EXPR, [...]): Remove.
./ * c-common.def (SIZEOF_EXPR, ARROW_EXPR, ALIGNOF_EXPR): Remove. * c-common.c (c_sizeof_or_alignof_type): Change second parameter from enum tree_code op to bool is_sizeof. * c-common.h (c_sizeof_or_alignof_type): Update declaration. (c_sizeof, c_alignof): Update calls to c_sizeof_or_alignof_type. * c-pretty-print.c (pp_c_postfix_expression): Remove ARROW_EXPR case. (pp_c_unary_expression): Remove SIZEOF_EXPR and ALIGNOF_EXPR cases. (pp_c_expression): Remove ARROW_EXPR, SIZEOF_EXPR, and ALIGNOF_EXPR cases. cp/ * cp-tree.def: Add SIZEOF_EXPR, ARROW_EXPR and ALIGNOF_EXPR. * cxx-pretty-print.c (pp_cxx_postfix_expression): Handle ARROW_EXPR. (pp_cxx_unary_expression): Handle SIZEOF_EXPR and ALIGNOF_EXPR. (pp_cxx_expression): Handle ARROW_EXPR, SIZEOF_EXPR, and ALIGNOF_EXPR. * typeck.c (cxx_sizeof_or_alignof_type): Update call to c_sizeof_or_alignof_type for change in parameter type. From-SVN: r98297
Diffstat (limited to 'gcc/c-common.c')
-rw-r--r--gcc/c-common.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/gcc/c-common.c b/gcc/c-common.c
index da6be4e..7f1ac51 100644
--- a/gcc/c-common.c
+++ b/gcc/c-common.c
@@ -2786,19 +2786,19 @@ c_common_get_alias_set (tree t)
second parameter indicates which OPERATOR is being applied. The COMPLAIN
flag controls whether we should diagnose possibly ill-formed
constructs or not. */
+
tree
-c_sizeof_or_alignof_type (tree type, enum tree_code op, int complain)
+c_sizeof_or_alignof_type (tree type, bool is_sizeof, int complain)
{
const char *op_name;
tree value = NULL;
enum tree_code type_code = TREE_CODE (type);
- gcc_assert (op == SIZEOF_EXPR || op == ALIGNOF_EXPR);
- op_name = op == SIZEOF_EXPR ? "sizeof" : "__alignof__";
+ op_name = is_sizeof ? "sizeof" : "__alignof__";
if (type_code == FUNCTION_TYPE)
{
- if (op == SIZEOF_EXPR)
+ if (is_sizeof)
{
if (complain && (pedantic || warn_pointer_arith))
pedwarn ("invalid application of %<sizeof%> to a function type");
@@ -2823,7 +2823,7 @@ c_sizeof_or_alignof_type (tree type, enum tree_code op, int complain)
}
else
{
- if (op == (enum tree_code) SIZEOF_EXPR)
+ if (is_sizeof)
/* Convert in case a char is more than one unit. */
value = size_binop (CEIL_DIV_EXPR, TYPE_SIZE_UNIT (type),
size_int (TYPE_PRECISION (char_type_node)