Commit f701bbe3 authored by John van Groningen's avatar John van Groningen
Browse files

add integers and rationals

parent 856490d6
...@@ -27,6 +27,7 @@ void PushBasicOnB (ObjectKind state, int offset); ...@@ -27,6 +27,7 @@ void PushBasicOnB (ObjectKind state, int offset);
void UpdateBasic (int size, int srcoffset, int dstoffset); void UpdateBasic (int size, int srcoffset, int dstoffset);
void CallFunction (Label label, SymbDef def, Bool isjsr, Node root); void CallFunction (Label label, SymbDef def, Bool isjsr, Node root);
void CallFunction1 (Label label, SymbDef def, StateS root_state, Args fun_args, int arity);
void CallArrayFunction (SymbDef def,Bool isjsr,StateP node_state_p); void CallArrayFunction (SymbDef def,Bool isjsr,StateP node_state_p);
...@@ -66,6 +67,9 @@ void GenBuildU (Label symblab,int a_size,int b_size,Label contlab); ...@@ -66,6 +67,9 @@ void GenBuildU (Label symblab,int a_size,int b_size,Label contlab);
void GenBuildArray (int argoffset); void GenBuildArray (int argoffset);
void GenBuildString (SymbValue val); void GenBuildString (SymbValue val);
void GenPushZ (SymbValue val);
void GenPushZR (SymbValue val);
void GenBuildFieldSelector (Label symblab,Label contlab,char *record_name,int arity); void GenBuildFieldSelector (Label symblab,Label contlab,char *record_name,int arity);
void GenFillFieldSelector (Label symblab,Label contlab,char *record_name,int arity,int offset,FillKind fkind); void GenFillFieldSelector (Label symblab,Label contlab,char *record_name,int arity,int offset,FillKind fkind);
...@@ -91,6 +95,7 @@ void GenJsrAp (int n_args); ...@@ -91,6 +95,7 @@ void GenJsrAp (int n_args);
void GenJmpEval (void); void GenJmpEval (void);
void GenJmpAp (int n_args); void GenJmpAp (int n_args);
void GenJmpApUpd (int n_args); void GenJmpApUpd (int n_args);
void GenJmpNotEqZ (SymbValue val,Label tolab);
void GenJmpUpd (Label tolab); void GenJmpUpd (Label tolab);
void GenPopA (int nr); void GenPopA (int nr);
void GenPopB (int nr); void GenPopB (int nr);
...@@ -168,6 +173,7 @@ void GenApplyEntryDirective (int arity,Label label); ...@@ -168,6 +173,7 @@ void GenApplyEntryDirective (int arity,Label label);
void GenLazyRecordNodeEntryDirective (int arity,Label label,Label label2); void GenLazyRecordNodeEntryDirective (int arity,Label label,Label label2);
void GenFieldNodeEntryDirective (int arity, Label label, Label label2,char *record_name); void GenFieldNodeEntryDirective (int arity, Label label, Label label2,char *record_name);
void GenConstructorDescriptorAndExport (SymbDef sdef); void GenConstructorDescriptorAndExport (SymbDef sdef);
void GenConstructor0DescriptorAndExport (SymbDef sdef,int constructor_n);
void GenFunctionDescriptorAndExportNodeAndDescriptor (SymbDef sdef); void GenFunctionDescriptorAndExportNodeAndDescriptor (SymbDef sdef);
void GenConstructorFunctionDescriptorAndExportNodeAndDescriptor (SymbDef sdef); void GenConstructorFunctionDescriptorAndExportNodeAndDescriptor (SymbDef sdef);
#if OPTIMIZE_LAZY_TUPLE_RECURSION #if OPTIMIZE_LAZY_TUPLE_RECURSION
......
...@@ -497,9 +497,9 @@ static Node copy_root_node (Node old) ...@@ -497,9 +497,9 @@ static Node copy_root_node (Node old)
case_node_arg_p=case_node_p->node_arguments; case_node_arg_p=case_node_p->node_arguments;
if (case_node_p->node_kind==CaseNode){
new_case_node_p->node_su.su_u.u_case=CompAllocType (CaseNodeContentsS); new_case_node_p->node_su.su_u.u_case=CompAllocType (CaseNodeContentsS);
if (case_node_p->node_kind==CaseNode){
new_case_node_p->node_node_defs = copy_rhs_node_ids_of_node_defs (case_node_p->node_node_defs,NULL); new_case_node_p->node_node_defs = copy_rhs_node_ids_of_node_defs (case_node_p->node_node_defs,NULL);
if (case_node_arg_p->arg_node->node_kind==PushNode){ if (case_node_arg_p->arg_node->node_kind==PushNode){
...@@ -570,9 +570,49 @@ static Node copy_root_node (Node old) ...@@ -570,9 +570,49 @@ static Node copy_root_node (Node old)
new_case_node_arg_p->arg_node = copy_root_node (case_node_arg_p->arg_node); new_case_node_arg_p->arg_node = copy_root_node (case_node_arg_p->arg_node);
} }
} else if (case_node_p->node_kind==DefaultNode){ } else if (case_node_p->node_kind==DefaultNode){
new_case_node_p->node_su.su_u.u_case=CompAllocType (CaseNodeContentsS);
new_case_node_p->node_node_defs = copy_rhs_node_ids_of_node_defs (case_node_p->node_node_defs,NULL); new_case_node_p->node_node_defs = copy_rhs_node_ids_of_node_defs (case_node_p->node_node_defs,NULL);
copy_nodes_of_node_defs (new_case_node_p->node_node_defs,False); copy_nodes_of_node_defs (new_case_node_p->node_node_defs,False);
new_case_node_arg_p->arg_node = copy_root_node (case_node_arg_p->arg_node); new_case_node_arg_p->arg_node = copy_root_node (case_node_arg_p->arg_node);
} else if (case_node_p->node_kind==OverloadedCaseNode){
NodeP new_overloaded_case_node_p;
ArgP new_overloaded_case_node_arg2_p;
new_overloaded_case_node_arg2_p=CompAllocType (ArgS);
new_overloaded_case_node_arg2_p->arg_state=LazyState;
new_overloaded_case_node_arg2_p->arg_next=NULL;
new_case_node_arg_p->arg_next=new_overloaded_case_node_arg2_p;
new_case_node_arg_p->arg_node=copy_node (case_node_arg_p->arg_node,False);
new_overloaded_case_node_arg2_p->arg_node=copy_node (case_node_arg_p->arg_next->arg_node,False);
case_node_p=case_node_p->node_node;
new_overloaded_case_node_p=new_case_node_p;
new_case_node_p = CompAllocType (NodeS);
*new_case_node_p = *case_node_p;
new_overloaded_case_node_p->node_node = new_case_node_p;
new_case_node_arg_p=CompAllocType (ArgS);
new_case_node_arg_p->arg_state=LazyState;
new_case_node_p->node_arguments=new_case_node_arg_p;
new_case_node_arg_p->arg_next=NULL;
case_node_arg_p=case_node_p->node_arguments;
new_case_node_p->node_su.su_u.u_case=CompAllocType (CaseNodeContentsS);
new_case_node_p->node_node_defs = copy_rhs_node_ids_of_node_defs (case_node_p->node_node_defs,NULL);
copy_nodes_of_node_defs (new_case_node_p->node_node_defs,False);
new_case_node_arg_p->arg_node = copy_root_node (case_node_arg_p->arg_node);
} else } else
error_in_function ("copy_root_node"); error_in_function ("copy_root_node");
...@@ -3086,6 +3126,23 @@ static void optimise_root_node (NodeP node,NodeDefP node_defs,FreeUniqueNodeIdsP ...@@ -3086,6 +3126,23 @@ static void optimise_root_node (NodeP node,NodeDefP node_defs,FreeUniqueNodeIdsP
optimise_root_node (case_alt_node_p,case_node->node_node_defs,case_f_node_ids); optimise_root_node (case_alt_node_p,case_node->node_node_defs,case_f_node_ids);
set_global_reference_counts (case_node); set_global_reference_counts (case_node);
} else if (case_node->node_kind==OverloadedCaseNode){
NodeP case_alt_node_p;
FreeUniqueNodeIdsP case_f_node_ids;
case_node=case_node->node_node;
case_f_node_ids=f_node_ids;
case_alt_node_p=case_node->node_arguments->arg_node;
set_local_reference_counts (case_node);
optimise_root_node (case_alt_node_p,case_node->node_node_defs,case_f_node_ids);
set_global_reference_counts (case_node);
} else } else
error_in_function ("optimise_root_node"); error_in_function ("optimise_root_node");
} }
...@@ -3609,11 +3666,22 @@ static void ReorderNodeDefinitionsAndDetermineUsedEntries (NodeDefs *def_p,Node ...@@ -3609,11 +3666,22 @@ static void ReorderNodeDefinitionsAndDetermineUsedEntries (NodeDefs *def_p,Node
error_in_function ("ReorderNodeDefinitionsAndDetermineUsedEntries"); error_in_function ("ReorderNodeDefinitionsAndDetermineUsedEntries");
for_l (arg,root->node_arguments,arg_next){ for_l (arg,root->node_arguments,arg_next){
if (arg->arg_node->node_kind!=CaseNode && arg->arg_node->node_kind!=DefaultNode) if (arg->arg_node->node_kind==OverloadedCaseNode){
NodeP overloaded_case_node_p,case_node_p;
overloaded_case_node_p=arg->arg_node;
MarkDependentNodeDefs (overloaded_case_node_p->node_arguments->arg_node);
MarkDependentNodeDefs (overloaded_case_node_p->node_arguments->arg_next->arg_node);
case_node_p=overloaded_case_node_p->node_node;
ReorderNodeDefinitionsAndDetermineUsedEntries (&case_node_p->node_node_defs,case_node_p->node_arguments->arg_node);
} else {
if (arg->arg_node->node_kind!=CaseNode && arg->arg_node->node_kind!=DefaultNode && arg->arg_node->node_kind!=OverloadedCaseNode)
error_in_function ("ReorderNodeDefinitionsAndDetermineUsedEntries"); error_in_function ("ReorderNodeDefinitionsAndDetermineUsedEntries");
ReorderNodeDefinitionsAndDetermineUsedEntries (&arg->arg_node->node_node_defs,arg->arg_node->node_arguments->arg_node); ReorderNodeDefinitionsAndDetermineUsedEntries (&arg->arg_node->node_node_defs,arg->arg_node->node_arguments->arg_node);
} }
}
return; return;
} else if (root->node_kind==GuardNode){ } else if (root->node_kind==GuardNode){
...@@ -3847,6 +3915,18 @@ static void determine_then_else_ref_counts (NodeP node) ...@@ -3847,6 +3915,18 @@ static void determine_then_else_ref_counts (NodeP node)
set_global_reference_counts (case_node); set_global_reference_counts (case_node);
--node->node_node_id->nid_refcount; --node->node_node_id->nid_refcount;
} else if (case_node->node_kind==OverloadedCaseNode){
case_node=case_node->node_node;
++node->node_node_id->nid_refcount;
set_local_reference_counts (case_node);
determine_then_else_ref_counts (case_node->node_arguments->arg_node);
set_global_reference_counts (case_node);
--node->node_node_id->nid_refcount;
} else } else
error_in_function ("determine_then_else_ref_counts"); error_in_function ("determine_then_else_ref_counts");
} }
......
...@@ -776,7 +776,7 @@ static int determine_failing_cases_and_adjust_ref_counts (NodeP node,NodeIdRefCo ...@@ -776,7 +776,7 @@ static int determine_failing_cases_and_adjust_ref_counts (NodeP node,NodeIdRefCo
node_id_ref_count_list_sorted=0; node_id_ref_count_list_sorted=0;
for (arg=node->node_arguments; arg!=NULL; arg=arg->arg_next) for (arg=node->node_arguments; arg!=NULL; arg=arg->arg_next)
if (arg->arg_node->node_kind!=CaseNode) if (arg->arg_node->node_kind!=CaseNode && arg->arg_node->node_kind!=OverloadedCaseNode)
break; break;
default_may_fail=1; default_may_fail=1;
...@@ -853,6 +853,9 @@ static int determine_failing_cases_and_adjust_ref_counts (NodeP node,NodeIdRefCo ...@@ -853,6 +853,9 @@ static int determine_failing_cases_and_adjust_ref_counts (NodeP node,NodeIdRefCo
arg_node=arg->arg_node; arg_node=arg->arg_node;
switch (arg_node->node_kind){ switch (arg_node->node_kind){
case OverloadedCaseNode:
arg_node = arg_node->node_node;
/* no break */
case CaseNode: case CaseNode:
{ {
int case_may_fail; int case_may_fail;
......
...@@ -2136,6 +2136,11 @@ static void InitNode (Node node) ...@@ -2136,6 +2136,11 @@ static void InitNode (Node node)
InitNode (case_alt_node_p); InitNode (case_alt_node_p);
InitNodeDefs (node_p->node_node_defs); InitNodeDefs (node_p->node_node_defs);
} else if (node_p->node_kind==OverloadedCaseNode){
node_p=node_p->node_node;
InitNode (node_p->node_arguments->arg_node);
InitNodeDefs (node_p->node_node_defs);
} else if (node_p->node_kind==DefaultNode){ } else if (node_p->node_kind==DefaultNode){
InitNode (node_p->node_arguments->arg_node); InitNode (node_p->node_arguments->arg_node);
InitNodeDefs (node_p->node_node_defs); InitNodeDefs (node_p->node_node_defs);
...@@ -2684,6 +2689,11 @@ static void convert_switch_node (NodeP switch_node_p,Alts fun_alt_p) ...@@ -2684,6 +2689,11 @@ static void convert_switch_node (NodeP switch_node_p,Alts fun_alt_p)
} else if (node_p->node_kind==DefaultNode){ } else if (node_p->node_kind==DefaultNode){
case_alt_node_p=node_p->node_arguments->arg_node; case_alt_node_p=node_p->node_arguments->arg_node;
case_alt_p->fun_lhs=NULL; case_alt_p->fun_lhs=NULL;
} else if (node_p->node_kind==OverloadedCaseNode){
node_p=node_p->node_node;
case_alt_node_p=node_p->node_arguments->arg_node;
case_alt_p->fun_lhs=⊤
} else } else
error_in_function ("convert_switch_node"); error_in_function ("convert_switch_node");
......
...@@ -31,9 +31,7 @@ static void set_node_id_scope_numbers (NodeDefP node_defs,int local_scope) ...@@ -31,9 +31,7 @@ static void set_node_id_scope_numbers (NodeDefP node_defs,int local_scope)
static void set_root_scope_numbers (NodeP node_p,int local_scope) static void set_root_scope_numbers (NodeP node_p,int local_scope)
{ {
/* RWS added switch nodes */ switch (node_p->node_kind){
switch (node_p->node_kind)
{
case IfNode: case IfNode:
{ {
int new_local_scope; int new_local_scope;
...@@ -56,8 +54,9 @@ static void set_root_scope_numbers (NodeP node_p,int local_scope) ...@@ -56,8 +54,9 @@ static void set_root_scope_numbers (NodeP node_p,int local_scope)
arg_p=arg_p->arg_next; arg_p=arg_p->arg_next;
set_root_scope_numbers (arg_p->arg_node,new_local_scope); set_root_scope_numbers (arg_p->arg_node,new_local_scope);
set_node_id_scope_numbers (node_p->node_else_node_defs,new_local_scope); set_node_id_scope_numbers (node_p->node_else_node_defs,new_local_scope);
}
break; break;
}
case SwitchNode: case SwitchNode:
{ {
ArgP arg_p; ArgP arg_p;
...@@ -75,20 +74,26 @@ static void set_root_scope_numbers (NodeP node_p,int local_scope) ...@@ -75,20 +74,26 @@ static void set_root_scope_numbers (NodeP node_p,int local_scope)
NodeP case_alt_node_p; NodeP case_alt_node_p;
case_alt_node_p=node_p->node_arguments->arg_node; case_alt_node_p=node_p->node_arguments->arg_node;
/* Cedewarrior bug if (case_alt_node_p->node_kind==PushNode) */ /* Cedewarrior bug if (case_alt_node_p->node_kind==PushNode) */
if (node_p->node_arguments->arg_node->node_kind==PushNode) if (node_p->node_arguments->arg_node->node_kind==PushNode)
set_root_scope_numbers (case_alt_node_p->node_arguments->arg_next->arg_node, local_scope); set_root_scope_numbers (case_alt_node_p->node_arguments->arg_next->arg_node, local_scope);
else else
set_root_scope_numbers (node_p->node_arguments->arg_node, local_scope); set_root_scope_numbers (node_p->node_arguments->arg_node, local_scope);
} else if (node_p->node_kind==DefaultNode){ } else if (node_p->node_kind==DefaultNode){
set_root_scope_numbers (node_p->node_arguments->arg_node, local_scope); set_root_scope_numbers (node_p->node_arguments->arg_node, local_scope);
} else if (node_p->node_kind==OverloadedCaseNode){
node_p=node_p->node_node;
set_root_scope_numbers (node_p->node_arguments->arg_node, local_scope);
} else } else
ErrorInCompiler ("set_scope_numbers.c", "set_root_scope_numbers", ""); ErrorInCompiler ("set_scope_numbers.c", "set_root_scope_numbers", "");
set_node_id_scope_numbers (node_p->node_node_defs,local_scope); set_node_id_scope_numbers (node_p->node_node_defs,local_scope);
} }
}
break; break;
}
case GuardNode: case GuardNode:
{ {
int old_scope; int old_scope;
......
...@@ -570,6 +570,10 @@ static void ChangeElementStateForStrictAbsTypeFields (SymbDef icl_sdef,SymbDef d ...@@ -570,6 +570,10 @@ static void ChangeElementStateForStrictAbsTypeFields (SymbDef icl_sdef,SymbDef d
} }
} }
#ifdef CLEAN2
SymbDefP special_types[2];
#endif
void GenerateStatesForRecords (Symbol symbols) void GenerateStatesForRecords (Symbol symbols)
{ {
Symbol symb; Symbol symb;
...@@ -609,6 +613,11 @@ void GenerateStatesForRecords (Symbol symbols) ...@@ -609,6 +613,11 @@ void GenerateStatesForRecords (Symbol symbols)
} }
} }
} }
#ifdef CLEAN2
if (special_types[0]!=NULL)
BasicSymbolStates[integer_denot] = special_types[0]->sdef_record_state;
#endif
} }
/* /*
...@@ -2385,6 +2394,15 @@ static void DetermineStatesSwitchRootNode (Node root_node, StateS demstate, int ...@@ -2385,6 +2394,15 @@ static void DetermineStatesSwitchRootNode (Node root_node, StateS demstate, int
DetermineStatesOfRootNodeAndDefs (node->node_arguments->arg_node,&node->node_node_defs,demstate,local_scope); DetermineStatesOfRootNodeAndDefs (node->node_arguments->arg_node,&node->node_node_defs,demstate,local_scope);
} else if (node->node_kind==DefaultNode){ } else if (node->node_kind==DefaultNode){
DetermineStatesOfRootNodeAndDefs (node->node_arguments->arg_node,&node->node_node_defs,demstate,local_scope); DetermineStatesOfRootNodeAndDefs (node->node_arguments->arg_node,&node->node_node_defs,demstate,local_scope);
} else if (node->node_kind==OverloadedCaseNode){
NodeP case_node_p;
DetermineStrictArgContext (node->node_arguments,StrictState,local_scope);
if (ShouldDecrRefCount)
DecrRefCountCopiesOfArg (node->node_arguments->arg_next IF_OPTIMIZE_LAZY_TUPLE_RECURSION(local_scope));
case_node_p=node->node_node;
DetermineStatesOfRootNodeAndDefs (case_node_p->node_arguments->arg_node,&case_node_p->node_node_defs,demstate,local_scope);
} else } else
error_in_function ("DetermineStatesSwitchRootNode"); error_in_function ("DetermineStatesSwitchRootNode");
} }
...@@ -2785,6 +2803,8 @@ static void DetermineStatesOfNodeAndDefs (Node root_node,NodeDefs node_defs,Stat ...@@ -2785,6 +2803,8 @@ static void DetermineStatesOfNodeAndDefs (Node root_node,NodeDefs node_defs,Stat
DetermineStatesOfNodeAndDefs (case_alt_node_p,arg_node_p->node_node_defs,demstate,local_scope); DetermineStatesOfNodeAndDefs (case_alt_node_p,arg_node_p->node_node_defs,demstate,local_scope);
} else if (arg_node_p->node_kind==DefaultNode){ } else if (arg_node_p->node_kind==DefaultNode){
DetermineStatesOfNodeAndDefs (arg_node_p->node_arguments->arg_node,arg_node_p->node_node_defs,demstate,local_scope); DetermineStatesOfNodeAndDefs (arg_node_p->node_arguments->arg_node,arg_node_p->node_node_defs,demstate,local_scope);
} else if (arg_node_p->node_kind==OverloadedCaseNode){
DetermineStatesOfNodeAndDefs (arg_node_p->node_node->node_arguments->arg_node,arg_node_p->node_node->node_node_defs,demstate,local_scope);
} else } else
error_in_function ("DetermineStatesOfNodeAndDefs"); error_in_function ("DetermineStatesOfNodeAndDefs");
} }
...@@ -3160,6 +3180,8 @@ static NodeP add_argument_to_switch_node (NodeP rhs_root_p,NodeIdP new_node_id_p ...@@ -3160,6 +3180,8 @@ static NodeP add_argument_to_switch_node (NodeP rhs_root_p,NodeIdP new_node_id_p
node_h=&(*node_h)->node_arguments->arg_next->arg_node; node_h=&(*node_h)->node_arguments->arg_next->arg_node;
} else if (node_p->node_kind==DefaultNode){ } else if (node_p->node_kind==DefaultNode){
node_h=&node_p->node_arguments->arg_node; node_h=&node_p->node_arguments->arg_node;
} else if (node_p->node_kind==OverloadedCaseNode){
node_h=&node_p->node_node->node_arguments->arg_node;
} else } else
error_in_function ("add_argument_to_switch_node"); error_in_function ("add_argument_to_switch_node");
...@@ -3680,8 +3702,7 @@ static NodeDefs *CollectSharedNodeIdsInRootNode (Node* node_p,NodeId parent_node ...@@ -3680,8 +3702,7 @@ static NodeDefs *CollectSharedNodeIdsInRootNode (Node* node_p,NodeId parent_node
root_node=*node_p; root_node=*node_p;
switch (root_node->node_kind) switch (root_node->node_kind){
{
case SwitchNode: case SwitchNode:
{ {
ArgP arg_p; ArgP arg_p;
...@@ -3697,9 +3718,8 @@ static NodeDefs *CollectSharedNodeIdsInRootNode (Node* node_p,NodeId parent_node ...@@ -3697,9 +3718,8 @@ static NodeDefs *CollectSharedNodeIdsInRootNode (Node* node_p,NodeId parent_node
case_alt_node_p=node->node_arguments->arg_node; case_alt_node_p=node->node_arguments->arg_node;
case_last=&node->node_node_defs; case_last=&node->node_node_defs;
/* Codewarrior bug if (case_alt_node_p->node_kind==PushNode){ */ /* Codewarrior bug if (case_alt_node_p->node_kind==PushNode){ */
if (node->node_arguments->arg_node->node_kind==PushNode){ if (node->node_arguments->arg_node->node_kind==PushNode)
case_last=CollectSharedNodeIdsInRootNode (&case_alt_node_p->node_arguments->arg_next->arg_node, parent_node_id, case_last); case_last=CollectSharedNodeIdsInRootNode (&case_alt_node_p->node_arguments->arg_next->arg_node, parent_node_id, case_last);
}
else else
case_last=CollectSharedNodeIdsInRootNode (&node->node_arguments->arg_node, parent_node_id, case_last); case_last=CollectSharedNodeIdsInRootNode (&node->node_arguments->arg_node, parent_node_id, case_last);
*case_last=NULL; *case_last=NULL;
...@@ -3709,6 +3729,22 @@ static NodeDefs *CollectSharedNodeIdsInRootNode (Node* node_p,NodeId parent_node ...@@ -3709,6 +3729,22 @@ static NodeDefs *CollectSharedNodeIdsInRootNode (Node* node_p,NodeId parent_node
default_last=&node->node_node_defs; default_last=&node->node_node_defs;
default_last=CollectSharedNodeIdsInRootNode (&node->node_arguments->arg_node, parent_node_id, default_last); default_last=CollectSharedNodeIdsInRootNode (&node->node_arguments->arg_node, parent_node_id, default_last);
*default_last=NULL; *default_last=NULL;
} else if (node->node_kind==OverloadedCaseNode){
NodeP case_node_p;
NodeDefs *case_last;
ArgP arg;
arg=node->node_arguments;
arg->arg_state=LazyState;
last = CollectSharedNodeIdsInNode (&arg->arg_node,parent_node_id,last);
arg=arg->arg_next;
arg->arg_state=LazyState;
last = CollectSharedNodeIdsInNode (&arg->arg_node,parent_node_id,last);
case_node_p=node->node_node;
case_last=&case_node_p->node_node_defs;
case_last=CollectSharedNodeIdsInRootNode (&case_node_p->node_arguments->arg_node, parent_node_id, case_last);
*case_last=NULL;
} else } else
error_in_function ("CollectSharedNodeIdsInRootNode"); error_in_function ("CollectSharedNodeIdsInRootNode");
} }
...@@ -3765,11 +3801,11 @@ static void CollectSharedAndAnnotatedNodesInRhs (NodeS **root_p,NodeDefS **defs_ ...@@ -3765,11 +3801,11 @@ static void CollectSharedAndAnnotatedNodesInRhs (NodeS **root_p,NodeDefS **defs_
if ((imp_rule_p->rule_mark & RULE_LAMBDA_FUNCTION_MASK) && if ((imp_rule_p->rule_mark & RULE_LAMBDA_FUNCTION_MASK) &&
root_node->node_symbol->symb_def->sdef_arity==root_node->node_arity && root_node->node_symbol->symb_def->sdef_arity==root_node->node_arity &&
imp_rule_p->rule_alts->alt_next==NULL imp_rule_p->rule_alts->alt_next==NULL
# ifdef TRANSFORM_PATTERNS_BEFORE_STRICTNESS_ANALYSIS # ifdef TRANSFORM_PATTERNS_BEFORE_STRICTNESS_ANALYSIS
&& ! (imp_rule_p->rule_alts->alt_rhs_root->node_kind==SwitchNode || && ! (imp_rule_p->rule_alts->alt_rhs_root->node_kind==SwitchNode ||
imp_rule_p->rule_alts->alt_rhs_root->node_kind==GuardNode || imp_rule_p->rule_alts->alt_rhs_root->node_kind==GuardNode ||
imp_rule_p->rule_alts->alt_rhs_root->node_kind==IfNode) imp_rule_p->rule_alts->alt_rhs_root->node_kind==IfNode)
# endif # endif
) )
{ {
ArgP call_arg_p,lhs_arg_p; ArgP call_arg_p,lhs_arg_p;
...@@ -3905,8 +3941,7 @@ static void AnnotateStrictNodeIds (Node node,StrictNodeIdP strict_node_ids,NodeD ...@@ -3905,8 +3941,7 @@ static void AnnotateStrictNodeIds (Node node,StrictNodeIdP strict_node_ids,NodeD
node_id->nid_node->node_annotation=StrictAnnot; node_id->nid_node->node_annotation=StrictAnnot;
} }
switch (node->node_kind) switch (node->node_kind){
{
case IfNode: case IfNode:
{ {
ArgS *arg; ArgS *arg;
...@@ -3938,6 +3973,11 @@ static void AnnotateStrictNodeIds (Node node,StrictNodeIdP strict_node_ids,NodeD ...@@ -3938,6 +3973,11 @@ static void AnnotateStrictNodeIds (Node node,StrictNodeIdP strict_node_ids,NodeD
AnnotateStrictNodeIds (node->node_arguments->arg_node,node->node_strict_node_ids,&node->node_node_defs); AnnotateStrictNodeIds (node->node_arguments->arg_node,node->node_strict_node_ids,&node->node_node_defs);
} else if (node->node_kind==DefaultNode){ } else if (node->node_kind==DefaultNode){
AnnotateStrictNodeIds (node->node_arguments->arg_node,node->node_strict_node_ids,&node->node_node_defs); AnnotateStrictNodeIds (node->node_arguments->arg_node,node->node_strict_node_ids,&node->node_node_defs);
} else if (node->node_kind==OverloadedCaseNode){
NodeP case_node_p;
case_node_p=node->node_node;
AnnotateStrictNodeIds (case_node_p->node_arguments->arg_node,case_node_p->node_strict_node_ids,&case_node_p->node_node_defs);
} else } else
error_in_function ("AnnotateStrictNodeIds"); error_in_function ("AnnotateStrictNodeIds");
} }
...@@ -4091,6 +4131,16 @@ static void reset_states_and_ref_count_copies_of_root_node (NodeP node_p) ...@@ -4091,6 +4131,16 @@ static void reset_states_and_ref_count_copies_of_root_node (NodeP node_p)
} else if (node_p->node_kind==DefaultNode){ } else if (node_p->node_kind==DefaultNode){
reset_states_and_ref_count_copies_of_root_node (node_p->node_arguments->arg_node); reset_states_and_ref_count_copies_of_root_node (node_p->node_arguments->arg_node);
reset_states_and_ref_count_copies_of_node_defs (node_p->node_node_defs); reset_states_and_ref_count_copies_of_node_defs (node_p->node_node_defs);
} else if (node_p->node_kind==OverloadedCaseNode){
NodeP case_node_p;
case_node_p=node_p->node_node;
reset_states_and_ref_count_copies_of_root_node (case_node_p->node_arguments->arg_node);
reset_states_and_ref_count_copies_of_node_defs (case_node_p->node_node_defs);
reset_states_and_ref_count_copies_of_node (node_p->node_arguments->arg_node);
reset_states_and_ref_count_copies_of_node (node_p->node_arguments->arg_next->arg_node);
} else } else
error_in_function ("reset_states_and_ref_count_copies_of_root_node"); error_in_function ("reset_states_and_ref_count_copies_of_root_node");
} }
...@@ -4200,5 +4250,6 @@ void InitStatesGen (void) ...@@ -4200,5 +4250,6 @@ void InitStatesGen (void)
SetUnaryState (& BasicSymbolStates[tuple_type], StrictOnA, TupleObj); SetUnaryState (& BasicSymbolStates[tuple_type], StrictOnA, TupleObj);
#ifdef CLEAN2 #ifdef CLEAN2
SetUnaryState (& BasicSymbolStates[dynamic_type], StrictOnA, DynamicObj); SetUnaryState (& BasicSymbolStates[dynamic_type], StrictOnA, DynamicObj);
SetUnaryState (& BasicSymbolStates[rational_denot], StrictOnA, UnknownObj);
#endif #endif
} }
...@@ -32,3 +32,5 @@ extern void ConvertTypeToState (TypeNode type,States state,StateKind kind); ...@@ -32,3 +32,5 @@ extern void ConvertTypeToState (TypeNode type,States state,StateKind kind);
extern int optimise_strict_tuple_result_functions; extern int optimise_strict_tuple_result_functions;
extern PolyList UserDefinedArrayFunctions; extern PolyList UserDefinedArrayFunctions;
extern SymbDefP special_types[];
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