Commit 7861d005 authored by John van Groningen's avatar 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
......@@ -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;
......
......@@ -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);
......
......@@ -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
......@@ -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;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment