/* Language-level data type conversion for GNU C.
- Copyright (C) 1987, 1988, 1991, 1998, 2002, 2007, 2008
+ Copyright (C) 1987, 1988, 1991, 1998, 2002, 2007, 2008, 2010
Free Software Foundation, Inc.
This file is part of GCC.
#include "tree.h"
#include "flags.h"
#include "convert.h"
-#include "toplev.h" /* For error. */
+#include "diagnostic-core.h" /* For error. */
#include "gfortran.h"
#include "trans.h"
return expr;
if (TYPE_MAIN_VARIANT (type) == TYPE_MAIN_VARIANT (TREE_TYPE (expr)))
- return fold_build1 (NOP_EXPR, type, expr);
+ return fold_build1_loc (input_location, NOP_EXPR, type, expr);
if (TREE_CODE (TREE_TYPE (expr)) == ERROR_MARK)
return error_mark_node;
if (TREE_CODE (TREE_TYPE (expr)) == VOID_TYPE)
return error_mark_node;
}
if (code == VOID_TYPE)
- return fold_build1 (CONVERT_EXPR, type, e);
+ return fold_build1_loc (input_location, CONVERT_EXPR, type, e);
#if 0
/* This is incorrect. A truncation can't be stripped this way.
Extensions will be stripped by the use of get_unwidened. */
/* If we have a NOP_EXPR, we must fold it here to avoid
infinite recursion between fold () and convert (). */
if (TREE_CODE (e) == NOP_EXPR)
- return fold_build1 (NOP_EXPR, type, TREE_OPERAND (e, 0));
+ return fold_build1_loc (input_location, NOP_EXPR, type,
+ TREE_OPERAND (e, 0));
else
- return fold_build1 (NOP_EXPR, type, e);
+ return fold_build1_loc (input_location, NOP_EXPR, type, e);
}
if (code == POINTER_TYPE || code == REFERENCE_TYPE)
return fold (convert_to_pointer (type, e));