aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjohnvg2015-07-20 12:40:31 +0000
committerjohnvg2015-07-20 12:40:31 +0000
commit62dc482edf2885b9f47e21b10a7699d7bbe30418 (patch)
tree7f8088db12bf4fea155d14ba7f239eab1bc941ee
parentfix name in descriptor for unboxed lists of records if exporting local labels (diff)
fix names and export labels of tuple selectors > 6 if exporting local labels
git-svn-id: https://svn.cs.ru.nl/repos/clean-compiler/trunk@2577 1f8540f1-abd5-4d5b-9d24-4c5ce8603e2d
-rw-r--r--backendC/CleanCompilerSources/codegen1.c15
-rw-r--r--backendC/CleanCompilerSources/instructions.c18
2 files changed, 31 insertions, 2 deletions
diff --git a/backendC/CleanCompilerSources/codegen1.c b/backendC/CleanCompilerSources/codegen1.c
index d8e96d9..af13c63 100644
--- a/backendC/CleanCompilerSources/codegen1.c
+++ b/backendC/CleanCompilerSources/codegen1.c
@@ -267,12 +267,23 @@ void ConvertSymbolToRLabel (LabDef *slab,SymbDef sdef)
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)
{
if (argnr > NrOfGlobalSelectors){
LazyTupleSelectors [argnr - NrOfGlobalSelectors- 1] = True;
- MakeLabel (slab,loc_sel,argnr,n_pref);
- } else
+ 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;
+ MakeSymbolLabel (slab,CurrentModule,n_pref,&lazy_tuple_selector_sdef,argnr);
+ } else {
+ LazyTupleSelectors [argnr - NrOfGlobalSelectors- 1] = True;
+ MakeLabel (slab,loc_sel,argnr,n_pref);
+ }
+ } else
MakeLabel (slab,glob_sel,argnr,n_pref);
}
diff --git a/backendC/CleanCompilerSources/instructions.c b/backendC/CleanCompilerSources/instructions.c
index 16ed2c6..fbf9e4b 100644
--- a/backendC/CleanCompilerSources/instructions.c
+++ b/backendC/CleanCompilerSources/instructions.c
@@ -3595,12 +3595,30 @@ void GenStart (SymbDef startsymb)
#ifdef NEW_SELECTOR_DESCRIPTORS
void GenSelectorDescriptor (Label sellab,int element_n)
{
+ if (sellab->lab_issymbol){
+ char *name;
+
+ name=sellab->lab_symbol->sdef_ident->ident_name;
+
+ put_directive_ (Dexport);
+ FPrintF (OutFile, "e_%s_" D_PREFIX "%s.%d",sellab->lab_mod, name, sellab->lab_post);
+ put_directive_ (Dexport);
+ FPrintF (OutFile, "e_%s_%s%s.%d",sellab->lab_mod, sellab->lab_pref, name, sellab->lab_post);
+
put_directive_ (Ddescs);
+ FPrintF (OutFile, "e_%s_" D_PREFIX "%s.%d e_%s_%s%s.%d _ %d 0 \"%s.%d\"",
+ sellab->lab_mod, name, sellab->lab_post,
+ sellab->lab_mod, sellab->lab_pref, name, sellab->lab_post,
+ element_n+1,
+ name, sellab->lab_post);
+ } else {
+ put_directive_ (Ddescs);
FPrintF (OutFile, D_PREFIX "%s.%d %s%s.%d _ %d 0 \"%s.%d\"",
sellab->lab_name, sellab->lab_post,
sellab->lab_pref, sellab->lab_name, sellab->lab_post,
element_n+1,
sellab->lab_name, sellab->lab_post);
+ }
}
#else
void GenSelectorDescriptor (Label sellab,char *g_pref)