summaryrefslogtreecommitdiff
path: root/gcc/c-tree.h
diff options
context:
space:
mode:
authorrms <rms@138bc75d-0d04-0410-961f-82ee72b054a4>1992-07-23 06:06:34 +0000
committerrms <rms@138bc75d-0d04-0410-961f-82ee72b054a4>1992-07-23 06:06:34 +0000
commitad9afbbd2fd2d6ae68c706717b46983f122d7927 (patch)
tree643042727dc13cf9e93b1afeed92b9b862a730c9 /gcc/c-tree.h
parent53c1961f056d326237edd750dcf23e66a973a27e (diff)
downloadgcc-ad9afbbd2fd2d6ae68c706717b46983f122d7927.tar.gz
(C_PROMOTING_INTEGER_TYPE_P): New macro.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@1667 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/c-tree.h')
-rw-r--r--gcc/c-tree.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/gcc/c-tree.h b/gcc/c-tree.h
index b476534b024..353038b11e9 100644
--- a/gcc/c-tree.h
+++ b/gcc/c-tree.h
@@ -100,6 +100,17 @@ struct lang_type
TYPE_ARG_TYPES for functions with prototypes, but created for functions
without prototypes. */
#define TYPE_ACTUAL_ARG_TYPES(NODE) TYPE_NONCOPIED_PARTS (NODE)
+
+/* Nonzero if the type T promotes to itself.
+ ANSI C states explicitly the list of types that promote;
+ in particular, short promotes to int even if they have the same width. */
+#define C_PROMOTING_INTEGER_TYPE_P(t) \
+ (TREE_CODE ((t)) == INTEGER_TYPE \
+ && (TYPE_MAIN_VARIANT (t) == char_type_node \
+ || TYPE_MAIN_VARIANT (t) == signed_char_type_node \
+ || TYPE_MAIN_VARIANT (t) == unsigned_char_type_node \
+ || TYPE_MAIN_VARIANT (t) == short_integer_type_node \
+ || TYPE_MAIN_VARIANT (t) == short_unsigned_type_node))
/* in c-typecheck.c */
extern tree build_component_ref (), build_conditional_expr (), build_compound_expr ();