def.h 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. /* $Header$ */
  2. /* IDENTIFIER DEFINITION DESCRIPTOR */
  3. struct def { /* for ordinary tags */
  4. struct def *next;
  5. int df_level;
  6. struct type *df_type;
  7. int df_sc; /* may be:
  8. GLOBAL, STATIC, EXTERN, IMPLICIT,
  9. TYPEDEF,
  10. FORMAL, AUTO,
  11. ENUM, LABEL
  12. */
  13. int df_register; /* REG_NONE, REG_DEFAULT or REG_BONUS */
  14. char df_initialized; /* an initialization has been generated */
  15. char df_alloc; /* 0, ALLOC_SEEN or ALLOC_DONE */
  16. char df_used; /* set if idf is used */
  17. char df_formal_array; /* to warn if sizeof is taken */
  18. arith df_address;
  19. };
  20. #define ALLOC_SEEN 1 /* an allocating declaration has been seen */
  21. #define ALLOC_DONE 2 /* the allocating declaration has been done */
  22. #define REG_NONE 0 /* no register candidate */
  23. #define REG_DEFAULT 1 /* register candidate, not declared as such */
  24. #define REG_BONUS 10 /* register candidate, declared as such */
  25. /* allocation definitions of struct def */
  26. /* ALLOCDEF "def" */
  27. extern char *st_alloc();
  28. extern struct def *h_def;
  29. #define new_def() ((struct def *) \
  30. st_alloc((char **)&h_def, sizeof(struct def)))
  31. #define free_def(p) st_free(p, h_def, sizeof(struct def))