#include "config.h"#include "system.h"#include "tree.h"#include "flags.h"#include "java-tree.h"#include "toplev.h"

Go to the source code of this file.
Data Types | |
| type | alternatives |
Defines | |
| #define | COPYN(DST, SRC, NWORDS) memcpy (DST, SRC, NWORDS * sizeof(word)) |
| #define | COPY(DST, SRC) COPYN (DST, SRC, num_current_words) |
| #define | SET_ALL(DST) memset (DST, ~0, num_current_words * sizeof(word)) |
| #define | CLEAR_ALL(DST) memset (DST, 0, num_current_words * sizeof(word)) |
| #define | INTERSECTN(DST, SRC1, SRC2, N) |
| #define | UNION(DST, SRC1, SRC2) UNIONN (DST, SRC1, SRC2, num_current_words) |
| #define | UNIONN(DST, SRC1, SRC2, N) |
| #define | INTERSECT(DST, SRC1, SRC2) INTERSECTN (DST, SRC1, SRC2, num_current_words) |
| #define | WORD_SIZE ((unsigned int)(sizeof(word) * BITS_PER_UNIT)) |
| #define | ALLOC_WORDS(NUM) ((word*) xmalloc ((NUM) * sizeof (word))) |
| #define | FREE_WORDS(PTR) (free (PTR)) |
| #define | DECLARE_BUFFERS(BUFFER, NUMBUFFERS) |
| #define | RELEASE_BUFFERS(BUFFER) FREE_BUFFER(BUFFER, BUFFER##_short) |
| #define | ALLOC_BUFFER(SHORTBUFFER, NUMWORDS) |
| #define | FREE_BUFFER(BUFFER, SHORTBUFFER) if (BUFFER != SHORTBUFFER) FREE_WORDS(BUFFER) |
| #define | SET_P(WORDS, BIT) (WORDS[(BIT) / WORD_SIZE] & (1 << ((BIT) % WORD_SIZE))) |
| #define | CLEAR_BIT(WORDS, BIT) (WORDS[(BIT) / WORD_SIZE] &= ~ (1 << ((BIT) % WORD_SIZE))) |
| #define | SET_BIT(WORDS, BIT) (WORDS[(BIT) / WORD_SIZE] |= (1 << ((BIT) % WORD_SIZE))) |
| #define | WORDS_NEEDED(BITS) (((BITS)+(WORD_SIZE-1))/(WORD_SIZE)) |
| #define | ASSIGNED_P(WORDS, BIT) SET_P(WORDS, 2 * (BIT)) |
| #define | UNASSIGNED_P(WORDS, BIT) SET_P(WORDS, 2 * (BIT) + 1) |
| #define | SET_ASSIGNED(WORDS, INDEX) SET_BIT (WORDS, 2 * (INDEX)) |
| #define | SET_UNASSIGNED(WORDS, INDEX) SET_BIT (WORDS, 2 * (INDEX) + 1) |
| #define | CLEAR_ASSIGNED(WORDS, INDEX) CLEAR_BIT (WORDS, 2 * (INDEX)) |
| #define | CLEAR_UNASSIGNED(WORDS, INDEX) CLEAR_BIT (WORDS, 2 * (INDEX) + 1) |
| #define | BEGIN_ALTERNATIVES(before, current) |
| #define | END_ALTERNATIVES(after, current) |
Typedefs | |
| typedef unsigned int | word |
| typedef word * | words |
Functions/Subroutines | |
| static void check_bool_init | PARAMS ((tree, words, words, words)) |
| static void check_init | PARAMS ((tree, words)) |
| static void check_cond_init | PARAMS ((tree, tree, tree, words, words, words)) |
| static void check_bool2_init | PARAMS ((enum tree_code, tree, tree, words, words, words)) |
| static void done_alternative | PARAMS ((words, struct alternatives *)) |
| static tree get_variable_decl | PARAMS ((tree)) |
| static tree | get_variable_decl (tree exp) |
| static void | final_assign_error (tree name) |
| static void | check_final_reassigned (tree decl, words before) |
| static void | check_cond_init (tree test_exp, tree then_exp, tree else_exp, words before, words when_false, words when_true) |
| static void | check_bool2_init (enum tree_code code, tree exp0, tree exp1, words before, words when_false, words when_true) |
| static void | check_bool_init (tree exp, words before, words when_false, words when_true) |
| static void | done_alternative (words after, struct alternatives *current) |
| static void | check_init (tree exp, words before) |
| void | check_for_initialization (tree body, tree mdecl) |
| bool | attach_initialized_static_class (struct hash_entry *entry, PTR ptr) |
Variables | |
| static int | num_current_locals = 0 |
| static int | loop_current_locals |
| static int | start_current_locals = 0 |
| static int | num_current_words |
| static tree | wfl |
| struct alternatives * | alternatives = NULL |
| #define ALLOC_BUFFER | ( | SHORTBUFFER, | |||
| NUMWORDS | ) |
Value:
((NUMWORDS) * sizeof(word) <= sizeof(SHORTBUFFER) ? SHORTBUFFER \ : ALLOC_WORDS(NUMWORDS))
Definition at line 130 of file check-init.c.
Referenced by check_init().
Definition at line 111 of file check-init.c.
Referenced by check_bool2_init(), check_for_initialization(), and check_init().
| #define ASSIGNED_P | ( | WORDS, | |||
| BIT | ) | SET_P(WORDS, 2 * (BIT)) |
Definition at line 148 of file check-init.c.
Referenced by attach_initialized_static_class(), check_for_initialization(), and check_init().
| #define BEGIN_ALTERNATIVES | ( | before, | |||
| current | ) |
Value:
{ \
current.saved = NULL; \
current.num_locals = num_current_locals; \
current.combined = num_current_words <= 1 ? ¤t.one_word \
: ALLOC_WORDS (num_current_words); \
SET_ALL (current.combined); \
current.outer = alternatives; \
alternatives = ¤t; \
current.save_start_current_locals = start_current_locals; \
start_current_locals = num_current_locals; \
}
Definition at line 436 of file check-init.c.
Referenced by check_init().
| #define CLEAR_ALL | ( | DST | ) | memset (DST, 0, num_current_words * sizeof(word)) |
Definition at line 81 of file check-init.c.
Definition at line 154 of file check-init.c.
Referenced by check_for_initialization(), and check_init().
| #define CLEAR_BIT | ( | WORDS, | |||
| BIT | ) | (WORDS[(BIT) / WORD_SIZE] &= ~ (1 << ((BIT) % WORD_SIZE))) |
Definition at line 140 of file check-init.c.
| #define COPY | ( | DST, | |||
| SRC | ) | COPYN (DST, SRC, num_current_words) |
Definition at line 78 of file check-init.c.
| #define COPYN | ( | DST, | |||
| SRC, | |||||
| NWORDS | ) | memcpy (DST, SRC, NWORDS * sizeof(word)) |
| #define DECLARE_BUFFERS | ( | BUFFER, | |||
| NUMBUFFERS | ) |
Value:
word BUFFER##_short[2 * NUMBUFFERS]; \ words BUFFER = ALLOC_BUFFER(BUFFER##_short, NUMBUFFERS * num_current_words)
Definition at line 123 of file check-init.c.
Referenced by check_cond_init(), and check_init().
| #define END_ALTERNATIVES | ( | after, | |||
| current | ) |
Value:
{ \
alternatives = current.outer; \
COPY (after, current.combined); \
if (current.combined != ¤t.one_word) \
FREE_WORDS (current.combined); \
start_current_locals = current.save_start_current_locals; \
}
Definition at line 466 of file check-init.c.
Referenced by check_init().
| #define FREE_BUFFER | ( | BUFFER, | |||
| SHORTBUFFER | ) | if (BUFFER != SHORTBUFFER) FREE_WORDS(BUFFER) |
| #define INTERSECT | ( | DST, | |||
| SRC1, | |||||
| SRC2 | ) | INTERSECTN (DST, SRC1, SRC2, num_current_words) |
Definition at line 96 of file check-init.c.
Referenced by check_bool2_init(), check_cond_init(), and check_init().
| #define INTERSECTN | ( | DST, | |||
| SRC1, | |||||
| SRC2, | |||||
| N | ) |
| #define RELEASE_BUFFERS | ( | BUFFER | ) | FREE_BUFFER(BUFFER, BUFFER##_short) |
| #define SET_ALL | ( | DST | ) | memset (DST, ~0, num_current_words * sizeof(word)) |
| #define SET_BIT | ( | WORDS, | |||
| BIT | ) | (WORDS[(BIT) / WORD_SIZE] |= (1 << ((BIT) % WORD_SIZE))) |
Definition at line 143 of file check-init.c.
| #define SET_P | ( | WORDS, | |||
| BIT | ) | (WORDS[(BIT) / WORD_SIZE] & (1 << ((BIT) % WORD_SIZE))) |
Definition at line 137 of file check-init.c.
Definition at line 152 of file check-init.c.
Referenced by check_for_initialization(), and check_init().
| #define UNASSIGNED_P | ( | WORDS, | |||
| BIT | ) | SET_P(WORDS, 2 * (BIT) + 1) |
| #define UNION | ( | DST, | |||
| SRC1, | |||||
| SRC2 | ) | UNIONN (DST, SRC1, SRC2, num_current_words) |
Definition at line 88 of file check-init.c.
| #define UNIONN | ( | DST, | |||
| SRC1, | |||||
| SRC2, | |||||
| N | ) |
| #define WORD_SIZE ((unsigned int)(sizeof(word) * BITS_PER_UNIT)) |
Definition at line 99 of file check-init.c.
Definition at line 146 of file check-init.c.
Referenced by check_for_initialization(), check_init(), and done_alternative().
| typedef unsigned int word |
Definition at line 39 of file check-init.c.
Definition at line 42 of file check-init.c.
| bool attach_initialized_static_class | ( | struct hash_entry * | entry, | |
| PTR | ptr | |||
| ) |
Definition at line 1008 of file check-init.c.
References ASSIGNED_P, boolean_true_node, DECL_BIT_INDEX, DECL_CONTEXT, DECL_FUNCTION_INITIALIZED_CLASS_TABLE, DECL_INITIAL, hash_lookup(), index(), init_test_hash_entry::init_test_decl, METHOD_STATIC, NULL, and TRUE.
| static void check_bool2_init | ( | enum tree_code | code, | |
| tree | exp0, | |||
| tree | exp1, | |||
| words | before, | |||
| words | when_false, | |||
| words | when_true | |||
| ) | [static] |
Definition at line 252 of file check-init.c.
References ALLOC_WORDS, buf, check_bool_init(), FREE_WORDS, INTERSECT, num_current_words, tmp, UNION, and words.
Referenced by check_bool_init().
Definition at line 320 of file check-init.c.
References boolean_false_node, boolean_true_node, check_bool2_init(), check_cond_init(), check_final_reassigned(), check_init(), CLEAR_UNASSIGNED, COPY, DECL_BIT_INDEX, get_variable_decl(), index(), integer_zerop(), NULL_TREE, SET_ALL, SET_ASSIGNED, tmp, TREE_CODE, and TREE_OPERAND.
Referenced by check_bool2_init(), check_cond_init(), and check_init().
| static void check_cond_init | ( | tree | test_exp, | |
| tree | then_exp, | |||
| tree | else_exp, | |||
| words | before, | |||
| words | when_false, | |||
| words | when_true | |||
| ) | [static] |
Definition at line 224 of file check-init.c.
References check_bool_init(), DECLARE_BUFFERS, INTERSECT, num_current_locals, num_current_words, RELEASE_BUFFERS, alternatives::save_start_current_locals, start_current_locals, and words.
Referenced by check_bool_init().
Definition at line 204 of file check-init.c.
References DECL_BIT_INDEX, DECL_FINAL, DECL_NAME, final_assign_error(), index(), loop_current_locals, and UNASSIGNED_P.
Referenced by check_bool_init(), and check_init().
Definition at line 921 of file check-init.c.
References ALLOC_WORDS, ASSIGNED_P, before, buf, check_init(), CLEAR_ASSIGNED, DECL_BIT_INDEX, DECL_CLINIT_P, DECL_CONTEXT, DECL_FIELD_FINAL_IUD, DECL_FINAL, DECL_FINIT_P, DECL_INIT_CALLS_THIS, DECL_INIT_P, DECL_INSTINIT_P, FIELD_FINAL, FIELD_STATIC, i, index(), METHOD_STATIC, NULL_TREE, num_current_locals, num_current_words, SET_UNASSIGNED, start_current_locals, TREE_CHAIN, TYPE_FIELDS, words, and WORDS_NEEDED.
Definition at line 478 of file check-init.c.
References abort, ALLOC_BUFFER, ALLOC_WORDS, ASSIGNED_P, BEGIN_ALTERNATIVES, BLOCK, alternatives::block, BLOCK_EXPR_BODY, BLOCK_EXPR_DECLS, boolean_true_node, buf, check_bool_init(), check_final_reassigned(), CLEAR_ASSIGNED, CLEAR_UNASSIGNED, CONSTRUCTOR_ELTS, COPY, COPYN, DECL_BIT_INDEX, DECL_CONTEXT, DECL_FINAL, DECL_FUNCTION_INIT_TEST_CLASS, DECL_FUNCTION_INITIALIZED_CLASS_TABLE, DECL_INITIAL, DECL_NAME, DECLARE_BUFFERS, done_alternative(), empty_stmt_node, END_ALTERNATIVES, EXPR_WFL_FILENAME, EXPR_WFL_LINENO, EXPR_WFL_NODE, FIELD_STATIC, final_assign_error(), FREE_BUFFER, FREE_WORDS, func, get_variable_decl(), hash_lookup(), i, IDENTIFIER_POINTER, index(), input_filename, internal_error(), INTERSECT, IS_ARRAY_LENGTH_ACCESS, IS_INIT_CHECKED, LABELED_BLOCK_BODY, length_identifier_node, lineno, LOCAL_CLASS_INITIALIZATION_FLAG_P, loop_current_locals, METHOD_STATIC, NULL, NULL_TREE, num_current_locals, num_current_words, alternatives::num_locals, alternatives::outer, RELEASE_BUFFERS, save, alternatives::save_start_current_locals, alternatives::saved, SET_ALL, SET_ASSIGNED, SET_UNASSIGNED, start_current_locals, STATIC_CLASS_INIT_OPT_P, SWITCH_HAS_DEFAULT, this_identifier_node, throw_node, tmp, TREE_CHAIN, TREE_CODE, tree_code_name, TREE_OPERAND, TREE_VALUE, TRUE, UNION, wfl, words, WORDS_NEEDED, and x.
Referenced by check_bool_init(), and check_for_initialization().
| static void done_alternative | ( | words | after, | |
| struct alternatives * | current | |||
| ) | [static] |
Definition at line 454 of file check-init.c.
References alternatives::combined, INTERSECTN, alternatives::num_locals, and WORDS_NEEDED.
Referenced by check_init().
Definition at line 195 of file check-init.c.
References format, IDENTIFIER_POINTER, and wfl.
Referenced by check_final_reassigned(), and check_init().
Definition at line 161 of file check-init.c.
References BLOCK_EXPR_DECLS, current_function_decl, DECL_FINAL, DECL_FUNCTION_BODY, FIELD_FINAL, METHOD_STATIC, NULL_TREE, TREE_CODE, TREE_OPERAND, and TREE_STATIC.
Referenced by check_bool_init(), and check_init().
| static void done_alternative PARAMS | ( | (words, struct alternatives *) | ) | [static] |
| struct alternatives* alternatives = NULL |
Definition at line 430 of file check-init.c.
int loop_current_locals [static] |
Definition at line 49 of file check-init.c.
Referenced by check_final_reassigned(), and check_init().
int num_current_locals = 0 [static] |
Definition at line 45 of file check-init.c.
Referenced by check_cond_init(), check_for_initialization(), and check_init().
int num_current_words [static] |
Definition at line 73 of file check-init.c.
Referenced by check_bool2_init(), check_cond_init(), check_for_initialization(), and check_init().
int start_current_locals = 0 [static] |
Definition at line 71 of file check-init.c.
Referenced by check_cond_init(), check_for_initialization(), and check_init().
Definition at line 75 of file check-init.c.
Referenced by build_expr_wfl(), check_init(), and final_assign_error().
1.5.6