/* 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.
/* The basic idea is that we assign each local variable declaration
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
- 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 */
/* One segment of a bitstring. */
/* Pointer to a bitstring. */
typedef word *words;
-/* Number of locals variables currently active. */
+/* Number of local variables currently active. */
static int num_current_locals = 0;
/* The value of num_current_locals when we entered the closest
final_assign_error (tree name)
{
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));
}
/* Check a boolean expression EXP for definite [un]assignment.
BEFORE is the set of variables definitely [un]assigned before the
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.
On output, WHEN_TRUE is the set of variables definitely [un]assigned after
the conditional when the conditional is true.
WORDS_NEEDED (2 * current->num_locals));
}
-/* Used when we done with a control flow branch and are all merged again.
- * AFTER is the merged state of [un]assigned variables,
+/* Used when we are done with a control flow branch and are all merged again.
+ AFTER is the merged state of [un]assigned variables,
CURRENT is a struct alt that was passed to BEGIN_ALTERNATIVES. */
#define END_ALTERNATIVES(after, current) \
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
check_init (tree exp, words before)
&& DECL_NAME (exp) != this_identifier_node)
{
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. */
if (! LOCAL_CLASS_INITIALIZATION_FLAG_P (exp)
&& index >= 0 && ! ASSIGNED_P (before, index))
if (index >= 0 && ! ASSIGNED_P (before, index))
{
parse_error_context
- (wfl, "variable '%s' may not have been initialized",
+ (wfl, "variable `%s' may not have been initialized",
IDENTIFIER_POINTER (DECL_NAME (tmp)));
/* Suppress further errors. */
DECL_BIT_INDEX (tmp) = -2;
"hypothetical" analysis model. We do something much
simpler: We just disallow assignments inside loops to final
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
do-while whose condition is false?) would care. */
if (index >= 0 && ! ASSIGNED_P (before, index))
{
if (! is_finit_method)
- error ("%Jfinal field '%D' may not have been initialized",
+ error ("%Jfinal field `%D' may not have been initialized",
decl, decl);
}
else if (is_finit_method)