Commit 1ea8a0bd authored by johnvg@science.ru.nl's avatar johnvg@science.ru.nl

replace field sdef_ident by sdef_name in struct symbol_def of backend

parent a8376e8d
This diff is collapsed.
extern Ident ApplyId, IfId, FailId, StdBoolId,
AndId, OrId, ArrayId, StrictArrayId, UnboxedArrayId, ArrayClassId;
#if STRICT_LISTS
extern Ident StrictListId,UnboxedListId,TailStrictListId,StrictTailStrictListId,UnboxedTailStrictListId;
#endif
#ifdef CLEAN2
extern Ident DynamicId;
#endif
extern Ident ApplyId, IfId, FailId;
extern char *StdBoolId;
extern SymbDef AndSymbDef,OrSymbDef,abort_symb_def,undef_symb_def;
#if SA_RECOGNIZES_ABORT_AND_UNDEF
extern Ident StdMiscId,abort_id,undef_id;
extern char *StdMiscId;
#endif
extern Ident PreludeId,seq_id,system_seq_id;
extern char *PreludeId;
extern SymbDef seq_symb_def;
extern Symbol StartSymbol;
extern SymbDef scc_dependency_list;
SymbDef MakeNewSymbolDefinition (char * module, Ident name, int arity, SDefKind kind);
SymbDef MakeNewSymbolDefinition (char *module, char *name, int arity, SDefKind kind);
char *ConvertSymbolToString (Symbol symb);
void ReadInlineCode (void);
void InitChecker (void);
......
......@@ -72,28 +72,29 @@ void ReadInlineCode (void)
}
}
Ident ApplyId, DynamicId, StdBoolId, IfId, FailId, AndId, OrId;
Ident ApplyId, IfId, FailId;
char *StdBoolId;
SymbDef AndSymbDef,OrSymbDef;
#if SA_RECOGNIZES_ABORT_AND_UNDEF
Ident StdMiscId,abort_id,undef_id;
char *StdMiscId;
SymbDef abort_symb_def,undef_symb_def;
#endif
Ident PreludeId,seq_id,system_seq_id;
Symbol StartSymbol;
SymbDef ArrayFunctionDefs [NoArrayFun],StdArrayAbortDef;
char *PreludeId;
SymbDef seq_symb_def;
SymbDef scc_dependency_list;
SymbDef MakeNewSymbolDefinition (char * module, Ident name, int arity, SDefKind kind)
SymbDef MakeNewSymbolDefinition (char *module, char *name, int arity, SDefKind kind)
{
SymbDef def;
def = CompAllocType (SymbDefS);
def->sdef_module = module;
def->sdef_ident = name;
def->sdef_name = name;
def->sdef_arity = arity;
def->sdef_kind = kind;
......@@ -121,11 +122,6 @@ NodeDefs NewNodeDef (NodeId nid,Node node)
void InitChecker (void)
{
StartSymbol = NewSymbol (newsymbol);
StartSymbol -> symb_ident = NewIdent ("Start");
system_seq_id = NewIdent ("seq");
OpenDefinitionModules = NIL;
}
......
......@@ -28,7 +28,7 @@ char *ConvertSymbolKindToString (SymbKind skind)
case fun_type: return "=>";
case list_type: return "List";
case tuple_type: return "Tuple";
case dynamic_type: return DynamicId -> ident_name;
case dynamic_type: return "Dynamic";
default: return "Erroneous";
}
......@@ -142,11 +142,9 @@ static char *PrintName (char *name, char *name_end, unsigned line_nr, File file)
#define _ANALYSE_IDENT_ /* also in optimisations.c */
void PrintSymbolOfIdent (Ident sid, unsigned line_nr, File file)
void PrintSymbolOfIdent (char *name, unsigned line_nr, File file)
{
char *next_char,*name;
name = sid -> ident_name;
char *next_char;
#ifdef _ANALYSE_IDENT_
if (*name == cTypeDelimiter)
......
......@@ -13,7 +13,7 @@ extern void CheckWarningOrError (Bool error,char *msg1,char *msg2);
extern void CheckWarningOrError2 (Bool error,char *msg1,char *msg2,char *msg3);
extern void CheckSymbolWarningOrError (Bool error,struct symbol *symbol,char *msg);
#define NameOfSymbol(symb) ((symb)->symb_def ->sdef_ident->ident_name)
#define NameOfSymbol(symb) ((symb)->symb_def ->sdef_name)
extern void PrintSymbolOfIdent (Ident sid,unsigned line_nr,File file);
extern void PrintSymbolOfIdent (char *name,unsigned line_nr,File file);
......@@ -72,7 +72,7 @@ static Parameters CalculateOffsetsOfParameters (Parameters params,States results
if (params)
params = CalculateOffsetsOfParameter (params,resultstates[arity],asp_p,bsp_p);
else {
StaticMessage (True,CurrentAltLabel.lab_symbol->sdef_ident->ident_name,ECodeBlock);
StaticMessage (True,CurrentAltLabel.lab_symbol->sdef_name,ECodeBlock);
break;
}
}
......@@ -118,7 +118,7 @@ static void GenCodeBlock (CodeBlock code, int asp, int bsp, StateS resultstate)
}
if (nextparam)
StaticMessage (True,CurrentAltLabel.lab_symbol->sdef_ident->ident_name, ECodeBlock);
StaticMessage (True,CurrentAltLabel.lab_symbol->sdef_name, ECodeBlock);
GenParameters (True, code->co_parin, asp, bsp);
GenInstructions (code->co_instr);
......@@ -673,7 +673,7 @@ static void CodeRule (ImpRuleP rule)
GenFunctionDescriptorAndExportNodeAndDescriptor (rule_sdef);
if (DoTimeProfiling)
GenPB_ident (rule_sdef->sdef_ident,0 /*rule_sdef->sdef_line*/);
GenPB_ident (rule_sdef->sdef_name,0 /*rule_sdef->sdef_line*/);
if (rule_sdef->sdef_exported && rule_sdef->sdef_calledwithrootnode && ExpectsResultNode (resultstate))
MakeSymbolLabel (&ea_lab,CurrentModule,ea_pref,rule_sdef,0);
......@@ -795,7 +795,7 @@ static void CodeRule (ImpRuleP rule)
GenOStackLayoutOfStates (a_stack_size_of_strict_entry,init_b_stack_top,rule_sdef->sdef_arity,rule->rule_state_p);
GenLabelDefinition (&CurrentAltLabel);
MakeLabel (&caf_label,rule_sdef->sdef_ident->ident_name,0,caf_pref);
MakeLabel (&caf_label,rule_sdef->sdef_name,0,caf_pref);
MakeLabel (&local_label,m_symb,NewLabelNr++,no_pref);
DetermineSizeOfState (resultstate,&a_size,&b_size);
......@@ -850,7 +850,7 @@ static void CodeRule (ImpRuleP rule)
tail_call_modulo_cons=1;
if (ListOptimizations)
printf ("Optimize tail call modulo cons of %s\n",rule_sdef->sdef_ident->ident_name);
printf ("Optimize tail call modulo cons of %s\n",rule_sdef->sdef_name);
call_code_generator_again=1;
} else
tail_call_modulo_cons=0;
......
......@@ -259,14 +259,13 @@ void ConvertSymbolToRLabel (LabDef *slab,SymbDef sdef)
} else {
sdef->sdef_mark |= SDEF_USED_STRICTLY_MASK | SDEF_RECORD_R_LABEL_IMPORTED_MASK;
GenImpRecordDesc (modname,sdef->sdef_ident->ident_name);
GenImpRecordDesc (modname,sdef->sdef_name);
}
}
MakeSymbolLabel (slab,modname,r_pref,sdef,0);
}
static SymbDefS lazy_tuple_selector_sdef;
static IdentS lazy_tuple_selector_ident;
void BuildLazyTupleSelectorLabel (Label slab, int arity, int argnr)
{
......@@ -274,8 +273,7 @@ void BuildLazyTupleSelectorLabel (Label slab, int arity, int argnr)
LazyTupleSelectors [argnr - NrOfGlobalSelectors- 1] = True;
if (ExportLocalLabels){
lazy_tuple_selector_sdef.sdef_exported=True;
lazy_tuple_selector_sdef.sdef_ident=&lazy_tuple_selector_ident;
lazy_tuple_selector_ident.ident_name=loc_sel;
lazy_tuple_selector_sdef.sdef_name=loc_sel;
MakeSymbolLabel (slab,CurrentModule,n_pref,&lazy_tuple_selector_sdef,argnr);
} else {
LazyTupleSelectors [argnr - NrOfGlobalSelectors- 1] = True;
......@@ -831,7 +829,7 @@ static void GenerateLazyConstructorDescriptorAndFunctionForStrictConstructor (Co
GenConstructorFunctionDescriptorAndExportNodeAndDescriptor (constructor_def);
if (DoTimeProfiling)
GenPB (constructor_def->sdef_ident->ident_name);
GenPB (constructor_def->sdef_name);
MakeSymbolLabel (&ealab,constructor_def->sdef_exported ? CurrentModule : NULL,ea_pref,constructor_def,0);
......@@ -915,7 +913,7 @@ static void GenLazyRecordEntry (SymbDef rdef)
eu_label_p=NULL;
if (DoTimeProfiling)
GenPB (rdef->sdef_ident->ident_name);
GenPB (rdef->sdef_name);
GenLazyRecordDescriptorAndExport (rdef);
......@@ -992,11 +990,11 @@ static void GenLazyFieldSelectorEntry (SymbDef field_def,StateS recstate,int tot
#endif
if (DoTimeProfiling)
GenPB (field_def->sdef_ident->ident_name);
GenPB (field_def->sdef_name);
update_root_node = ! ExpectsResultNode (offfieldstate);
record_name=field_def->sdef_type->type_symbol->symb_def->sdef_ident->ident_name;
record_name=field_def->sdef_type->type_symbol->symb_def->sdef_name;
if (field_def->sdef_calledwithrootnode){
ealab = CurrentAltLabel;
......@@ -1183,7 +1181,7 @@ static int generate_instance_entry_arguments
member_state_p=dictionary_field->sdef_member_states_of_field;
if (DoDebug)
FPrintF (OutFile, "\n||\tmember type %s %d %d",dictionary_field->sdef_ident->ident_name,member_arity,function_arity);
FPrintF (OutFile, "\n||\tmember type %s %d %d",dictionary_field->sdef_name,member_arity,function_arity);
n_dictionary_args = function_arity-member_arity;
......@@ -1398,7 +1396,7 @@ static void GenUnboxedRecordConsApplyAndNodeEntries
GenArrayFunctionDescriptor (fun_def,&CurrentAltLabel,arity);
if (DoTimeProfiling)
GenPB (fun_def->sdef_ident->ident_name);
GenPB (fun_def->sdef_name);
if (fun_def->sdef_mark & SDEF_USED_CURRIED_MASK){
struct label i_label;
......@@ -1442,7 +1440,7 @@ static void GenUnboxedRecordDeconsApplyAndNodeEntries (SymbDef fun_def,int *a_si
GenArrayFunctionDescriptor (fun_def,&CurrentAltLabel,arity);
if (DoTimeProfiling)
GenPB (fun_def->sdef_ident->ident_name);
GenPB (fun_def->sdef_name);
if (fun_def->sdef_mark & SDEF_USED_CURRIED_MASK){
struct label i_label;
......@@ -1487,7 +1485,7 @@ static void GenUnboxedRecordApplyAndNodeEntries (SymbDef fun_def,int *a_size_p,i
GenArrayFunctionDescriptor (fun_def,&CurrentAltLabel,arity);
if (DoTimeProfiling)
GenPB (fun_def->sdef_ident->ident_name);
GenPB (fun_def->sdef_name);
if (fun_def->sdef_mark & SDEF_USED_CURRIED_MASK){
struct label i_label;
......@@ -1534,7 +1532,7 @@ void GenerateCodeForLazyUnboxedRecordListFunctions (void)
unboxed_record_cons_lab.lab_symbol=type_node_arguments_p->type_arg_node->type_node_symbol->symb_def;
unboxed_record_cons_lab.lab_issymbol=True;
} else {
unboxed_record_cons_lab.lab_name=type_node_arguments_p->type_arg_node->type_node_symbol->symb_def->sdef_ident->ident_name;
unboxed_record_cons_lab.lab_name=type_node_arguments_p->type_arg_node->type_node_symbol->symb_def->sdef_name;
unboxed_record_cons_lab.lab_issymbol=False;
}
unboxed_record_cons_lab.lab_pref=tail_strict ? "r_Cons#!" : "r_Cons#";
......@@ -2575,7 +2573,6 @@ SymbDef CreateUpdateFunction (ArgS *record_arg,ArgS *first_field_arg,Node node
{
static char update_function_name[16];
SymbDef update_function_sdef;
Ident update_function_ident;
Symbol update_function_symbol;
ArgS *previous_arg,*arg;
Node lhs_root,rhs_root;
......@@ -2599,8 +2596,7 @@ SymbDef CreateUpdateFunction (ArgS *record_arg,ArgS *first_field_arg,Node node
} else
strict_record_state_p = &record_state;
update_function_ident=NewIdent (update_function_name);
update_function_sdef=MakeNewSymbolDefinition (CurrentModule,update_function_ident,n_arguments,IMPRULE);
update_function_sdef=MakeNewSymbolDefinition (CurrentModule,update_function_name,n_arguments,IMPRULE);
update_function_sdef->sdef_number=next_def_number++;
update_function_sdef->sdef_isused=True;
......@@ -2757,7 +2753,6 @@ SymbDef create_select_function (Symbol selector_symbol,int selector_kind)
{
static char select_function_name[16];
SymbDef select_function_sdef;
Ident select_function_ident;
Symbol select_function_symbol;
NodeP lhs_root,rhs_root;
ImpRuleS *update_imp_rule;
......@@ -2773,8 +2768,7 @@ SymbDef create_select_function (Symbol selector_symbol,int selector_kind)
sprintf (select_function_name,"_sel%d",next_update_function_n);
++next_update_function_n;
select_function_ident=NewIdent (select_function_name);
select_function_sdef=MakeNewSymbolDefinition (CurrentModule,select_function_ident,1,IMPRULE);
select_function_sdef=MakeNewSymbolDefinition (CurrentModule,select_function_name,1,IMPRULE);
U5 (select_function_sdef, sdef_number=next_def_number++,
sdef_isused=True,
......@@ -2856,14 +2850,12 @@ SymbDef create_select_function (Symbol selector_symbol,int selector_kind)
static SymbDef create_match_function_sdef (void)
{
char match_function_name[16];
Ident match_function_ident;
SymbDef match_function_sdef;
sprintf (match_function_name,"_match%d",next_match_function_n);
++next_match_function_n;
match_function_ident=NewIdent (match_function_name);
match_function_sdef=MakeNewSymbolDefinition (CurrentModule,match_function_ident,1,IMPRULE);
match_function_sdef=MakeNewSymbolDefinition (CurrentModule,match_function_name,1,IMPRULE);
U5 (match_function_sdef, sdef_number=next_def_number++,
sdef_isused=True,
......@@ -4584,7 +4576,7 @@ static void repl_overloaded_cons_arguments (NodeP node_p,int *asp_p,int *bsp_p,S
field_sdef=node_p->node_decons_node->node_symbol->symb_def;
if (DoDebug)
FPrintF (OutFile, "\n||\t%s",field_sdef->sdef_ident->ident_name);
FPrintF (OutFile, "\n||\t%s",field_sdef->sdef_name);
if (OptimizeInstanceCalls){
struct state *member_states_of_field;
......
......@@ -333,7 +333,7 @@ Coercions CoerceSimpleStateArgument (StateS demstate,StateKind offkind,int ainde
break;
case CyclicSpine:
GenReduceError ();
StaticMessage (False,CurrentAltLabel.lab_symbol->sdef_ident->ident_name,Co_Wspine);
StaticMessage (False,CurrentAltLabel.lab_symbol->sdef_name,Co_Wspine);
*ontop = False;
break;
default:
......@@ -978,7 +978,7 @@ void BuildOrFillLazyFieldSelector (SymbDef selector_sdef,StateKind result_state_
ConvertSymbolToDandNLabel (&dsellab,&nsellab,selector_sdef);
record_sdef=selector_sdef->sdef_type->type_symbol->symb_def;
record_name=record_sdef->sdef_ident->ident_name;
record_name=record_sdef->sdef_name;
field_result_state_p=&record_sdef->sdef_record_state.state_record_arguments [selector_sdef->sdef_sel_field_number];
fill_arity= IsSimpleState (*field_result_state_p) ? (field_result_state_p->state_kind!=OnB ? -4 : -3) : 1;
......@@ -2081,7 +2081,7 @@ void cleanup_stack
while (p_node_ids!=NULL && p_node_ids->nidl_node_id->nid_a_index==UNUSED_NODE_ID_INDEX){
#if 0
printf ("cleanup_stack00 ");
printf ("%s ",CurrentAltLabel.lab_symbol->sdef_ident->ident_name);
printf ("%s ",CurrentAltLabel.lab_symbol->sdef_name);
DPrintNodeId (p_node_ids->nidl_node_id,StdOut);
printf ("\n");
#endif
......@@ -2097,7 +2097,7 @@ void cleanup_stack
do {
#if 0
printf ("cleanup_stack01 ");
printf ("%s ",CurrentAltLabel.lab_symbol->sdef_ident->ident_name);
printf ("%s ",CurrentAltLabel.lab_symbol->sdef_name);
DPrintNodeId (p_node_ids->nidl_node_id,StdOut);
printf ("\n");
#endif
......@@ -2109,7 +2109,7 @@ void cleanup_stack
while (p_node_ids!=NULL && p_node_ids->nidl_node_id->nid_a_index==UNUSED_NODE_ID_INDEX){
#if 0
printf ("cleanup_stack02 ");
printf ("%s ",CurrentAltLabel.lab_symbol->sdef_ident->ident_name);
printf ("%s ",CurrentAltLabel.lab_symbol->sdef_name);
DPrintNodeId (p_node_ids->nidl_node_id,StdOut);
printf ("\n");
#endif
......@@ -2190,7 +2190,7 @@ void cleanup_stack
while (p_node_ids!=NULL && p_node_ids->nidl_node_id->nid_a_index==UNUSED_NODE_ID_INDEX){
#if 0
printf ("cleanup_stack03 ");
printf ("%s ",CurrentAltLabel.lab_symbol->sdef_ident->ident_name);
printf ("%s ",CurrentAltLabel.lab_symbol->sdef_name);
DPrintNodeId (p_node_ids->nidl_node_id,StdOut);
printf ("\n");
#endif
......@@ -2199,7 +2199,7 @@ void cleanup_stack
#if 0
printf ("cleanup_stack1 ");
printf ("%s\n",CurrentAltLabel.lab_symbol->sdef_ident->ident_name);
printf ("%s\n",CurrentAltLabel.lab_symbol->sdef_name);
if (p_node_ids!=NULL && p_node_ids->nidl_node_id->nid_a_index!=asp){
printf ("asp=%d nid_a_index=%d ",asp,p_node_ids->nidl_node_id->nid_a_index);
......@@ -2235,7 +2235,7 @@ void cleanup_stack
while (p_node_ids!=NULL && p_node_ids->nidl_node_id->nid_a_index==UNUSED_NODE_ID_INDEX){
#if 0
printf ("cleanup_stack11 ");
printf ("%s ",CurrentAltLabel.lab_symbol->sdef_ident->ident_name);
printf ("%s ",CurrentAltLabel.lab_symbol->sdef_name);
DPrintNodeId (p_node_ids->nidl_node_id,StdOut);
printf ("\n");
#endif
......@@ -2892,13 +2892,13 @@ static void generate_code_for_apply_in_strict_context (NodeP node,int *asp_p,int
member_type_alt=field_sdef->sdef_member_type_of_field;
if (DoDebug)
if (member_type_alt->type_alt_lhs->type_node_arity==n_apply_args+1){
FPrintF (OutFile, "\n||\t%s",selector_node_p->node_symbol->symb_def->sdef_ident->ident_name);
FPrintF (OutFile, "\n||\t%s",selector_node_p->node_symbol->symb_def->sdef_name);
} else
FPrintF (OutFile, "\n||\t(no dictionary) %s",field_sdef->sdef_ident->ident_name);
FPrintF (OutFile, "\n||\t(no dictionary) %s",field_sdef->sdef_name);
} else if (DoDebug)
FPrintF (OutFile, "\n||\t(no dictionary) %s",field_sdef->sdef_ident->ident_name);
FPrintF (OutFile, "\n||\t(no dictionary) %s",field_sdef->sdef_name);
} else if (DoDebug)
FPrintF (OutFile, "\n||\t(no dictionary) %s",field_sdef->sdef_ident->ident_name);
FPrintF (OutFile, "\n||\t(no dictionary) %s",field_sdef->sdef_name);
if (field_sdef!=NULL && OptimizeInstanceCalls){
struct state *member_states_of_field;
......@@ -3282,7 +3282,7 @@ LabDef *unboxed_cons_label (SymbolP cons_symbol_p)
unboxed_record_cons_lab.lab_symbol=cons_symbol_p->symb_unboxed_cons_state_p->state_record_symbol;
unboxed_record_cons_lab.lab_issymbol=True;
} else {
unboxed_record_cons_lab.lab_name=cons_symbol_p->symb_unboxed_cons_state_p->state_record_symbol->sdef_ident->ident_name;
unboxed_record_cons_lab.lab_name=cons_symbol_p->symb_unboxed_cons_state_p->state_record_symbol->sdef_name;
unboxed_record_cons_lab.lab_issymbol=False;
}
unboxed_record_cons_lab.lab_pref=cons_symbol_p->symb_tail_strictness ? "r_Cons#!" : "r_Cons#";
......@@ -3663,7 +3663,7 @@ static void FillNormalNode (Node node,int *asp_p,int *bsp_p,NodeId update_node_i
}
}
} else {
StaticMessage (False,CurrentAltLabel.lab_symbol->sdef_ident->ident_name,Co_Wtype);
StaticMessage (False,CurrentAltLabel.lab_symbol->sdef_name,Co_Wtype);
GenTypeError();
}
}
......@@ -6764,13 +6764,13 @@ void InitCoding (void)
SetUnaryState (& UnderEvalState, UnderEval, UnknownObj);
SetUnaryState (& ProcIdState, OnB, ProcIdObj);
ApplyDef=MakeNewSymbolDefinition ("system", ApplyId, 2, DEFRULE);
ApplyDef=MakeNewSymbolDefinition ("system", "AP", 2, DEFRULE);
ApplyDef->sdef_number=0;
IfDef=MakeNewSymbolDefinition ("system", IfId, 3, DEFRULE);
IfDef=MakeNewSymbolDefinition ("system", "if", 3, DEFRULE);
IfDef->sdef_number=0;
SeqDef=MakeNewSymbolDefinition ("system", system_seq_id, 2, DEFRULE);
SeqDef=MakeNewSymbolDefinition ("system", "seq", 2, DEFRULE);
SeqDef->sdef_number=0;
InitBasicDescriptor (UnknownObj, "_", SizeOfAStackElem);
......
......@@ -214,7 +214,7 @@ void RedirectResultAndReturn (int asp,int bsp,int source_a_index,int source_b_in
break;
case CyclicSpine:
GenReduceError ();
StaticMessage (False,CurrentAltLabel.lab_symbol->sdef_ident->ident_name,Co_Wspine);
StaticMessage (False,CurrentAltLabel.lab_symbol->sdef_name,Co_Wspine);
break;
default:
error_in_function ("RedirectResultAndReturn");
......@@ -666,13 +666,13 @@ static void CodeRootApply (Node root,NodeId rootid,int asp,int bsp,CodeGenNodeId
member_type_alt=field_sdef->sdef_member_type_of_field;
if (DoDebug)
if (member_type_alt->type_alt_lhs->type_node_arity==n_apply_args+1){
FPrintF (OutFile, "\n||\t%d %s",root->node_symbol->symb_instance_apply,selector_node_p->node_symbol->symb_def->sdef_ident->ident_name);
FPrintF (OutFile, "\n||\t%d %s",root->node_symbol->symb_instance_apply,selector_node_p->node_symbol->symb_def->sdef_name);
} else
FPrintF (OutFile, "\n||\t(no dictionary) %s",field_sdef->sdef_ident->ident_name);
FPrintF (OutFile, "\n||\t(no dictionary) %s",field_sdef->sdef_name);
} else if (DoDebug)
FPrintF (OutFile, "\n||\t(no dictionary) %s",field_sdef->sdef_ident->ident_name);
FPrintF (OutFile, "\n||\t(no dictionary) %s",field_sdef->sdef_name);
} else if (DoDebug)
FPrintF (OutFile, "\n||\t(no dictionary) %s",field_sdef->sdef_ident->ident_name);
FPrintF (OutFile, "\n||\t(no dictionary) %s",field_sdef->sdef_name);
if (field_sdef!=NULL && OptimizeInstanceCalls){
struct state *member_states_of_field;
......@@ -1019,7 +1019,6 @@ static void CodeNormalRootNode (Node root,NodeId rootid,int asp,int bsp,CodeGenN
CodeRootSelection (root, rootid, asp, bsp,code_gen_node_ids_p,resultstate);
return;
case fail_symb:
#ifdef CLEAN2
{
IdentS case_ident_s;
SymbDefS case_def_s;
......@@ -1027,7 +1026,7 @@ static void CodeNormalRootNode (Node root,NodeId rootid,int asp,int bsp,CodeGenN
case_ident_s.ident_name=rootsymb->symb_string;
Assume (case_ident_s.ident_name != NULL, "codegen3", "CodeNormalRootNode (fail_symb)");
case_def_s.sdef_ident = &case_ident_s;
case_def_s.sdef_name = case_ident_s.ident_name;
if (FunctionMayFailWarningOrError!=0)
StaticMessage (FunctionMayFailWarningOrError==2, "%D", "case may fail", &case_def_s);
......@@ -1041,11 +1040,6 @@ static void CodeNormalRootNode (Node root,NodeId rootid,int asp,int bsp,CodeGenN
return;
}
#else /* ifndef CLEAN2 */
error_in_function ("CodeNormalRootNode");
/* JumpToNextAlternative (asp, bsp); */
return;
#endif
case string_denot:
GenPopA (asp);
GenPopB (bsp);
......@@ -1118,7 +1112,7 @@ static void CodeNormalRootNode (Node root,NodeId rootid,int asp,int bsp,CodeGenN
GenRtn (1, 0, OnAState);
}
} else {
StaticMessage (False,CurrentAltLabel.lab_symbol->sdef_ident->ident_name,Co_Wtype);
StaticMessage (False,CurrentAltLabel.lab_symbol->sdef_name,Co_Wtype);
GenTypeError();
GenRtn (0, 0, OnAState);
}
......@@ -2308,7 +2302,7 @@ int CodeRhsNodeDefs
NodeP node,tuple_node;
ArgP function_result_tuple_elements_a[MaxNodeArity],*function_result_tuple_elements,*function_result_tuple_elements_p;
printf ("Tuple tail call modulo cons %s\n",tuple_call_node_id_p->nid_node->node_symbol->symb_def->sdef_ident->ident_name);
printf ("Tuple tail call modulo cons %s\n",tuple_call_node_id_p->nid_node->node_symbol->symb_def->sdef_name);
function_result_tuple_elements_p=&function_result_tuple_elements_a[0];
for_l (function_result_tuple_element_p,last_node_def_p->def_node->node_arguments,arg_next)
......
......@@ -233,9 +233,9 @@ void PrintSymbol (Symbol symbol, File file)
line_nr = 0;
break;
case definition:
symb_id = symbol -> symb_def -> sdef_ident;
line_nr = 0;
break;
PrintSymbolOfIdent (symbol->symb_def->sdef_name, line_nr, file);
return;
case int_denot:
FPutS (symbol->symb_int, file);
return;
......@@ -277,7 +277,7 @@ void PrintSymbol (Symbol symbol, File file)
return;
}
PrintSymbolOfIdent (symb_id, line_nr, file);
PrintSymbolOfIdent (symb_id->ident_name, line_nr, file);
} /* PrintSymbol */
......@@ -378,7 +378,7 @@ void StaticMessage (Bool error, char *symbol_format, char *message_format, ...)
case 'D':
{
SymbDef def = va_arg (ap, SymbDef);
PrintSymbolOfIdent (def->sdef_ident, 0, StdError);
PrintSymbolOfIdent (def->sdef_name, 0, StdError);
break;
}
case 'S':
......
......@@ -241,7 +241,7 @@ void GenFillCaf (Label label,int a_stack_size,int b_stack_size);
void GenCaf (Label label,int a_stack_size,int b_stack_size);
void GenPB (char *function_name);
void GenPB_ident (IdentP ident,unsigned int line_n);
void GenPB_ident (char *ident_name,unsigned int line_n);
void GenPB_with_line_number (char *function_name,int line_number);
void GenPD (void);
void GenPN (void);
......
......@@ -1006,10 +1006,8 @@ static Symbol new_rule_symbol (char *function_name)
{
SymbDef function_sdef;
Symbol function_symbol;
Ident function_ident;
function_ident=NewIdent (function_name);
function_sdef=MakeNewSymbolDefinition (CurrentModule,function_ident,0,IMPRULE);
function_sdef=MakeNewSymbolDefinition (CurrentModule,function_name,0,IMPRULE);
function_sdef->sdef_ancestor = ~next_def_number;
function_sdef->sdef_number=next_def_number++;
......@@ -1214,7 +1212,7 @@ static char *create_arguments_for_local_function (NodeP node_p,ArgS ***arg_h,Arg
int length_before_type_delimiter;
char *f_name;
f_name=node_p->node_symbol->symb_def->sdef_ident->ident_name;
f_name=node_p->node_symbol->symb_def->sdef_name;
length_before_type_delimiter=compute_length_before_type_delimiter (f_name);
if (function_name_p+2+length_before_type_delimiter < end_function_name){
......@@ -1681,7 +1679,7 @@ static struct node *create_new_local_function (Node node,StateP function_state_p
end_function_name=function_name+sizeof (function_name);
function_name_p=&function_name[strlen (function_name)];
f_name=CurrentSymbol->symb_def->sdef_ident->ident_name;
f_name=CurrentSymbol->symb_def->sdef_name;
length_before_type_delimiter=compute_length_before_type_delimiter (f_name);
if (function_name_p+2+length_before_type_delimiter < end_function_name){
......
......@@ -2357,8 +2357,8 @@ static Exp ConvertNode (Node node, NodeId nid)
Exp exp;
#if SA_RECOGNIZES_ABORT_AND_UNDEF
if (sdef->sdef_module==StdMiscId->ident_name){
if ((sdef->sdef_ident==abort_id && node->node_arity==1) || sdef->sdef_ident==undef_id){
if (sdef->sdef_module==StdMiscId){
if ((sdef==abort_symb_def && node->node_arity==1) || sdef==undef_symb_def){
e->e_kind = Bottom;
e->e_sym = 0;
e->e_hnf = True;
......@@ -2894,7 +2894,7 @@ static void ConvertStateToStrictInfo (TypeNode node, StrictInfo *s, Bool adopt_a
printf ("ConvertStateToStrictInfo Var\n");
else {
if (node->type_node_symbol->symb_kind==definition)
printf ("ConvertStateToStrictInfo Definition %s\n",node->type_node_symbol->symb_def->sdef_ident->ident_name);
printf ("ConvertStateToStrictInfo Definition %s\n",node->type_node_symbol->symb_def->sdef_name);
else
printf ("ConvertStateToStrictInfo NoTuple %d\n",node->type_node_symbol->symb_kind);
}
......@@ -3589,7 +3589,7 @@ static void convert_imp_rule_type (SymbDef sdef)
rule_type = sdef->sdef_rule->rule_type;
/*
#ifdef _DB_
printf ("ConvertStateInfoToStrictInfos %s\n",sdef->sdef_ident->ident_name);
printf ("ConvertStateInfoToStrictInfos %s\n",sdef->sdef_name);
#endif
*/
ConvertStateInfoToStrictInfos (rule_type,arity, &f->fun_strictargs, &f->fun_strictresult, !StrictChecks);
......@@ -3716,7 +3716,7 @@ static void update_function_strictness (SymbDef sdef)
rule = sdef->sdef_rule->rule_type;
#if 0
printf ("%s\n",sdef->sdef_ident->ident_name);
printf ("%s\n",sdef->sdef_name);
#endif
strict_added = False;
......@@ -3734,10 +3734,10 @@ static void update_function_strictness (SymbDef sdef)
}
if (warning && (StrictAllWarning || StrictChecks))
GiveStrictWarning (sdef->sdef_ident->ident_name, "not all user annotations could be derived");
GiveStrictWarning (sdef->sdef_name, "not all user annotations could be derived");
if (export_warning && (StrictAllWarning || StrictExportChecks))
GiveStrictWarning (sdef->sdef_ident->ident_name, "function not annotated as being strict in definition module");
GiveStrictWarning (sdef->sdef_name, "function not annotated as being strict in definition module");
}
}