From: Siddhi Tadpatrikar Date: Sat, 12 Feb 2011 00:18:53 +0000 (-0500) Subject: Added API functions for checking types of signed and unsigned ints X-Git-Tag: release-v1.1~9^2~13^2~1 X-Git-Url: https://git.fsl.cs.stonybrook.edu/?a=commitdiff_plain;h=a8afef4d4376cbc221cbdd00ae8729e71be96a4e;p=interaspect.git Added API functions for checking types of signed and unsigned ints --- diff --git a/src/aop-type.c b/src/aop-type.c index c9d2194..f88a670 100644 --- a/src/aop-type.c +++ b/src/aop-type.c @@ -730,6 +730,25 @@ is_all_integer_type (const struct aop_type *type) && type->pointer_levels == 0 && type->size <= 0); } +/* Returns true if the specified type is a "signed integer" which is + NOT 128 bits integer */ +int +aop_is_all_signed_subtype (const struct aop_type *type) +{ + return (type->kind == ATK_SIGNED_INT + && type->pointer_levels == 0 && type->size <= 8); +} + +/* Returns true if the specified type is a "unsigned integer" which is + NOT 128 bits integer */ +int +aop_is_all_unsigned_subtype (const struct aop_type *type) +{ + return (type->kind == ATK_UNSIGNED_INT + && type->pointer_levels == 0 && type->size <= 8); +} + + /* Returns true if specified type is an "all fp" type. */ bool is_all_fp_type (const struct aop_type *type) diff --git a/src/aop.h b/src/aop.h index 55ef370..a0d1549 100644 --- a/src/aop.h +++ b/src/aop.h @@ -209,6 +209,8 @@ extern const struct aop_type *aop_t_enum (const char *tag); extern const struct aop_type *aop_t_pointer_to (const struct aop_type *type); extern int aop_is_pointer_type (const struct aop_type *type); +extern int aop_is_all_signed_integer_type (const struct aop_type *type); +extern int aop_is_all_unsigned_integer_type (const struct aop_type *type); extern void aop_cast_to_all_pointer (struct aop_dynval *dv); extern const struct aop_type *aop_get_dynval_type (struct aop_dynval *dv);