static tree
doradix (location_t location ATTRIBUTE_UNUSED, tree type)
{
- if (TREE_CODE (type) == REAL_TYPE)
+ if (SCALAR_FLOAT_TYPE_P (type))
{
enum machine_mode mode = TYPE_MODE (type);
int radix = REAL_MODE_FORMAT (mode)->b;
static tree
doplaces (location_t location ATTRIBUTE_UNUSED, tree type)
{
- if (TREE_CODE (type) == REAL_TYPE)
+ if (SCALAR_FLOAT_TYPE_P (type))
{
/* Taken from c-family/c-cppbuiltin.cc. */
/* The number of decimal digits, q, such that any floating-point
static tree
doexponentmin (location_t location ATTRIBUTE_UNUSED, tree type)
{
- if (TREE_CODE (type) == REAL_TYPE)
+ if (SCALAR_FLOAT_TYPE_P (type))
{
enum machine_mode mode = TYPE_MODE (type);
int emin = REAL_MODE_FORMAT (mode)->emin;
static tree
doexponentmax (location_t location ATTRIBUTE_UNUSED, tree type)
{
- if (TREE_CODE (type) == REAL_TYPE)
+ if (SCALAR_FLOAT_TYPE_P (type))
{
enum machine_mode mode = TYPE_MODE (type);
int emax = REAL_MODE_FORMAT (mode)->emax;
static tree
dolarge (location_t location ATTRIBUTE_UNUSED, tree type)
{
- if (TREE_CODE (type) == REAL_TYPE)
+ if (SCALAR_FLOAT_TYPE_P (type))
return computeLarge (type);
return NULL_TREE;
}
static tree
dosmall (location_t location ATTRIBUTE_UNUSED, tree type)
{
- if (TREE_CODE (type) == REAL_TYPE)
+ if (SCALAR_FLOAT_TYPE_P (type))
return computeSmall (type);
return NULL_TREE;
}
static tree
dogUnderflow (location_t location ATTRIBUTE_UNUSED, tree type)
{
- if (TREE_CODE (type) == REAL_TYPE)
+ if (SCALAR_FLOAT_TYPE_P (type))
{
enum machine_mode mode = TYPE_MODE (type);
const struct real_format *fmt = REAL_MODE_FORMAT (mode);
/* Warn for real constant that is not an exact integer converted to
integer type. */
- if (TREE_CODE (expr_type) == REAL_TYPE
+ if (SCALAR_FLOAT_TYPE_P (expr_type)
&& TREE_CODE (type) == INTEGER_TYPE)
{
if (!real_isinteger (TREE_REAL_CST_PTR (expr),
else
give_warning = UNSAFE_OTHER;
}
- else if (TREE_CODE (type) == REAL_TYPE)
+ else if (SCALAR_FLOAT_TYPE_P (type))
{
/* Warn for an integer constant that does not fit into real type. */
if (TREE_CODE (expr_type) == INTEGER_TYPE)
/* Warn for a real constant that does not fit into a smaller real
type. */
- else if (TREE_CODE (expr_type) == REAL_TYPE
+ else if (SCALAR_FLOAT_TYPE_P (expr_type)
&& TYPE_PRECISION (type) < TYPE_PRECISION (expr_type))
{
REAL_VALUE_TYPE a = TREE_REAL_CST (expr);
else
{
/* Warn for real types converted to integer types. */
- if (TREE_CODE (expr_type) == REAL_TYPE
+ if (SCALAR_FLOAT_TYPE_P (expr_type)
&& TREE_CODE (type) == INTEGER_TYPE)
give_warning = UNSAFE_REAL;
if (check != NULL)
result = build2 (COMPOUND_EXPR, argtype, check, result);
- if (TREE_CODE (argtype) == REAL_TYPE)
+ if (SCALAR_FLOAT_TYPE_P (argtype))
m2expr_checkRealOverflow (location, code, result);
return m2expr_FoldAndStrip (result);
if (check != NULL)
result = build2 (COMPOUND_EXPR, TREE_TYPE (result), check, result);
- if (TREE_CODE (type1) == REAL_TYPE)
+ if (SCALAR_FLOAT_TYPE_P (type1))
m2expr_checkRealOverflow (location, code, result);
return result;
}
bool
m2tree_is_var (tree var)
{
- return TREE_CODE (var) == VAR_DECL;
+ return VAR_P (var);
}
bool
if (TREE_CODE (lhs) == COMPONENT_REF
&& (TREE_CODE (lhstype) == INTEGER_TYPE
|| TREE_CODE (lhstype) == BOOLEAN_TYPE
- || TREE_CODE (lhstype) == REAL_TYPE
+ || SCALAR_FLOAT_TYPE_P (lhstype)
|| TREE_CODE (lhstype) == ENUMERAL_TYPE))
lhstype = TREE_TYPE (get_unwidened (lhs, 0));
int was_incomplete = (DECL_SIZE (decl) == 0);
m2assert_AssertLocation (location);
- if (TREE_CODE (decl) == VAR_DECL)
+ if (VAR_P (decl))
{
if (DECL_SIZE (decl) == 0 && TREE_TYPE (decl) != error_mark_node
&& COMPLETE_TYPE_P (TREE_TYPE (decl)))
functions, unless the type is an undefined structure or union. If
not, it will get done when the type is completed. */
- if (TREE_CODE (decl) == VAR_DECL || TREE_CODE (decl) == FUNCTION_DECL)
+ if (VAR_P (decl) || TREE_CODE (decl) == FUNCTION_DECL)
{
if (DECL_FILE_SCOPE_P (decl))
{
hextree (DECL_INITIAL (t));
hextree (DECL_SAVED_TREE (t));
}
- if (TREE_CODE (t) == VAR_DECL)
+ if (VAR_P (t))
{
pretty *state = initPretty (FALSE);
int has_return_type = TRUE;
tree proc;
- if (type && (TREE_CODE (type) == VOID_TYPE))
+ if (type && VOID_TYPE_P (type))
has_return_type = FALSE;
if (TREE_CODE (call) == ADDR_EXPR || TREE_CODE (call) == NON_LVALUE_EXPR)