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
91047278
Commit
91047278
authored
Sep 03, 2007
by
John van Groningen
Browse files
add ( , and ) in type string of .record to print unboxed tuples in constructors and records
parent
5cd0c5da
Changes
1
Show whitespace changes
Inline
Side-by-side
backendC/CleanCompilerSources/instructions.c
View file @
91047278
...
...
@@ -1093,10 +1093,23 @@ static void GenABStackElems (StateS state)
switch
(
state
.
state_type
){
case
TupleState
:
argstates
=
state
.
state_tuple_arguments
;
FPutC
(
'('
,
OutFile
);
if
(
state
.
state_arity
>
0
){
GenABStackElems
(
argstates
[
0
]);
for
(
arity
=
1
;
arity
<
state
.
state_arity
;
arity
++
){
FPutC
(
','
,
OutFile
);
GenABStackElems
(
argstates
[
arity
]);
}
}
FPutC
(
')'
,
OutFile
);
break
;
case
RecordState
:
argstates
=
state
.
state_record_arguments
;
break
;
FPutC
(
'('
,
OutFile
);
for
(
arity
=
0
;
arity
<
state
.
state_arity
;
arity
++
)
GenABStackElems
(
argstates
[
arity
]);
FPutC
(
')'
,
OutFile
);
return
;
case
ArrayState
:
FPutC
(
'a'
,
OutFile
);
return
;
...
...
@@ -1104,11 +1117,22 @@ static void GenABStackElems (StateS state)
error_in_function
(
"GenABStackElems"
);
return
;
}
for
(
arity
=
0
;
arity
<
state
.
state_arity
;
arity
++
)
GenABStackElems
(
argstates
[
arity
]);
}
}
static
void
GenABStackElemsOfRecord
(
StateS
state
)
{
if
(
state
.
state_type
==
RecordState
){
int
arity
;
States
argstates
;
argstates
=
state
.
state_record_arguments
;
for
(
arity
=
0
;
arity
<
state
.
state_arity
;
++
arity
)
GenABStackElems
(
argstates
[
arity
]);
}
else
GenABStackElems
(
state
);
}
void
GenDStackLayout
(
int
asize
,
int
bsize
,
Args
fun_args
)
{
if
(
DoStackLayout
){
...
...
@@ -2830,7 +2854,7 @@ void GenRecordDescriptor (SymbDef sdef)
recstate
=
sdef
->
sdef_record_state
;
GenABStackElems
(
recstate
);
GenABStackElems
OfRecord
(
recstate
);
DetermineSizeOfState
(
recstate
,
&
asize
,
&
bsize
);
...
...
@@ -2868,7 +2892,8 @@ void GenUnboxedConsRecordDescriptor (SymbDef sdef,int tail_strict)
FPutC
(
'l'
,
OutFile
);
FPutC
(
'R'
,
OutFile
);
GenABStackElems
(
tuple_state
);
GenABStackElemsOfRecord
(
tuple_arguments_state
[
0
]);
GenABStackElems
(
tuple_arguments_state
[
1
]);
DetermineSizeOfState
(
tuple_state
,
&
asize
,
&
bsize
);
...
...
Write
Preview
Markdown
is supported
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