Verified Commit 635e7735 authored by Camil Staps's avatar Camil Staps
Browse files

Add strictness annotations in backendpreprocess and convertcases to prevent...

Add strictness annotations in backendpreprocess and convertcases to prevent stack overflows when generic fusion is used
parent 9f5e1dff
......@@ -15,24 +15,22 @@ backEndPreprocess aliasDummyId functionIndices iclModule varHeap
= preprocess aliasDummyId
[iclModule.icl_functions.[i] \\ i <- functionIndices] varHeap
class preprocess a :: !Ident a -> Preprocessor
:: Preprocessor
:== *PreprocessState -> *PreprocessState
class preprocess a :: !Ident a !*PreprocessState -> *PreprocessState
:: PreprocessState
:== VarHeap
instance preprocess {#a} | preprocess a & Array {#} a where
preprocess aliasDummyId array
= foldStateA (preprocess aliasDummyId) array
preprocess aliasDummyId array pst
= foldStateA (preprocess aliasDummyId) array pst
instance preprocess [a] | preprocess a where
preprocess aliasDummyId list
= foldState (preprocess aliasDummyId) list
preprocess aliasDummyId list pst
= foldState (preprocess aliasDummyId) list pst
// +++ this assigns sequence numbers per function, should be per alternative and move to backendconvert
instance preprocess FunDef where
preprocess aliasDummyId funDef
= fromSequencerToPreprocessor aliasDummyId (sequence funDef.fun_body)
preprocess aliasDummyId funDef pst
= fromSequencerToPreprocessor aliasDummyId (sequence funDef.fun_body) pst
class sequence a :: a -> Sequencer
:: Sequencer
......
......@@ -63,6 +63,9 @@ where
convert_functions NoComponentMembers group_nr dcl_functions common_defs main_dcl_module_n fun_defs_and_ci
= fun_defs_and_ci
convert_function :: !Index !{#{#FunType}} !{#CommonDefs} !Int !Int
!*(!*{#FunDef}, ![SymbKind], !*ConvertState)
-> *(!*{#FunDef}, ![SymbKind], !*ConvertState)
convert_function group_index dcl_functions common_defs main_dcl_module_n fun (fun_defs, collected_imports, cs)
# ({fun_body,fun_type}, fun_defs) = fun_defs![fun]
(fun_body, (collected_imports, cs))
......
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