diff options
Diffstat (limited to 'backendC/CleanCompilerSources')
-rw-r--r-- | backendC/CleanCompilerSources/codegen1.c | 10 | ||||
-rw-r--r-- | backendC/CleanCompilerSources/instructions.c | 20 |
2 files changed, 18 insertions, 12 deletions
diff --git a/backendC/CleanCompilerSources/codegen1.c b/backendC/CleanCompilerSources/codegen1.c index 957dc78..d7bd361 100644 --- a/backendC/CleanCompilerSources/codegen1.c +++ b/backendC/CleanCompilerSources/codegen1.c @@ -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; diff --git a/backendC/CleanCompilerSources/instructions.c b/backendC/CleanCompilerSources/instructions.c index 5857168..ed7ed5f 100644 --- a/backendC/CleanCompilerSources/instructions.c +++ b/backendC/CleanCompilerSources/instructions.c @@ -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); |