Commit be69f92f authored by John van Groningen's avatar John van Groningen

remove field sdef_cons_arity, use sdef_arity instead for RECORDTYPE,

remove more unused fields
parent 687b09f9
......@@ -2919,7 +2919,6 @@ BERecordType (int moduleIndex, BEFlatTypeP lhs, BETypeNodeP constructorType, int
Assert (type->type_lhs->ft_symbol->symb_kind == definition);
sdef = type->type_lhs->ft_symbol->symb_def;
Assert (sdef->sdef_kind == NEWDEFINITION);
sdef->sdef_cons_arity = constructorType->type_node_arity;
sdef->sdef_checkstatus = TypeChecked;
sdef->sdef_kind = RECORDTYPE;
sdef->sdef_type = type;
......
......@@ -890,7 +890,7 @@ static void GenLazyRecordEntry (SymbDef rdef)
argstates = rdef->sdef_record_state.state_record_arguments;
asp = rdef->sdef_cons_arity;
asp = rdef->sdef_arity;
bsp = 0;
arity = asp;
......
......@@ -2279,7 +2279,7 @@ static void FillSymbol (Node node,SymbDef sdef,int *asp_p,int *bsp_p,NodeId upda
LabDef name;
int symbarity;
symbarity = sdef->sdef_kind==RECORDTYPE ? sdef->sdef_cons_arity : sdef->sdef_arity;
symbarity = sdef->sdef_arity;
if (symbarity==node->node_arity){
switch (sdef->sdef_kind){
......
......@@ -447,7 +447,7 @@ static void CodeRootSymbolApplication (Node root,NodeId rootid,SymbDef def,int a
LabDef name;
int symbarity;
symbarity = def->sdef_kind==RECORDTYPE ? def->sdef_cons_arity : def->sdef_arity;
symbarity = def->sdef_arity;
if (symbarity==root->node_arity){
SDefKind symbkind;
......
......@@ -3482,7 +3482,7 @@ void GenLazyRecordDescriptorAndExport (SymbDef sdef)
return;
name = sdef->sdef_ident->ident_name;
arity = sdef->sdef_cons_arity;
arity = sdef->sdef_arity;
if (sdef->sdef_exported){
put_directive_ (Ddescexp);
......
......@@ -1234,7 +1234,7 @@ static char *create_arguments_for_local_function (NodeP node_p,ArgS ***arg_h,Arg
sdef=arg_node->node_symbol->symb_def;
if (arg_node->node_arity==(sdef->sdef_kind==RECORDTYPE ? sdef->sdef_cons_arity : sdef->sdef_arity)){
if (arg_node->node_arity==sdef->sdef_arity){
Bool is_rule;
StateP function_state_p;
......@@ -1676,7 +1676,7 @@ static int is_optimisable_argument (NodeP arg_node,StateP function_arg_state_p)
sdef=arg_node->node_symbol->symb_def;
kind=sdef->sdef_kind;
if (arg_node->node_arity==(kind==RECORDTYPE ? sdef->sdef_cons_arity : sdef->sdef_arity)){
if (arg_node->node_arity==sdef->sdef_arity){
if (kind==IMPRULE || kind==DEFRULE || kind==SYSRULE || (kind==RECORDTYPE && sdef->sdef_strict_constructor))
return 1;
}
......@@ -3550,7 +3550,7 @@ static void ExamineSymbolApplication (struct node *node)
}
}
} else {
if ((sdef->sdef_kind==RECORDTYPE ? sdef->sdef_cons_arity : sdef->sdef_arity) != node->node_arity)
if (sdef->sdef_arity != node->node_arity)
sdef->sdef_mark |= SDEF_USED_CURRIED_MASK;
else
if (IsLazyState (node->node_state))
......
......@@ -2348,7 +2348,7 @@ static Exp ConvertNode (Node node, NodeId nid)
} else {
e->e_fun = sdef->sdef_sa_fun;
if (sdef->sdef_kind==RECORDTYPE ? arity==sdef->sdef_cons_arity : arity==sdef->sdef_arity)
if (arity==sdef->sdef_arity)
e->e_kind = Value;
else {
ConvertToApplyNode (e, node, arity);
......@@ -2477,7 +2477,7 @@ static Exp ConvertNode (Node node, NodeId nid)
/* build a record expression for the new record node */
newrecordexp->e_fun = node->node_symbol->symb_def->sdef_sa_fun;
newrecordexp->e_kind = Value;
arity = node->node_symbol->symb_def->sdef_cons_arity;
arity = node->node_symbol->symb_def->sdef_arity;
/* initialise the arguments of the new record exp */
newrecordexp->e_args = NewExpArgs (arity);
......@@ -2660,7 +2660,7 @@ static Exp convert_pattern (SymbolP symbol_p,int arity,NodeIdListElementP node_i
} else {
e->e_fun = sdef->sdef_sa_fun;
if (sdef->sdef_kind==RECORDTYPE ? arity==sdef->sdef_cons_arity : arity==sdef->sdef_arity)
if (arity==sdef->sdef_arity)
e->e_kind = Value;
else {
convert_pattern_to_apply_node (e,symbol_p,node_id_list,arity);
......@@ -3602,7 +3602,7 @@ static void ConvertSyntaxTree (Symbol symbols)
sdef->sdef_sa_fun = f;
f->fun_symbol = sdef;
arity = f->fun_arity = sdef->sdef_cons_arity;
arity = f->fun_arity = sdef->sdef_arity;
f->fun_kind = Constructor;
f->fun_single = True;
......
......@@ -349,7 +349,7 @@ static void GenRecordState (SymbDef sdef)
CurrentLine = 0 /*rectype->type_line*/;
sdef->sdef_checkstatus = ConvertingToState; /* to detect cyclic strict field dependencies */
SetRecordState (&sdef->sdef_record_state, sdef, sdef->sdef_cons_arity);
SetRecordState (&sdef->sdef_record_state, sdef, sdef->sdef_arity);
fieldstates=sdef->sdef_record_state.state_record_arguments;
strict_record=0;
......@@ -1695,7 +1695,7 @@ static StateP GetStateOfArguments (SymbDef sdef,int actual_arity)
break;
case RECORDTYPE:
state_p=sdef->sdef_record_state.state_record_arguments;
symbol_arity = sdef->sdef_cons_arity;
symbol_arity = sdef->sdef_arity;
break;
default:
return NULL;
......@@ -3235,9 +3235,8 @@ static int get_symbol_arity_or_zero (SymbolP symbol_p)
case SYSRULE:
case IMPRULE:
case CONSTRUCTOR:
return sdef->sdef_arity;
case RECORDTYPE:
return sdef->sdef_cons_arity;
return sdef->sdef_arity;
}
break;
}
......
/*
Version 1.1 23-1-1996
*/
#include "compiledefines.h"
......@@ -605,7 +602,6 @@ STRUCT (symbol_def,SymbDef){
unsigned sdef_number;
unsigned sdef_ancestor;
short sdef_arity;
short sdef_cons_arity;
union {
struct _fun * u3_sa_fun; /* sa.c */
......@@ -688,7 +684,6 @@ typedef FileTime ModuleFileTime;
typedef struct {
Symbol im_name;
Symbol im_symbols;
Types im_types;
ImpRules im_rules;
struct symbol_def * im_start;
DefMod im_def_module;
......@@ -705,9 +700,6 @@ typedef struct {
struct def_repr {
Symbol dm_name;
Symbol dm_symbols;
Types dm_types;
AbsTypes dm_abs_types;
RuleTypes dm_rules;
TableKind dm_system_module_table_kind;
Bool dm_system_module;
#if WRITE_DCL_MODIFICATION_TIME
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment