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
7861d005
Commit
7861d005
authored
Sep 12, 2001
by
John van Groningen
Browse files
clean 1.3 code for recognizing abort and undef in the strictness analyzer
doesn't work yet in Clean 2.0
parent
3e991f1a
Changes
4
Hide whitespace changes
Inline
Side-by-side
backendC/CleanCompilerSources/checker.h
View file @
7861d005
...
...
@@ -13,6 +13,9 @@ extern Ident StrictListId,UnboxedListId,TailStrictListId,StrictTailStrictListId,
#ifdef CLEAN2
extern
Ident
DynamicId
;
#endif
#if SA_RECOGNIZES_ABORT_AND_UNDEF
extern
Ident
StdMiscId
,
abort_id
,
undef_id
;
#endif
extern
Symbol
StartSymbol
,
UnboxedArrayClassSymbols
[],
UnboxedArrayFunctionSymbols
[];
extern
SymbDef
scc_dependency_list
,
ArrayFunctionDefs
[],
StdArrayAbortDef
;
...
...
backendC/CleanCompilerSources/checker_2.c
View file @
7861d005
...
...
@@ -110,6 +110,10 @@ Ident AnnotatedId, ListId, TupleId, ConsId, NilId, ApplyId, SelectId,
DeltaBId
,
IfId
,
FailId
,
AndId
,
OrId
,
StdArrayId
,
ArrayFunctionIds
[
NoArrayFun
];
#if SA_RECOGNIZES_ABORT_AND_UNDEF
Ident
StdMiscId
,
abort_id
,
undef_id
;
#endif
Symbol
StartSymbol
;
SymbDef
ArrayFunctionDefs
[
NoArrayFun
],
StdArrayAbortDef
;
...
...
@@ -193,10 +197,19 @@ void InitChecker (void)
AndId
=
PutStringInHashTable
(
"&&"
,
SymbolIdTable
);
OrId
=
PutStringInHashTable
(
"||"
,
SymbolIdTable
);
#if SA_RECOGNIZES_ABORT_AND_UNDEF
abort_id
=
PutStringInHashTable
(
"abort"
,
SymbolIdTable
);
undef_id
=
PutStringInHashTable
(
"undef"
,
SymbolIdTable
);
#endif
SystemFunctionsId
=
PutStringInHashTable
(
"StdEnum"
,
ModuleIdTable
);
DeltaBId
=
PutStringInHashTable
(
"StdBool"
,
ModuleIdTable
);
StdArrayId
=
PutStringInHashTable
(
"_SystemArray"
,
ModuleIdTable
);
#if SA_RECOGNIZES_ABORT_AND_UNDEF
StdMiscId
=
PutStringInHashTable
(
"StdMisc"
,
ModuleIdTable
);
#endif
/* Predefined Array functions */
StdArrayAbortId
=
PutStringInHashTable
(
"_abortArray"
,
SymbolIdTable
);
...
...
backendC/CleanCompilerSources/compiledefines.h
View file @
7861d005
...
...
@@ -18,6 +18,8 @@
#define WRITE_DCL_MODIFICATION_TIME 1
#define SA_RECOGNIZES_ABORT_AND_UNDEF 0
#define STRICT_LISTS 1
#undef KARBON
\ No newline at end of file
backendC/CleanCompilerSources/sa.c
View file @
7861d005
...
...
@@ -2240,7 +2240,20 @@ static Exp ConvertNode (Node node, NodeId nid)
TypeArgs
typeargs
;
unsigned
int
i
;
Exp
exp
;
#if SA_RECOGNIZES_ABORT_AND_UNDEF
if
(
sdef
->
sdef_module
==
StdMiscId
->
ident_name
){
if
((
sdef
->
sdef_ident
==
abort_id
&&
node
->
node_arity
==
1
)
||
sdef
->
sdef_ident
==
undef_id
){
e
->
e_kind
=
Bottom
;
e
->
e_sym
=
0
;
e
->
e_hnf
=
True
;
e
->
e_spechnf
=
True
;
return
e
;
}
}
#endif
rule
=
sdef
->
sdef_rule_type
->
rule_type_rule
;
typeargs
=
rule
->
type_alt_lhs
->
type_node_arguments
;
...
...
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