Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
clean-compiler-and-rts
compiler
Commits
4ea9b082
Commit
4ea9b082
authored
Jul 20, 2015
by
John van Groningen
Browse files
fix names and export labels of tuple selectors > 6 if exporting local labels
parent
ff78e5e4
Changes
2
Hide whitespace changes
Inline
Side-by-side
backendC/CleanCompilerSources/codegen1.c
View file @
4ea9b082
...
...
@@ -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
);
}
...
...
backendC/CleanCompilerSources/instructions.c
View file @
4ea9b082
...
...
@@ -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
)
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment