* trans-const.c, trans-decl.c, trans-expr.c: Spelling fixes.

From-SVN: r86385
This commit is contained in:
Tobias Schlüter 2004-08-22 22:01:22 +02:00 committed by Tobias Schlüter
parent 44e91562ed
commit f8d0aee5c1
4 changed files with 73 additions and 58 deletions

View File

@ -1,3 +1,7 @@
2004-08-22 Tobias Schlueter <tobias.schlueter@physik.uni-muenchen.de>
* trans-const.c, trans-decl.c, trans-expr.c: Spelling fixes.
2004-08-22 Tobias Schlueter <tobias.schlueter@physik.uni-muenchen.de>
* check.c (gfc_check_reduction): Rename to ...

View File

@ -46,6 +46,7 @@ tree gfc_strconst_current_filename;
tree gfc_rank_cst[GFC_MAX_DIMENSIONS + 1];
/* Build a constant with given type from an int_cst. */
tree
gfc_build_const (tree type, tree intval)
{
@ -175,7 +176,7 @@ gfc_conv_mpz_to_tree (mpz_t i, int kind)
char *q;
int n;
/* TODO: could be wrong if sizeof(HOST_WIDE_INT) |= SIZEOF (int). */
/* TODO: could be wrong if sizeof(HOST_WIDE_INT) != SIZEOF (int). */
if (mpz_fits_slong_p (i))
{
val = mpz_get_si (i);
@ -229,6 +230,7 @@ gfc_conv_mpz_to_tree (mpz_t i, int kind)
/* Converts a real constant into backend form. Uses an intermediate string
representation. */
tree
gfc_conv_mpfr_to_tree (mpfr_t f, int kind)
{
@ -343,7 +345,7 @@ gfc_conv_constant_to_tree (gfc_expr * expr)
}
/* Like gfc_conv_contrant_to_tree, but for a simplified expression.
/* Like gfc_conv_constant_to_tree, but for a simplified expression.
We can handle character literal constants here as well. */
void
@ -366,7 +368,7 @@ gfc_conv_constant (gfc_se * se, gfc_expr * expr)
/* Translate the constant and put it in the simplifier structure. */
se->expr = gfc_conv_constant_to_tree (expr);
/* If this is a CHARACTER string, set it's length in the simplifier
/* If this is a CHARACTER string, set its length in the simplifier
structure, too. */
if (expr->ts.type == BT_CHARACTER)
se->string_length = TYPE_MAX_VALUE (TYPE_DOMAIN (TREE_TYPE (se->expr)));

View File

@ -238,7 +238,7 @@ gfc_get_label_decl (gfc_st_label * lp)
label_decl = gfc_build_label_decl (get_identifier (label_name));
/* Tell the debugger where the label came from. */
if (lp->value <= MAX_LABEL_VALUE) /* An internal label */
if (lp->value <= MAX_LABEL_VALUE) /* An internal label. */
{
DECL_SOURCE_LINE (label_decl) = lp->where.lb->linenum;
DECL_SOURCE_FILE (label_decl) = lp->where.lb->file->filename;
@ -258,6 +258,7 @@ gfc_get_label_decl (gfc_st_label * lp)
static tree
gfc_sym_identifier (gfc_symbol * sym)
{
return (get_identifier (sym->name));
}
@ -375,7 +376,7 @@ gfc_finish_decl (tree decl, tree init)
static void
gfc_finish_var_decl (tree decl, gfc_symbol * sym)
{
/* TREE_ADDRESSABLE means the address of this variable is acualy needed.
/* TREE_ADDRESSABLE means the address of this variable is actually needed.
This is the equivalent of the TARGET variables.
We also need to set this if the variable is passed by reference in a
CALL statement. */
@ -427,6 +428,7 @@ gfc_finish_var_decl (tree decl, gfc_symbol * sym)
void
gfc_allocate_lang_decl (tree decl)
{
DECL_LANG_SPECIFIC (decl) = (struct lang_decl *)
ggc_alloc_cleared (sizeof (struct lang_decl));
}
@ -555,7 +557,7 @@ gfc_build_dummy_array_decl (gfc_symbol * sym, tree dummy)
assert (TREE_CODE (dummy) == PARM_DECL
&& POINTER_TYPE_P (type));
/* Do we know the element size. */
/* Do we know the element size? */
known_size = sym->ts.type != BT_CHARACTER
|| INTEGER_CST_P (sym->ts.cl->backend_decl);
@ -758,7 +760,7 @@ gfc_get_symbol_decl (gfc_symbol * sym)
/* Create the decl for the variable. */
decl = build_decl (VAR_DECL, gfc_sym_identifier (sym), gfc_sym_type (sym));
/* Symbols from modules have its assembler name should be mangled.
/* Symbols from modules should have their assembler names mangled.
This is done here rather than in gfc_finish_var_decl because it
is different for string length variables. */
if (sym->module[0])
@ -931,13 +933,13 @@ gfc_get_extern_function_decl (gfc_symbol * sym)
}
else
{
/* Global declaration, eg. intrinsic subroutine. */
/* Global declaration, e.g. intrinsic subroutine. */
DECL_CONTEXT (fndecl) = NULL_TREE;
}
DECL_EXTERNAL (fndecl) = 1;
/* This specifies if a function is globaly addressable, ie. it is
/* This specifies if a function is globally addressable, i.e. it is
the opposite of declaring static in C. */
TREE_PUBLIC (fndecl) = 1;
@ -991,7 +993,7 @@ build_function_decl (gfc_symbol * sym)
SET_DECL_ASSEMBLER_NAME (fndecl, gfc_sym_mangled_function_id (sym));
/* Figure out the return type of the declared function, and build a
RESULT_DECL for it. If this is subroutine with alternate
RESULT_DECL for it. If this is a subroutine with alternate
returns, build a RESULT_DECL for it. */
attr = sym->attr;
@ -1035,7 +1037,7 @@ build_function_decl (gfc_symbol * sym)
DECL_RESULT (fndecl) = result_decl;
/* Don't call layout_decl for a RESULT_DECL.
layout_decl (result_decl, 0); */
layout_decl (result_decl, 0); */
/* If the return type is a pointer, avoid alias issues by setting
DECL_IS_MALLOC to nonzero. This means that the function should be
@ -1048,7 +1050,7 @@ build_function_decl (gfc_symbol * sym)
DECL_CONTEXT (fndecl) = current_function_decl;
DECL_EXTERNAL (fndecl) = 0;
/* This specifies if a function is globaly visible, ie. it is
/* This specifies if a function is globaly visible, i.e. it is
the opposite of declaring static in C. */
if (DECL_CONTEXT (fndecl) == NULL_TREE
&& !sym->attr.entry_master)
@ -1057,7 +1059,7 @@ build_function_decl (gfc_symbol * sym)
/* TREE_STATIC means the function body is defined here. */
TREE_STATIC (fndecl) = 1;
/* Set attributes for PURE functions. A call to PURE function in the
/* Set attributes for PURE functions. A call to a PURE function in the
Fortran 95 sense is both pure and without side effects in the C
sense. */
if (attr.pure || attr.elemental)
@ -1153,7 +1155,7 @@ create_function_arglist (gfc_symbol * sym)
for (f = sym->formal; f; f = f->next)
{
if (f->sym != NULL) /* ignore alternate returns. */
if (f->sym != NULL) /* ignore alternate returns. */
{
length = NULL_TREE;
@ -1284,22 +1286,22 @@ trans_function_start (gfc_symbol * sym)
fndecl = sym->backend_decl;
/* let GCC know the current scope is this function */
/* Let GCC know the current scope is this function. */
current_function_decl = fndecl;
/* Let the world know what e're about to do. */
/* Let the world know what we're about to do. */
announce_function (fndecl);
if (DECL_CONTEXT (fndecl) == NULL_TREE)
{
/* create RTL for function declaration */
/* Create RTL for function declaration. */
rest_of_decl_compilation (fndecl, 1, 0);
}
/* create RTL for function definition */
/* Create RTL for function definition. */
make_decl_rtl (fndecl);
/* Set the line and filename. sym->decalred_at seems to point to the
/* Set the line and filename. sym->declared_at seems to point to the
last statement for subroutines, but it'll do for now. */
gfc_set_backend_locus (&sym->declared_at);
@ -1311,7 +1313,7 @@ trans_function_start (gfc_symbol * sym)
not safe to try to expand expressions involving them. */
cfun->x_dont_save_pending_sizes_p = 1;
/* function.c requires a push at the start of the function */
/* function.c requires a push at the start of the function. */
pushlevel (0);
}
@ -1333,7 +1335,7 @@ build_entry_thunks (gfc_namespace * ns)
/* This should always be a toplevel function. */
assert (current_function_decl == NULL_TREE);
/* Remeber the master function argument decls. */
/* Remember the master function argument decls. */
for (formal = ns->proc_name->formal; formal; formal = formal->next)
{
}
@ -1351,7 +1353,7 @@ build_entry_thunks (gfc_namespace * ns)
gfc_start_block (&body);
/* Pass extra parater identifying this entry point. */
/* Pass extra parameter identifying this entry point. */
tmp = build_int_cst (gfc_array_index_type, el->id, 0);
args = tree_cons (NULL_TREE, tmp, NULL_TREE);
string_args = NULL_TREE;
@ -1448,7 +1450,7 @@ gfc_create_function_decl (gfc_namespace * ns)
/* Create a declaration for the master function. */
build_function_decl (ns->proc_name);
/* Compile teh entry thunks. */
/* Compile the entry thunks. */
if (ns->entries)
build_entry_thunks (ns);
@ -1873,7 +1875,7 @@ gfc_trans_auto_character_variable (gfc_symbol * sym, tree fnbody)
/* Generate function entry and exit code, and add it to the function body.
This includes:
Allocation and initialisation of array variables.
Allocation and initialization of array variables.
Allocation of character string variables.
Initialization and possibly repacking of dummy arrays. */
@ -2088,7 +2090,7 @@ generate_local_decl (gfc_symbol * sym)
if (warn_unused_parameter)
warning ("unused parameter `%s'", sym->name);
}
/* warn for unused variables, but not if they're inside a common
/* Warn for unused variables, but not if they're inside a common
block or are use_associated. */
else if (warn_unused_variable
&& !(sym->attr.in_common || sym->attr.use_assoc))
@ -2239,7 +2241,7 @@ gfc_generate_function_code (gfc_namespace * ns)
warning ("Function return value not set");
else
{
/* Set the return value to the the dummy result variable. */
/* Set the return value to the dummy result variable. */
tmp = build (MODIFY_EXPR, TREE_TYPE (result),
DECL_RESULT (fndecl), result);
tmp = build_v (RETURN_EXPR, tmp);

View File

@ -55,7 +55,7 @@ gfc_copy_se_loopvars (gfc_se * dest, gfc_se * src)
}
/* Initialise a simple expression holder.
/* Initialize a simple expression holder.
Care must be taken when multiple se are created with the same parent.
The child se must be kept in sync. The easiest way is to delay creation
@ -76,7 +76,7 @@ gfc_init_se (gfc_se * se, gfc_se * parent)
/* Advances to the next SS in the chain. Use this rather than setting
se->ss = se->ss->next because all the parent needs to be kept in sync.
se->ss = se->ss->next because all the parents needs to be kept in sync.
See gfc_init_se. */
void
@ -90,7 +90,7 @@ gfc_advance_se_ss_chain (gfc_se * se)
/* Walk down the parent chain. */
while (p != NULL)
{
/* Simple consistancy check. */
/* Simple consistency check. */
assert (p->parent == NULL || p->parent->ss == p->ss);
p->ss = p->ss->next;
@ -111,7 +111,7 @@ gfc_make_safe_expr (gfc_se * se)
if (TREE_CODE_CLASS (TREE_CODE (se->expr)) == 'c')
return;
/* we need a temporary for this result */
/* We need a temporary for this result. */
var = gfc_create_var (TREE_TYPE (se->expr), NULL);
gfc_add_modify_expr (&se->pre, var, se->expr);
se->expr = var;
@ -158,6 +158,7 @@ gfc_trans_init_string_length (gfc_charlen * cl, stmtblock_t * pblock)
gfc_add_modify_expr (pblock, tmp, se.expr);
}
static void
gfc_conv_substring (gfc_se * se, gfc_ref * ref, int kind)
{
@ -345,7 +346,7 @@ gfc_conv_variable (gfc_se * se, gfc_expr * expr)
ref = ref->next;
}
/* Pointer assignment, allocation or pass by reference. Arrays are handled
seperately. */
separately. */
if (se->want_pointer)
{
if (expr->ts.type == BT_CHARACTER)
@ -376,7 +377,7 @@ gfc_conv_unary_op (enum tree_code code, gfc_se * se, gfc_expr * expr)
/* TRUTH_NOT_EXPR is not a "true" unary operator in GCC.
We must convert it to a compare to 0 (e.g. EQ_EXPR (op1, 0)).
All other unary operators have an equivalent GIMPLE unary operator */
All other unary operators have an equivalent GIMPLE unary operator. */
if (code == TRUTH_NOT_EXPR)
se->expr = build (EQ_EXPR, type, operand.expr,
convert (type, integer_zero_node));
@ -386,7 +387,7 @@ gfc_conv_unary_op (enum tree_code code, gfc_se * se, gfc_expr * expr)
}
/* Expand power operator to optimal multiplications when a value is raised
to an constant integer n. See section 4.6.3, "Evaluation of Powers" of
to a constant integer n. See section 4.6.3, "Evaluation of Powers" of
Donald E. Knuth, "Seminumerical Algorithms", Vol. 2, "The Art of Computer
Programming", 3rd Edition, 1998. */
@ -397,7 +398,7 @@ gfc_conv_unary_op (enum tree_code code, gfc_se * se, gfc_expr * expr)
with the first node being one. */
#define POWI_TABLE_SIZE 256
/* The table is from Builtins.c. */
/* The table is from builtins.c. */
static const unsigned char powi_table[POWI_TABLE_SIZE] =
{
0, 1, 1, 2, 2, 3, 3, 4, /* 0 - 7 */
@ -434,11 +435,12 @@ static const unsigned char powi_table[POWI_TABLE_SIZE] =
124, 166, 125, 214, 126, 138, 127, 153, /* 248 - 255 */
};
/* If n is larger than lookup table's max index, we use "window method". */
/* If n is larger than lookup table's max index, we use the "window
method". */
#define POWI_WINDOW_SIZE 3
/* Recursive function to expand power operator. The temporary values are put
in tmpvar. The function return tmpvar[1] ** n. */
/* Recursive function to expand the power operator. The temporary
values are put in tmpvar. The function returns tmpvar[1] ** n. */
static tree
gfc_conv_powi (gfc_se * se, int n, tree * tmpvar)
{
@ -476,8 +478,10 @@ gfc_conv_powi (gfc_se * se, int n, tree * tmpvar)
return tmp;
}
/* Expand lhs ** rhs. rhs is an constant integer. If expand successfully,
return 1. Else return 0 and will call runtime library functions. */
/* Expand lhs ** rhs. rhs is a constant integer. If it expands successfully,
return 1. Else return 0 and a call to runtime library functions
will have to be built. */
static int
gfc_conv_cst_int_power (gfc_se * se, tree lhs, tree rhs)
{
@ -509,7 +513,7 @@ gfc_conv_cst_int_power (gfc_se * se, tree lhs, tree rhs)
cond = build (EQ_EXPR, boolean_type_node, lhs,
convert (TREE_TYPE (lhs), integer_one_node));
/* If rhs is an even,
/* If rhs is even,
result = (lhs == 1 || lhs == -1) ? 1 : 0. */
if ((n & 1) == 0)
{
@ -519,7 +523,7 @@ gfc_conv_cst_int_power (gfc_se * se, tree lhs, tree rhs)
convert (type, integer_zero_node));
return 1;
}
/* If rhs is an odd,
/* If rhs is odd,
result = (lhs == 1) ? 1 : (lhs == -1) ? -1 : 0. */
tmp = build (COND_EXPR, type, tmp,
convert (type, integer_minus_one_node),
@ -777,9 +781,9 @@ gfc_conv_concat_op (gfc_se * se, gfc_expr * expr)
/* Translates an op expression. Common (binary) cases are handled by this
function, others are passed on. Recursion is used in either case.
We use the fact that (op1.ts == op2.ts) (except for the power
operand **).
operator **).
Operators need no special handling for scalarized expressions as long as
they call gfc_conv_siple_val to get their operands.
they call gfc_conv_simple_val to get their operands.
Character strings get special handling. */
static void
@ -900,7 +904,7 @@ gfc_conv_expr_op (gfc_se * se, gfc_expr * expr)
return;
}
/* The only exception to this is **, which is handled seperately anyway. */
/* The only exception to this is **, which is handled separately anyway. */
assert (expr->op1->ts.type == expr->op2->ts.type);
if (checkstring && expr->op1->ts.type != BT_CHARACTER)
@ -946,12 +950,12 @@ gfc_conv_expr_op (gfc_se * se, gfc_expr * expr)
else
se->expr = fold (build (code, type, lse.expr, rse.expr));
/* Add the post blocks. */
gfc_add_block_to_block (&se->post, &rse.post);
gfc_add_block_to_block (&se->post, &lse.post);
}
static void
gfc_conv_function_val (gfc_se * se, gfc_symbol * sym)
{
@ -1125,11 +1129,13 @@ gfc_conv_function_call (gfc_se * se, gfc_symbol * sym,
}
else
{
/* If the procedure requires explicit interface, actual argument
is passed according to corresponing formal argument. We
do not use g77 method and the address of array descriptor
is passed if corresponing formal is pointer or
assumed-shape, Otherwise use g77 method. */
/* If the procedure requires an explicit interface, the
actual argument is passed according to the
corresponding formal argument. If the corresponding
formal argument is a POINTER or assumed shape, we do
not use g77's calling aonvention, and pass the
address of the array descriptor instead. Otherwise we
use g77's calling convention. */
int f;
f = (formal != NULL)
&& !formal->sym->attr.pointer
@ -1164,8 +1170,8 @@ gfc_conv_function_call (gfc_se * se, gfc_symbol * sym,
se->expr = build (CALL_EXPR, TREE_TYPE (fntype), se->expr,
arglist, NULL_TREE);
/* A pure function may still have side-effects - it may modify its
parameters. */
/* A pure function may still have side-effects - it may modify its
parameters. */
TREE_SIDE_EFFECTS (se->expr) = 1;
#if 0
if (!sym->attr.pure)
@ -1324,7 +1330,7 @@ gfc_conv_statement_function (gfc_se * se, gfc_expr * expr)
se->string_length = sym->ts.cl->backend_decl;
}
/* Resore the original variables. */
/* Restore the original variables. */
for (fargs = sym->formal, n = 0; fargs; fargs = fargs->next, n++)
gfc_restore_sym (fargs->sym, &saved_vars[n]);
gfc_free (saved_vars);
@ -1344,7 +1350,7 @@ gfc_conv_function_expr (gfc_se * se, gfc_expr * expr)
return;
}
/* We distinguish the statement function from general function to improve
/* We distinguish statement functions from general functions to improve
runtime performance. */
if (expr->symtree->n.sym->attr.proc == PROC_ST_FUNCTION)
{
@ -1360,6 +1366,7 @@ gfc_conv_function_expr (gfc_se * se, gfc_expr * expr)
gfc_conv_function_call (se, sym, expr->value.function.actual);
}
static void
gfc_conv_array_constructor_expr (gfc_se * se, gfc_expr * expr)
{
@ -1372,8 +1379,8 @@ gfc_conv_array_constructor_expr (gfc_se * se, gfc_expr * expr)
/* Build a static initializer. EXPR is the expression for the initial value.
The other parameters describe the variable of component being initialized.
EXPR may be null. */
The other parameters describe the variable of the component being
initialized. EXPR may be null. */
tree
gfc_conv_initializer (gfc_expr * expr, gfc_typespec * ts, tree type,
@ -1673,7 +1680,7 @@ gfc_conv_structure (gfc_se * se, gfc_expr * expr, int init)
}
/*translate a substring expression */
/* Translate a substring expression. */
static void
gfc_conv_substring_expr (gfc_se * se, gfc_expr * expr)
@ -1780,7 +1787,7 @@ gfc_conv_expr_type (gfc_se * se, gfc_expr * expr, tree type)
}
/* Converts an expression so that it can be passed by refernece. Scalar
/* Converts an expression so that it can be passed by reference. Scalar
values only. */
void