Utility to check for castability.
This commit is contained in:
@@ -1018,6 +1018,22 @@ Type* ArrayToPtr (Type* T)
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
int IsClassArithmetic (const Type* T)
|
||||||
|
/* Return true if this is an arithmetic type */
|
||||||
|
{
|
||||||
|
return IsClassInt (T) || IsClassFloat (T);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
int IsCastType (const Type* T)
|
||||||
|
/* Return true if this type can be used for casting */
|
||||||
|
{
|
||||||
|
return IsClassArithmetic (T) || IsClassPtr (T) || IsTypeVoid (T);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
int IsVariadicFunc (const Type* T)
|
int IsVariadicFunc (const Type* T)
|
||||||
/* Return true if this is a function type or pointer to function type with
|
/* Return true if this is a function type or pointer to function type with
|
||||||
** variable parameter list
|
** variable parameter list
|
||||||
|
|||||||
@@ -578,6 +578,12 @@ INLINE int IsClassFunc (const Type* T)
|
|||||||
# define IsClassFunc(T) (GetClass (T) == T_CLASS_FUNC)
|
# define IsClassFunc(T) (GetClass (T) == T_CLASS_FUNC)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
int IsClassArithmetic (const Type* T);
|
||||||
|
/* Return true if this is an arithmetic type */
|
||||||
|
|
||||||
|
int IsCastType (const Type* T);
|
||||||
|
/* Return true if this type can be used for casting */
|
||||||
|
|
||||||
#if defined(HAVE_INLINE)
|
#if defined(HAVE_INLINE)
|
||||||
INLINE TypeCode GetRawSignedness (const Type* T)
|
INLINE TypeCode GetRawSignedness (const Type* T)
|
||||||
/* Get the raw signedness of a type */
|
/* Get the raw signedness of a type */
|
||||||
|
|||||||
Reference in New Issue
Block a user