osprey/kgccfe/gnu/java/check-init.c File Reference

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

Include dependency graph for check-init.c:

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 wordwords

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 alternativesalternatives = NULL


Define Documentation

#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().

#define ALLOC_WORDS ( NUM   )     ((word*) xmalloc ((NUM) * sizeof (word)))

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))

#define BEGIN_ALTERNATIVES ( before,
current   ) 

Value:

{ \
  current.saved = NULL; \
  current.num_locals = num_current_locals; \
  current.combined = num_current_words <= 1 ? &current.one_word \
    : ALLOC_WORDS (num_current_words); \
  SET_ALL (current.combined); \
  current.outer = alternatives; \
  alternatives = &current; \
  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.

#define CLEAR_ASSIGNED ( WORDS,
INDEX   )     CLEAR_BIT (WORDS, 2 * (INDEX))

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 CLEAR_UNASSIGNED ( WORDS,
INDEX   )     CLEAR_BIT (WORDS, 2 * (INDEX) + 1)

Definition at line 155 of file check-init.c.

Referenced by check_bool_init(), and check_init().

#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))

Definition at line 77 of file check-init.c.

Referenced by check_init().

#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 != &current.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)

Definition at line 134 of file check-init.c.

Referenced by check_init().

#define FREE_WORDS ( PTR   )     (free (PTR))

Definition at line 112 of file check-init.c.

Referenced by check_bool2_init(), and check_init().

#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,
 ) 

Value:

do { int n = N; \
  while (--n >= 0) DST[n] = SRC1[n] & SRC2[n]; \
  } while (0)

Definition at line 83 of file check-init.c.

Referenced by done_alternative().

#define RELEASE_BUFFERS ( BUFFER   )     FREE_BUFFER(BUFFER, BUFFER##_short)

Definition at line 127 of file check-init.c.

Referenced by check_cond_init(), and check_init().

#define SET_ALL ( DST   )     memset (DST, ~0, num_current_words * sizeof(word))

Definition at line 80 of file check-init.c.

Referenced by check_bool_init(), and check_init().

#define SET_ASSIGNED ( WORDS,
INDEX   )     SET_BIT (WORDS, 2 * (INDEX))

Definition at line 151 of file check-init.c.

Referenced by check_bool_init(), and check_init().

#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.

#define SET_UNASSIGNED ( WORDS,
INDEX   )     SET_BIT (WORDS, 2 * (INDEX) + 1)

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)

Definition at line 149 of file check-init.c.

Referenced by check_final_reassigned().

#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,
 ) 

Value:

do { int n = N; \
  while (--n >= 0) DST[n] = SRC1[n] | SRC2[n]; \
  } while (0)

Definition at line 91 of file check-init.c.

#define WORD_SIZE   ((unsigned int)(sizeof(word) * BITS_PER_UNIT))

Definition at line 99 of file check-init.c.

#define WORDS_NEEDED ( BITS   )     (((BITS)+(WORD_SIZE-1))/(WORD_SIZE))

Definition at line 146 of file check-init.c.

Referenced by check_for_initialization(), check_init(), and done_alternative().


Typedef Documentation

typedef unsigned int word

Definition at line 39 of file check-init.c.

typedef word* words

Definition at line 42 of file check-init.c.


Function Documentation

bool attach_initialized_static_class ( struct hash_entry entry,
PTR  ptr 
)

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().

static void check_bool_init ( tree  exp,
words  before,
words  when_false,
words  when_true 
) [static]

static void check_cond_init ( tree  test_exp,
tree  then_exp,
tree  else_exp,
words  before,
words  when_false,
words  when_true 
) [static]

static void check_final_reassigned ( tree  decl,
words  before 
) [static]

void check_for_initialization ( tree  body,
tree  mdecl 
)

static void check_init ( tree  exp,
words  before 
) [static]

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().

static void final_assign_error ( tree  name  )  [static]

Definition at line 195 of file check-init.c.

References format, IDENTIFIER_POINTER, and wfl.

Referenced by check_final_reassigned(), and check_init().

static tree get_variable_decl ( tree  exp  )  [static]

static tree get_variable_decl PARAMS ( (tree  )  [static]

static void done_alternative PARAMS ( (words, struct alternatives *)   )  [static]

static void check_bool2_init PARAMS ( (enum tree_code, tree, tree, words, words, words  )  [static]

static void check_cond_init PARAMS ( (tree, tree, tree, words, words, words  )  [static]

static void check_init PARAMS ( (tree, words  )  [static]

static void check_bool_init PARAMS ( (tree, words, words, words  )  [static]


Variable Documentation

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]

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().

tree wfl [static]

Definition at line 75 of file check-init.c.

Referenced by build_expr_wfl(), check_init(), and final_assign_error().


Generated on Wed Apr 8 15:50:32 2009 for Open64 by  doxygen 1.5.6