introduced the ALLOCDEF mechanism
This commit is contained in:
parent
5d1e9f0c86
commit
69e7c2d0ae
|
@ -7,15 +7,7 @@ struct stat_block {
|
||||||
label st_continue;
|
label st_continue;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
/* allocation definitions of struct stat_block */
|
|
||||||
/* ALLOCDEF "stat_block" */
|
/* ALLOCDEF "stat_block" */
|
||||||
extern char *st_alloc();
|
|
||||||
extern struct stat_block *h_stat_block;
|
|
||||||
#define new_stat_block() ((struct stat_block *) \
|
|
||||||
st_alloc((char **)&h_stat_block, sizeof(struct stat_block)))
|
|
||||||
#define free_stat_block(p) st_free(p, h_stat_block, sizeof(struct stat_block))
|
|
||||||
|
|
||||||
|
|
||||||
#define LVAL 0
|
#define LVAL 0
|
||||||
#define RVAL 1
|
#define RVAL 1
|
||||||
|
|
|
@ -13,15 +13,7 @@ struct declarator {
|
||||||
struct idstack_item *dc_fparams; /* params for function */
|
struct idstack_item *dc_fparams; /* params for function */
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
/* allocation definitions of struct declarator */
|
|
||||||
/* ALLOCDEF "declarator" */
|
/* ALLOCDEF "declarator" */
|
||||||
extern char *st_alloc();
|
|
||||||
extern struct declarator *h_declarator;
|
|
||||||
#define new_declarator() ((struct declarator *) \
|
|
||||||
st_alloc((char **)&h_declarator, sizeof(struct declarator)))
|
|
||||||
#define free_declarator(p) st_free(p, h_declarator, sizeof(struct declarator))
|
|
||||||
|
|
||||||
|
|
||||||
#define NO_PARAMS ((struct idstack_item *) 0)
|
#define NO_PARAMS ((struct idstack_item *) 0)
|
||||||
|
|
||||||
|
@ -31,15 +23,7 @@ struct decl_unary {
|
||||||
arith du_count; /* for ARRAYs only */
|
arith du_count; /* for ARRAYs only */
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
/* allocation definitions of struct decl_unary */
|
|
||||||
/* ALLOCDEF "decl_unary" */
|
/* ALLOCDEF "decl_unary" */
|
||||||
extern char *st_alloc();
|
|
||||||
extern struct decl_unary *h_decl_unary;
|
|
||||||
#define new_decl_unary() ((struct decl_unary *) \
|
|
||||||
st_alloc((char **)&h_decl_unary, sizeof(struct decl_unary)))
|
|
||||||
#define free_decl_unary(p) st_free(p, h_decl_unary, sizeof(struct decl_unary))
|
|
||||||
|
|
||||||
|
|
||||||
extern struct type *declare_type();
|
extern struct type *declare_type();
|
||||||
extern struct declarator null_declarator;
|
extern struct declarator null_declarator;
|
||||||
|
|
|
@ -10,14 +10,6 @@ struct decspecs {
|
||||||
int ds_unsigned; /* 0 or 1 */
|
int ds_unsigned; /* 0 or 1 */
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
/* allocation definitions of struct decspecs */
|
|
||||||
/* ALLOCDEF "decspecs" */
|
/* ALLOCDEF "decspecs" */
|
||||||
extern char *st_alloc();
|
|
||||||
extern struct decspecs *h_decspecs;
|
|
||||||
#define new_decspecs() ((struct decspecs *) \
|
|
||||||
st_alloc((char **)&h_decspecs, sizeof(struct decspecs)))
|
|
||||||
#define free_decspecs(p) st_free(p, h_decspecs, sizeof(struct decspecs))
|
|
||||||
|
|
||||||
|
|
||||||
extern struct decspecs null_decspecs;
|
extern struct decspecs null_decspecs;
|
||||||
|
|
|
@ -26,12 +26,4 @@ struct def { /* for ordinary tags */
|
||||||
#define REG_DEFAULT 1 /* register candidate, not declared as such */
|
#define REG_DEFAULT 1 /* register candidate, not declared as such */
|
||||||
#define REG_BONUS 10 /* register candidate, declared as such */
|
#define REG_BONUS 10 /* register candidate, declared as such */
|
||||||
|
|
||||||
|
|
||||||
/* allocation definitions of struct def */
|
|
||||||
/* ALLOCDEF "def" */
|
/* ALLOCDEF "def" */
|
||||||
extern char *st_alloc();
|
|
||||||
extern struct def *h_def;
|
|
||||||
#define new_def() ((struct def *) \
|
|
||||||
st_alloc((char **)&h_def, sizeof(struct def)))
|
|
||||||
#define free_def(p) st_free(p, h_def, sizeof(struct def))
|
|
||||||
|
|
||||||
|
|
|
@ -89,14 +89,6 @@ struct expr {
|
||||||
|
|
||||||
extern struct expr *intexpr(), *new_oper();
|
extern struct expr *intexpr(), *new_oper();
|
||||||
|
|
||||||
|
|
||||||
/* allocation definitions of struct expr */
|
|
||||||
/* ALLOCDEF "expr" */
|
/* ALLOCDEF "expr" */
|
||||||
extern char *st_alloc();
|
|
||||||
extern struct expr *h_expr;
|
|
||||||
#define new_expr() ((struct expr *) \
|
|
||||||
st_alloc((char **)&h_expr, sizeof(struct expr)))
|
|
||||||
#define free_expr(p) st_free(p, h_expr, sizeof(struct expr))
|
|
||||||
|
|
||||||
|
|
||||||
#define ISCOMMA(e) ((e)->ex_class == Oper && (e)->OP_OPER == INITCOMMA)
|
#define ISCOMMA(e) ((e)->ex_class == Oper && (e)->OP_OPER == INITCOMMA)
|
||||||
|
|
|
@ -9,12 +9,4 @@ struct field { /* for field specifiers */
|
||||||
struct sdef *fd_sdef; /* upward pointer */
|
struct sdef *fd_sdef; /* upward pointer */
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
/* allocation definitions of struct field */
|
|
||||||
/* ALLOCDEF "field" */
|
/* ALLOCDEF "field" */
|
||||||
extern char *st_alloc();
|
|
||||||
extern struct field *h_field;
|
|
||||||
#define new_field() ((struct field *) \
|
|
||||||
st_alloc((char **)&h_field, sizeof(struct field)))
|
|
||||||
#define free_field(p) st_free(p, h_field, sizeof(struct field))
|
|
||||||
|
|
||||||
|
|
|
@ -27,15 +27,7 @@ struct idstack_item { /* stack of identifiers */
|
||||||
struct idf *is_idf;
|
struct idf *is_idf;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
/* allocation definitions of struct idstack_item */
|
|
||||||
/* ALLOCDEF "idstack_item" */
|
/* ALLOCDEF "idstack_item" */
|
||||||
extern char *st_alloc();
|
|
||||||
extern struct idstack_item *h_idstack_item;
|
|
||||||
#define new_idstack_item() ((struct idstack_item *) \
|
|
||||||
st_alloc((char **)&h_idstack_item, sizeof(struct idstack_item)))
|
|
||||||
#define free_idstack_item(p) st_free(p, h_idstack_item, sizeof(struct idstack_item))
|
|
||||||
|
|
||||||
|
|
||||||
struct idf {
|
struct idf {
|
||||||
struct idf *next;
|
struct idf *next;
|
||||||
|
@ -52,15 +44,7 @@ struct idf {
|
||||||
int id_special; /* special action needed at occurrence */
|
int id_special; /* special action needed at occurrence */
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
/* allocation definitions of struct idf */
|
|
||||||
/* ALLOCDEF "idf" */
|
/* ALLOCDEF "idf" */
|
||||||
extern char *st_alloc();
|
|
||||||
extern struct idf *h_idf;
|
|
||||||
#define new_idf() ((struct idf *) \
|
|
||||||
st_alloc((char **)&h_idf, sizeof(struct idf)))
|
|
||||||
#define free_idf(p) st_free(p, h_idf, sizeof(struct idf))
|
|
||||||
|
|
||||||
|
|
||||||
extern struct idf *str2idf(), *idf_hashed();
|
extern struct idf *str2idf(), *idf_hashed();
|
||||||
|
|
||||||
|
|
|
@ -26,15 +26,7 @@ struct macro {
|
||||||
char mc_flag; /* marking this macro */
|
char mc_flag; /* marking this macro */
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
/* allocation definitions of struct macro */
|
|
||||||
/* ALLOCDEF "macro" */
|
/* ALLOCDEF "macro" */
|
||||||
extern char *st_alloc();
|
|
||||||
extern struct macro *h_macro;
|
|
||||||
#define new_macro() ((struct macro *) \
|
|
||||||
st_alloc((char **)&h_macro, sizeof(struct macro)))
|
|
||||||
#define free_macro(p) st_free(p, h_macro, sizeof(struct macro))
|
|
||||||
|
|
||||||
|
|
||||||
/* `token' numbers of keywords of command-line processor
|
/* `token' numbers of keywords of command-line processor
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -16,30 +16,14 @@ struct stack_level {
|
||||||
int sl_level;
|
int sl_level;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
/* allocation definitions of struct stack_level */
|
|
||||||
/* ALLOCDEF "stack_level" */
|
/* ALLOCDEF "stack_level" */
|
||||||
extern char *st_alloc();
|
|
||||||
extern struct stack_level *h_stack_level;
|
|
||||||
#define new_stack_level() ((struct stack_level *) \
|
|
||||||
st_alloc((char **)&h_stack_level, sizeof(struct stack_level)))
|
|
||||||
#define free_stack_level(p) st_free(p, h_stack_level, sizeof(struct stack_level))
|
|
||||||
|
|
||||||
|
|
||||||
struct stack_entry {
|
struct stack_entry {
|
||||||
struct stack_entry *next;
|
struct stack_entry *next;
|
||||||
struct idf *se_idf;
|
struct idf *se_idf;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
/* allocation definitions of struct stack_entry */
|
|
||||||
/* ALLOCDEF "stack_entry" */
|
/* ALLOCDEF "stack_entry" */
|
||||||
extern char *st_alloc();
|
|
||||||
extern struct stack_entry *h_stack_entry;
|
|
||||||
#define new_stack_entry() ((struct stack_entry *) \
|
|
||||||
st_alloc((char **)&h_stack_entry, sizeof(struct stack_entry)))
|
|
||||||
#define free_stack_entry(p) st_free(p, h_stack_entry, sizeof(struct stack_entry))
|
|
||||||
|
|
||||||
|
|
||||||
extern struct stack_level *local_level;
|
extern struct stack_level *local_level;
|
||||||
extern struct stack_level *stack_level_of();
|
extern struct stack_level *stack_level_of();
|
||||||
|
|
|
@ -13,15 +13,7 @@ struct sdef { /* for selectors */
|
||||||
|
|
||||||
extern char *st_alloc();
|
extern char *st_alloc();
|
||||||
|
|
||||||
|
|
||||||
/* allocation definitions of struct sdef */
|
|
||||||
/* ALLOCDEF "sdef" */
|
/* ALLOCDEF "sdef" */
|
||||||
extern char *st_alloc();
|
|
||||||
extern struct sdef *h_sdef;
|
|
||||||
#define new_sdef() ((struct sdef *) \
|
|
||||||
st_alloc((char **)&h_sdef, sizeof(struct sdef)))
|
|
||||||
#define free_sdef(p) st_free(p, h_sdef, sizeof(struct sdef))
|
|
||||||
|
|
||||||
|
|
||||||
struct tag { /* for struct-, union- and enum tags */
|
struct tag { /* for struct-, union- and enum tags */
|
||||||
struct tag *next;
|
struct tag *next;
|
||||||
|
@ -31,14 +23,6 @@ struct tag { /* for struct-, union- and enum tags */
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/* allocation definitions of struct tag */
|
|
||||||
/* ALLOCDEF "tag" */
|
/* ALLOCDEF "tag" */
|
||||||
extern char *st_alloc();
|
|
||||||
extern struct tag *h_tag;
|
|
||||||
#define new_tag() ((struct tag *) \
|
|
||||||
st_alloc((char **)&h_tag, sizeof(struct tag)))
|
|
||||||
#define free_tag(p) st_free(p, h_tag, sizeof(struct tag))
|
|
||||||
|
|
||||||
|
|
||||||
struct sdef *idf2sdef();
|
struct sdef *idf2sdef();
|
||||||
|
|
|
@ -13,15 +13,7 @@ struct switch_hdr {
|
||||||
struct case_entry *sh_entries;
|
struct case_entry *sh_entries;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
/* allocation definitions of struct switch_hdr */
|
|
||||||
/* ALLOCDEF "switch_hdr" */
|
/* ALLOCDEF "switch_hdr" */
|
||||||
extern char *st_alloc();
|
|
||||||
extern struct switch_hdr *h_switch_hdr;
|
|
||||||
#define new_switch_hdr() ((struct switch_hdr *) \
|
|
||||||
st_alloc((char **)&h_switch_hdr, sizeof(struct switch_hdr)))
|
|
||||||
#define free_switch_hdr(p) st_free(p, h_switch_hdr, sizeof(struct switch_hdr))
|
|
||||||
|
|
||||||
|
|
||||||
struct case_entry {
|
struct case_entry {
|
||||||
struct case_entry *next;
|
struct case_entry *next;
|
||||||
|
@ -29,12 +21,4 @@ struct case_entry {
|
||||||
arith ce_value;
|
arith ce_value;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
/* allocation definitions of struct case_entry */
|
|
||||||
/* ALLOCDEF "case_entry" */
|
/* ALLOCDEF "case_entry" */
|
||||||
extern char *st_alloc();
|
|
||||||
extern struct case_entry *h_case_entry;
|
|
||||||
#define new_case_entry() ((struct case_entry *) \
|
|
||||||
st_alloc((char **)&h_case_entry, sizeof(struct case_entry)))
|
|
||||||
#define free_case_entry(p) st_free(p, h_case_entry, sizeof(struct case_entry))
|
|
||||||
|
|
||||||
|
|
|
@ -41,12 +41,4 @@ extern struct type *pa_type; /* type.c */
|
||||||
|
|
||||||
extern arith size_of_type(), align();
|
extern arith size_of_type(), align();
|
||||||
|
|
||||||
|
|
||||||
/* allocation definitions of struct type */
|
|
||||||
/* ALLOCDEF "type" */
|
/* ALLOCDEF "type" */
|
||||||
extern char *st_alloc();
|
|
||||||
extern struct type *h_type;
|
|
||||||
#define new_type() ((struct type *) \
|
|
||||||
st_alloc((char **)&h_type, sizeof(struct type)))
|
|
||||||
#define free_type(p) st_free(p, h_type, sizeof(struct type))
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue