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
4b66ba24
Commit
4b66ba24
authored
Dec 19, 2008
by
John van Groningen
Browse files
add AddStrictnessToExportedFunctionTypes
parent
cc9102ab
Changes
3
Hide whitespace changes
Inline
Side-by-side
backendC/CleanCompilerSources/sa.c
View file @
4b66ba24
...
...
@@ -3105,6 +3105,43 @@ static void UpdateStateInfosWithStrictInfos (TypeAlts rule, unsigned arity, Stri
/* the result has no sense at the moment */
}
static
void
update_exported_function_state_info_with_strict_info
(
TypeNode
node
,
StrictInfo
*
s
)
{
Bool
is_strict_annotated
,
is_strict
,
is_tuple
;
is_strict_annotated
=
node
->
type_node_annotation
==
StrictAnnot
;
is_tuple
=
IsTupleInfo
(
s
);
is_strict
=
(
is_tuple
?
GetTupleStrictKind
(
s
)
:
GetStrictKind
(
s
,
0
))
!=
NotStrict
;
if
(
!
is_strict_annotated
&&
is_strict
)
node
->
type_node_annotation
=
StrictAnnot
;
if
(
is_tuple
&&
(
is_strict
||
is_strict_annotated
)){
unsigned
arity
,
i
;
TypeArgs
args
;
arity
=
s
->
strict_arity
;
args
=
node
->
type_node_arguments
;
for
(
i
=
0
;
i
<
arity
;
i
++
,
args
=
args
->
type_arg_next
)
update_exported_function_state_info_with_strict_info
(
args
->
type_arg_node
,
&
GetTupleInfo
(
s
,
i
));
}
}
static
void
update_exported_function_type_state_infos_with_strict_infos
(
TypeAlts
rule
,
unsigned
arity
,
StrictInfo
*
strict_args
)
{
unsigned
i
;
TypeArgs
args
;
if
(
!
rule
)
return
;
args
=
rule
->
type_alt_lhs
->
type_node_arguments
;
for
(
i
=
0
;
i
<
arity
;
i
++
,
args
=
args
->
type_arg_next
)
update_exported_function_state_info_with_strict_info
(
args
->
type_arg_node
,
&
strict_args
[
i
]);
}
Bool
IsListArg
(
Fun
*
f
,
unsigned
n
)
{
TypeArgs
args
;
...
...
@@ -3574,12 +3611,17 @@ static void update_function_strictness (SymbDef sdef)
strict_added
=
False
;
warning
=
False
;
UpdateStateInfosWithStrictInfos
(
rule
,
arity
,
f
->
fun_strictargs
,
&
f
->
fun_strictresult
,
&
strict_added
,
&
warning
);
if
(
strict_added
&&
sdef
->
sdef_exported
){
if
(
DoListStrictTypes
&&
!
DoListAllTypes
)
PrintType
(
sdef
,
rule
);
else
export_warning
=
True
;
if
(
sdef
->
sdef_exported
){
if
(
strict_added
){
if
(
DoListStrictTypes
&&
!
DoListAllTypes
)
PrintType
(
sdef
,
rule
);
else
export_warning
=
True
;
}
if
(
AddStrictnessToExportedFunctionTypes
&&
sdef
->
sdef_dcl_icl
!=
NULL
)
update_exported_function_type_state_infos_with_strict_infos
(
sdef
->
sdef_dcl_icl
->
sdef_rule_type
->
rule_type_rule
,
arity
,
f
->
fun_strictargs
);
}
if
(
warning
&&
(
StrictAllWarning
||
StrictChecks
))
...
...
backendC/CleanCompilerSources/settings.c
View file @
4b66ba24
...
...
@@ -23,6 +23,7 @@ Bool ListOptimizations = False;
Bool
DoDescriptors
=
False
;
Bool
ExportLocalLabels
=
False
;
Bool
AddStrictnessToExportedFunctionTypes
=
False
;
Bool
DoProfiling
=
False
;
/* no longer used by memory profiler */
Bool
DoTimeProfiling
=
False
;
...
...
backendC/CleanCompilerSources/settings.h
View file @
4b66ba24
...
...
@@ -22,6 +22,7 @@ extern Bool DoDescriptors; /* not generated in abc file */
extern
Bool
ListOptimizations
;
extern
Bool
ExportLocalLabels
;
extern
Bool
AddStrictnessToExportedFunctionTypes
;
extern
Bool
DoProfiling
;
extern
Bool
DoTimeProfiling
;
...
...
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