Commit 66ba7273 by Ranjit Mathew Committed by Ranjit Mathew

* check-init.c: Correct minor typos.

From-SVN: r81940
parent a2824db3
2004-05-17 Ranjit Mathew <rmathew@hotmail.com>
* check-init.c: Correct minor typos.
2004-05-13 Diego Novillo <dnovillo@redhat.com> 2004-05-13 Diego Novillo <dnovillo@redhat.com>
* Make-lang.in, expr.c, java-gimplify.c: Rename * Make-lang.in, expr.c, java-gimplify.c: Rename
......
/* Code to test for "definitive [un]assignment". /* Code to test for "definitive [un]assignment".
Copyright (C) 1999, 2000, 2001, 2003 Free Software Foundation, Inc. Copyright (C) 1999, 2000, 2001, 2003, 2004 Free Software Foundation, Inc.
This file is part of GCC. This file is part of GCC.
...@@ -36,7 +36,7 @@ The Free Software Foundation is independent of Sun Microsystems, Inc. */ ...@@ -36,7 +36,7 @@ The Free Software Foundation is independent of Sun Microsystems, Inc. */
/* The basic idea is that we assign each local variable declaration /* The basic idea is that we assign each local variable declaration
and each blank final field an index, and then we pass around and each blank final field an index, and then we pass around
bitstrings, where the (2*i)'th bit is set if decl whose DECL_BIT_INDEX bitstrings, where the (2*i)'th bit is set if decl whose DECL_BIT_INDEX
is i is definitely assigned, and the the (2*i=1)'th bit is set if is i is definitely assigned, and the (2*i+1)'th bit is set if
decl whose DECL_BIT_INDEX is i is definitely unassigned */ decl whose DECL_BIT_INDEX is i is definitely unassigned */
/* One segment of a bitstring. */ /* One segment of a bitstring. */
...@@ -45,7 +45,7 @@ typedef unsigned int word; ...@@ -45,7 +45,7 @@ typedef unsigned int word;
/* Pointer to a bitstring. */ /* Pointer to a bitstring. */
typedef word *words; typedef word *words;
/* Number of locals variables currently active. */ /* Number of local variables currently active. */
static int num_current_locals = 0; static int num_current_locals = 0;
/* The value of num_current_locals when we entered the closest /* The value of num_current_locals when we entered the closest
...@@ -198,7 +198,7 @@ static void ...@@ -198,7 +198,7 @@ static void
final_assign_error (tree name) final_assign_error (tree name)
{ {
static const char format[] static const char format[]
= "can't reassign a value to the final variable '%s'"; = "Can't reassign a value to the final variable `%s'";
parse_error_context (wfl, format, IDENTIFIER_POINTER (name)); parse_error_context (wfl, format, IDENTIFIER_POINTER (name));
} }
...@@ -305,7 +305,7 @@ check_bool2_init (enum tree_code code, tree exp0, tree exp1, ...@@ -305,7 +305,7 @@ check_bool2_init (enum tree_code code, tree exp0, tree exp1,
/* Check a boolean expression EXP for definite [un]assignment. /* Check a boolean expression EXP for definite [un]assignment.
BEFORE is the set of variables definitely [un]assigned before the BEFORE is the set of variables definitely [un]assigned before the
conditional. (This bitstring may be modified arbitrarily in this function.) conditional. (This bitstring may be modified arbitrarily in this function.)
On output, WHEN_FALSE is the set of variables [un]definitely assigned after On output, WHEN_FALSE is the set of variables definitely [un]assigned after
the conditional when the conditional is false. the conditional when the conditional is false.
On output, WHEN_TRUE is the set of variables definitely [un]assigned after On output, WHEN_TRUE is the set of variables definitely [un]assigned after
the conditional when the conditional is true. the conditional when the conditional is true.
...@@ -452,8 +452,8 @@ done_alternative (words after, struct alternatives *current) ...@@ -452,8 +452,8 @@ done_alternative (words after, struct alternatives *current)
WORDS_NEEDED (2 * current->num_locals)); WORDS_NEEDED (2 * current->num_locals));
} }
/* Used when we done with a control flow branch and are all merged again. /* Used when we are done with a control flow branch and are all merged again.
* AFTER is the merged state of [un]assigned variables, AFTER is the merged state of [un]assigned variables,
CURRENT is a struct alt that was passed to BEGIN_ALTERNATIVES. */ CURRENT is a struct alt that was passed to BEGIN_ALTERNATIVES. */
#define END_ALTERNATIVES(after, current) \ #define END_ALTERNATIVES(after, current) \
...@@ -465,7 +465,7 @@ done_alternative (words after, struct alternatives *current) ...@@ -465,7 +465,7 @@ done_alternative (words after, struct alternatives *current)
start_current_locals = current.save_start_current_locals; \ start_current_locals = current.save_start_current_locals; \
} }
/* Check for (un)initialized local variables in EXP. */ /* Check for [un]initialized local variables in EXP. */
static void static void
check_init (tree exp, words before) check_init (tree exp, words before)
...@@ -480,7 +480,7 @@ check_init (tree exp, words before) ...@@ -480,7 +480,7 @@ check_init (tree exp, words before)
&& DECL_NAME (exp) != this_identifier_node) && DECL_NAME (exp) != this_identifier_node)
{ {
int index = DECL_BIT_INDEX (exp); int index = DECL_BIT_INDEX (exp);
/* We don't want to report and mark as non initialized class /* We don't want to report and mark as non-initialized class
initialization flags. */ initialization flags. */
if (! LOCAL_CLASS_INITIALIZATION_FLAG_P (exp) if (! LOCAL_CLASS_INITIALIZATION_FLAG_P (exp)
&& index >= 0 && ! ASSIGNED_P (before, index)) && index >= 0 && ! ASSIGNED_P (before, index))
...@@ -502,7 +502,7 @@ check_init (tree exp, words before) ...@@ -502,7 +502,7 @@ check_init (tree exp, words before)
if (index >= 0 && ! ASSIGNED_P (before, index)) if (index >= 0 && ! ASSIGNED_P (before, index))
{ {
parse_error_context parse_error_context
(wfl, "variable '%s' may not have been initialized", (wfl, "variable `%s' may not have been initialized",
IDENTIFIER_POINTER (DECL_NAME (tmp))); IDENTIFIER_POINTER (DECL_NAME (tmp)));
/* Suppress further errors. */ /* Suppress further errors. */
DECL_BIT_INDEX (tmp) = -2; DECL_BIT_INDEX (tmp) = -2;
...@@ -623,7 +623,7 @@ check_init (tree exp, words before) ...@@ -623,7 +623,7 @@ check_init (tree exp, words before)
"hypothetical" analysis model. We do something much "hypothetical" analysis model. We do something much
simpler: We just disallow assignments inside loops to final simpler: We just disallow assignments inside loops to final
variables declared outside the loop. This means we may variables declared outside the loop. This means we may
disallow some contrived assignments that the JLS, but I disallow some contrived assignments that the JLS allows, but I
can't see how anything except a very contrived testcase (a can't see how anything except a very contrived testcase (a
do-while whose condition is false?) would care. */ do-while whose condition is false?) would care. */
...@@ -974,7 +974,7 @@ check_for_initialization (tree body, tree mdecl) ...@@ -974,7 +974,7 @@ check_for_initialization (tree body, tree mdecl)
if (index >= 0 && ! ASSIGNED_P (before, index)) if (index >= 0 && ! ASSIGNED_P (before, index))
{ {
if (! is_finit_method) if (! is_finit_method)
error ("%Jfinal field '%D' may not have been initialized", error ("%Jfinal field `%D' may not have been initialized",
decl, decl); decl, decl);
} }
else if (is_finit_method) else if (is_finit_method)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment