Skip to content
GitLab
Menu
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
a5857d4f
Commit
a5857d4f
authored
Jan 07, 2003
by
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
Changes
2
Hide whitespace changes
Inline
Side-by-side
backendC/CleanCompilerSources/codegen1.c
View file @
a5857d4f
...
...
@@ -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
;
...
...
backendC/CleanCompilerSources/instructions.c
View file @
a5857d4f
...
...
@@ -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
);
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a 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