introduced the ALLOCDEF mechanism
authorerikb <none@none>
Mon, 10 Mar 1986 15:16:33 +0000 (15:16 +0000)
committererikb <none@none>
Mon, 10 Mar 1986 15:16:33 +0000 (15:16 +0000)
12 files changed:
lang/cem/cemcom/code.str
lang/cem/cemcom/declar.str
lang/cem/cemcom/decspecs.str
lang/cem/cemcom/def.str
lang/cem/cemcom/expr.str
lang/cem/cemcom/field.str
lang/cem/cemcom/idf.str
lang/cem/cemcom/macro.str
lang/cem/cemcom/stack.str
lang/cem/cemcom/struct.str
lang/cem/cemcom/switch.str
lang/cem/cemcom/type.str

index 3399b3e..11a00cb 100644 (file)
@@ -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
index 5ecbb70..9a25c58 100644 (file)
@@ -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;
index 0b1598c..8176461 100644 (file)
@@ -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;
index abb2815..14b07de 100644 (file)
@@ -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))
-
index 46e658a..87f6114 100644 (file)
@@ -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)
index 794920b..79830ab 100644 (file)
@@ -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))
-
index 12496de..3b6f702 100644 (file)
@@ -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();
 
index cdd023f..34a62dd 100644 (file)
@@ -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
 */
index 27a7f31..b2776ea 100644 (file)
@@ -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();
index 8caab67..ccd3eaa 100644 (file)
@@ -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();
index 07998b9..9f95fc0 100644 (file)
@@ -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))
-
index 1937a56..9524ef1 100644 (file)
@@ -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))
-