aboutsummaryrefslogtreecommitdiff
path: root/gcc/c-common.h
diff options
context:
space:
mode:
authorGabriel Dos Reis <gdr@nerim.net>2002-07-23 13:54:06 +0000
committerGabriel Dos Reis <gdr@gcc.gnu.org>2002-07-23 13:54:06 +0000
commitfa72b06489d3674c61ce6156ac72cd12572d5fc0 (patch)
tree5a3cc29ddefe2d01107bd8557ff47770b29e7bc4 /gcc/c-common.h
parent2b773ee2c1954b982aac0ee71fd6e5ae148e4691 (diff)
downloadgcc-fa72b06489d3674c61ce6156ac72cd12572d5fc0.zip
gcc-fa72b06489d3674c61ce6156ac72cd12572d5fc0.tar.gz
gcc-fa72b06489d3674c61ce6156ac72cd12572d5fc0.tar.bz2
Fix PR/7363:
2002-07-21 Gabriel Dos Reis <gdr@nerim.net> Fix PR/7363: * c-common.c (c_sizeof_or_alignof_type): New function. (c_alignof): Remove definition. * c-common.h (c_sizeof, c_alignof): Define as macros. (c_sizeof_or_alignof_type): Declare. (my_friendly_assert): Moved from cp/cp-tree.h * c-typeck.c (c_sizeof): Remove definition. cp/ 2002-07-21 Gabriel Dos Reis <gdr@nerim.net> Fix PR/7363: * typeck.c (cxx_sizeof_or_alignof_type): New function. (c_sizeof): Remove definition. (expr_sizeof): Use cxx_sizeof. * decl2.c (build_expr_from_tree): Use cxx_sizeof_or_alignof_type. * decl.c (finish_destructor_body): Use cxx_sizeof. * semantics.c (finish_alignof): Likewise. (finish_alignof): Use cxx_alignof. * cp-tree.h (cxx_sizeof, cxx_alignof): New macros. (cxx_sizeof_or_alignof_type): Declare. (my_friendly_assert): Move to ../c-common.h. From-SVN: r55678
Diffstat (limited to 'gcc/c-common.h')
-rw-r--r--gcc/c-common.h8
1 files changed, 6 insertions, 2 deletions
diff --git a/gcc/c-common.h b/gcc/c-common.h
index 8aac857..fabfb16 100644
--- a/gcc/c-common.h
+++ b/gcc/c-common.h
@@ -548,12 +548,14 @@ extern tree c_common_signed_type PARAMS ((tree));
extern tree c_common_signed_or_unsigned_type PARAMS ((int, tree));
extern tree c_common_truthvalue_conversion PARAMS ((tree));
extern void c_apply_type_quals_to_decl PARAMS ((int, tree));
-extern tree c_sizeof PARAMS ((tree));
-extern tree c_alignof PARAMS ((tree));
+extern tree c_sizeof_or_alignof_type PARAMS ((tree, enum tree_code));
extern tree c_alignof_expr PARAMS ((tree));
/* Print an error message for invalid operands to arith operation CODE.
NOP_EXPR is used as a special case (see truthvalue_conversion). */
extern void binary_op_error PARAMS ((enum tree_code));
+#define my_friendly_assert(EXP, N) (void) \
+ (((EXP) == 0) ? (fancy_abort (__FILE__, __LINE__, __FUNCTION__), 0) : 0)
+
extern tree c_expand_expr_stmt PARAMS ((tree));
extern void c_expand_start_cond PARAMS ((tree, int, tree));
extern void c_finish_then PARAMS ((void));
@@ -573,6 +575,8 @@ extern void unsigned_conversion_warning PARAMS ((tree, tree));
/* Read the rest of the current #-directive line. */
extern char *get_directive_line PARAMS ((void));
#define GET_DIRECTIVE_LINE() get_directive_line ()
+#define c_sizeof(T) c_sizeof_or_alignof_type (T, SIZEOF_EXPR)
+#define c_alignof(T) c_sizeof_or_alignof_type (T, ALIGNOF_EXPR)
/* Subroutine of build_binary_op, used for comparison operations.
See if the operands have both been converted from subword integer types