/* Code translation -- generate GCC trees from gfc_code.
- Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc.
+ Copyright (C) 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
Contributed by Paul Brook
This file is part of GCC.
#include "coretypes.h"
#include "tree.h"
#include "tree-gimple.h"
-#include <stdio.h>
#include "ggc.h"
#include "toplev.h"
#include "defaults.h"
#include "real.h"
-#include <gmp.h>
#include "gfortran.h"
#include "trans.h"
#include "trans-stmt.h"
{
tree var;
- if (TREE_CODE_CLASS (TREE_CODE (expr)) == 'c')
+ if (CONSTANT_CLASS_P (expr))
return expr;
var = gfc_create_var (TREE_TYPE (expr), NULL);
|| AGGREGATE_TYPE_P (TREE_TYPE (lhs)));
#endif
- tmp = fold (build2_v (MODIFY_EXPR, lhs, rhs));
+ tmp = fold_build2 (MODIFY_EXPR, void_type_node, lhs, rhs);
gfc_add_expr_to_block (pblock, tmp);
}
/* Create a new scope/binding level and initialize a block. Care must be
- taken when translating expessions as any temporaries will be placed in
+ taken when translating expressions as any temporaries will be placed in
the innermost scope. */
void
{
loc->lb = gfc_getmem (sizeof (gfc_linebuf));
#ifdef USE_MAPPED_LOCATION
- loc->lb->location = input_location; // FIXME adjust??
+ loc->lb->location = input_location; /* FIXME adjust?? */
#else
loc->lb->linenum = input_line - 1;
#endif
the end of this gfc_code branch. */
for (; code; code = code->next)
{
- gfc_set_backend_locus (&code->loc);
-
if (code->here != 0)
{
res = gfc_trans_label_here (code);
internal_error ("gfc_trans_code(): Bad statement code");
}
+ gfc_set_backend_locus (&code->loc);
+
if (res != NULL_TREE && ! IS_EMPTY_STMT (res))
{
if (TREE_CODE (res) == STATEMENT_LIST)
annotate_all_with_locus (&res, input_location);
else
SET_EXPR_LOCATION (res, input_location);
-
- /* Add the new statemment to the block. */
+
+ /* Add the new statement to the block. */
gfc_add_expr_to_block (&block, res);
}
}