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

export labels if ExportLocalLabels==True for lazy record selectors

and fix exported label name for unboxed lists of records
parent 5abfe497
......@@ -962,7 +962,7 @@ static void GenLazyFieldSelectorEntry (SymbDef field_def,StateS recstate,int tot
ConvertSymbolToLabel (&CurrentAltLabel,field_def);
if (field_def->sdef_exported)
if (field_def->sdef_exported || ExportLocalLabels)
GenExportFieldSelector (field_def);
GenFieldSelectorDescriptor (field_def,IsSimpleState (offfieldstate));
......@@ -993,6 +993,12 @@ static void GenLazyFieldSelectorEntry (SymbDef field_def,StateS recstate,int tot
node_directive_arity = IsSimpleState (offfieldstate) ? (offfieldstate.state_kind!=OnB ? -4 : -3) : field_def->sdef_arity;
ConvertSymbolToDandNLabel (&d_lab,&n_lab,field_def);
if (ExportLocalLabels){
d_lab.lab_mod=CurrentModule;
n_lab.lab_mod=CurrentModule;
ealab.lab_mod=CurrentModule;
}
GenFieldNodeEntryDirective (node_directive_arity,&d_lab,ea_label_p,record_name);
......@@ -1179,7 +1185,7 @@ void GenerateCodeForLazyUnboxedRecordListFunctions (void)
type_node_arguments_p=fun_def->sdef_rule_type->rule_type_rule->type_alt_lhs->type_node_arguments;
tail_strict=type_node_arguments_p->type_arg_next->type_arg_node->type_node_symbol->symb_tail_strictness;
unboxed_record_cons_lab.lab_mod=NULL;
unboxed_record_cons_lab.lab_mod=ExportLocalLabels ? CurrentModule : NULL;
unboxed_record_cons_lab.lab_pref=tail_strict ? "r_Cons#!" : "r_Cons#";
unboxed_record_cons_lab.lab_issymbol=False;
unboxed_record_cons_lab.lab_name=type_node_arguments_p->type_arg_node->type_node_symbol->symb_def->sdef_ident->ident_name;
......
......@@ -3182,22 +3182,22 @@ void GenFieldSelectorDescriptor (SymbDef sdef,int has_gc_apply_entry)
CurrentModule,record_name,name,
arity,record_name,name);
} else if ((sdef->sdef_mark & SDEF_USED_LAZILY_MASK) || has_gc_apply_entry){
char *record_name;
record_name = sdef->sdef_type->type_lhs->ft_symbol->symb_def->sdef_ident->ident_name;
if (DoDebug)
if (ExportLocalLabels)
FPrintF (OutFile, "e_%s_" D_PREFIX "%s.%s ",CurrentModule,record_name,name);
else if (DoDebug)
FPrintF (OutFile, D_PREFIX "%s.%s ",record_name,name);
else
FPrintF (OutFile, LOCAL_D_PREFIX "%u ", sdef->sdef_number);
if (sdef->sdef_mark & SDEF_USED_LAZILY_MASK){
if (DoDebug)
if (ExportLocalLabels)
FPrintF (OutFile, "e_%s_" N_PREFIX "%s.%s ",CurrentModule,record_name,name);
else if (DoDebug)
FPrintF (OutFile, N_PREFIX "%s.%s ",record_name,name);
else
FPrintF (OutFile, N_PREFIX "%u ",sdef->sdef_number);
} else
FPrintF (OutFile, "%s ", hnf_lab.lab_name);
FPrintF (OutFile, "%s ",hnf_lab.lab_name);
if (has_gc_apply_entry){
if (DoDebug)
......@@ -3205,9 +3205,9 @@ void GenFieldSelectorDescriptor (SymbDef sdef,int has_gc_apply_entry)
else
FPrintF (OutFile, "%s%u ",l_pref,sdef->sdef_number);
} else
FPrintF (OutFile, "%s ", hnf_lab.lab_name);
FPrintF (OutFile, "%s ",hnf_lab.lab_name);
FPrintF (OutFile, "%d 0 \"%s.%s\"", arity,record_name,name);
FPrintF (OutFile, "%d 0 \"%s.%s\"",arity,record_name,name);
} else if (DoDebug){
FPrintF (OutFile, D_PREFIX "%s %s %s %d 0 \"%s.%s\"", name, hnf_lab.lab_name,
hnf_lab.lab_name,arity,record_name,name);
......
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