From 69e7c2d0ae455c2b6bb211a76f074cb1f5c090b5 Mon Sep 17 00:00:00 2001 From: erikb Date: Mon, 10 Mar 1986 15:16:33 +0000 Subject: [PATCH] introduced the ALLOCDEF mechanism --- lang/cem/cemcom/code.str | 8 -------- lang/cem/cemcom/declar.str | 16 ---------------- lang/cem/cemcom/decspecs.str | 8 -------- lang/cem/cemcom/def.str | 8 -------- lang/cem/cemcom/expr.str | 8 -------- lang/cem/cemcom/field.str | 8 -------- lang/cem/cemcom/idf.str | 16 ---------------- lang/cem/cemcom/macro.str | 8 -------- lang/cem/cemcom/stack.str | 16 ---------------- lang/cem/cemcom/struct.str | 16 ---------------- lang/cem/cemcom/switch.str | 16 ---------------- lang/cem/cemcom/type.str | 8 -------- 12 files changed, 136 deletions(-) diff --git a/lang/cem/cemcom/code.str b/lang/cem/cemcom/code.str index 3399b3e02..11a00cb68 100644 --- a/lang/cem/cemcom/code.str +++ b/lang/cem/cemcom/code.str @@ -7,15 +7,7 @@ struct stat_block { label st_continue; }; - -/* allocation definitions of struct 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 RVAL 1 diff --git a/lang/cem/cemcom/declar.str b/lang/cem/cemcom/declar.str index 5ecbb70c2..9a25c58a2 100644 --- a/lang/cem/cemcom/declar.str +++ b/lang/cem/cemcom/declar.str @@ -13,15 +13,7 @@ struct declarator { struct idstack_item *dc_fparams; /* params for function */ }; - -/* allocation definitions of struct 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) @@ -31,15 +23,7 @@ struct decl_unary { arith du_count; /* for ARRAYs only */ }; - -/* allocation definitions of struct 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 declarator null_declarator; diff --git a/lang/cem/cemcom/decspecs.str b/lang/cem/cemcom/decspecs.str index 0b1598c0e..817646134 100644 --- a/lang/cem/cemcom/decspecs.str +++ b/lang/cem/cemcom/decspecs.str @@ -10,14 +10,6 @@ struct decspecs { int ds_unsigned; /* 0 or 1 */ }; - -/* allocation definitions of struct 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; diff --git a/lang/cem/cemcom/def.str b/lang/cem/cemcom/def.str index abb281559..14b07dea8 100644 --- a/lang/cem/cemcom/def.str +++ b/lang/cem/cemcom/def.str @@ -26,12 +26,4 @@ struct def { /* for ordinary tags */ #define REG_DEFAULT 1 /* register candidate, not declared as such */ #define REG_BONUS 10 /* register candidate, declared as such */ - -/* allocation definitions of struct 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)) - diff --git a/lang/cem/cemcom/expr.str b/lang/cem/cemcom/expr.str index 46e658a05..87f611420 100644 --- a/lang/cem/cemcom/expr.str +++ b/lang/cem/cemcom/expr.str @@ -89,14 +89,6 @@ struct expr { extern struct expr *intexpr(), *new_oper(); - -/* allocation definitions of struct 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) diff --git a/lang/cem/cemcom/field.str b/lang/cem/cemcom/field.str index 794920b66..79830abc6 100644 --- a/lang/cem/cemcom/field.str +++ b/lang/cem/cemcom/field.str @@ -9,12 +9,4 @@ struct field { /* for field specifiers */ struct sdef *fd_sdef; /* upward pointer */ }; - -/* allocation definitions of struct 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)) - diff --git a/lang/cem/cemcom/idf.str b/lang/cem/cemcom/idf.str index 12496de18..3b6f70218 100644 --- a/lang/cem/cemcom/idf.str +++ b/lang/cem/cemcom/idf.str @@ -27,15 +27,7 @@ struct idstack_item { /* stack of identifiers */ struct idf *is_idf; }; - -/* allocation definitions of struct 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 *next; @@ -52,15 +44,7 @@ struct idf { int id_special; /* special action needed at occurrence */ }; - -/* allocation definitions of struct 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(); diff --git a/lang/cem/cemcom/macro.str b/lang/cem/cemcom/macro.str index cdd023f89..34a62dd58 100644 --- a/lang/cem/cemcom/macro.str +++ b/lang/cem/cemcom/macro.str @@ -26,15 +26,7 @@ struct macro { char mc_flag; /* marking this macro */ }; - -/* allocation definitions of struct 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 */ diff --git a/lang/cem/cemcom/stack.str b/lang/cem/cemcom/stack.str index 27a7f312f..b2776ea4d 100644 --- a/lang/cem/cemcom/stack.str +++ b/lang/cem/cemcom/stack.str @@ -16,30 +16,14 @@ struct stack_level { int sl_level; }; - -/* allocation definitions of struct 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 *next; struct idf *se_idf; }; - -/* allocation definitions of struct 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 *stack_level_of(); diff --git a/lang/cem/cemcom/struct.str b/lang/cem/cemcom/struct.str index 8caab6786..ccd3eaa70 100644 --- a/lang/cem/cemcom/struct.str +++ b/lang/cem/cemcom/struct.str @@ -13,15 +13,7 @@ struct sdef { /* for selectors */ extern char *st_alloc(); - -/* allocation definitions of struct 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 *next; @@ -31,14 +23,6 @@ struct tag { /* for struct-, union- and enum tags */ }; - -/* allocation definitions of struct 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(); diff --git a/lang/cem/cemcom/switch.str b/lang/cem/cemcom/switch.str index 07998b9e7..9f95fc0fb 100644 --- a/lang/cem/cemcom/switch.str +++ b/lang/cem/cemcom/switch.str @@ -13,15 +13,7 @@ struct switch_hdr { struct case_entry *sh_entries; }; - -/* allocation definitions of struct 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 *next; @@ -29,12 +21,4 @@ struct case_entry { arith ce_value; }; - -/* allocation definitions of struct 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)) - diff --git a/lang/cem/cemcom/type.str b/lang/cem/cemcom/type.str index 1937a569e..9524ef169 100644 --- a/lang/cem/cemcom/type.str +++ b/lang/cem/cemcom/type.str @@ -41,12 +41,4 @@ extern struct type *pa_type; /* type.c */ extern arith size_of_type(), align(); - -/* allocation definitions of struct 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)) -