Commit a5ee3e52 authored by John van Groningen's avatar John van Groningen
Browse files

remove BackendBody

parent da0c2894
......@@ -29,10 +29,6 @@ sfoldr op r l s
foldr [] = r
foldr [a:x] = op a (foldr x)
// fix spelling, this will be removed when cases are implemented in the back end
:: BackEndBody :== BackendBody
BackEndBody x :== BackendBody x
:: BEMonad a :== *BackEndState -> *(!a,!*BackEndState)
:: BackEnder :== *BackEndState -> *BackEndState
......@@ -617,12 +613,6 @@ instance declareVars TransformedBody where
= declareVars tb_args dvInput
o` declareVars tb_rhs dvInput
instance declareVars BackendBody where
declareVars :: BackendBody !DeclVarsInput -> BackEnder
declareVars {bb_args, bb_rhs} dvInput
= declareVars bb_args dvInput
o` declareVars bb_rhs dvInput
instance declareVars Case where
declareVars {case_expr, case_guards, case_default} dvInput
= declareVars case_guards dvInput
......@@ -1440,17 +1430,6 @@ isCodeBlock expr
= False
convertFunctionBody :: Int Int Ident FunctionBody Int -> BEMonad BERuleAltP
convertFunctionBody functionIndex lineNumber aliasDummyId (BackEndBody bodies) main_dcl_module_n
= convertBackEndBodies functionIndex lineNumber bodies main_dcl_module_n
where
convertBackEndBodies :: Int Int [BackEndBody] Int -> BEMonad BERuleAltP
convertBackEndBodies functionIndex lineNumber bodies main_dcl_module_n
= sfoldr (beRuleAlts o convertBackEndBody functionIndex lineNumber aliasDummyId main_dcl_module_n) beNoRuleAlts bodies
where
convertBackEndBody :: Int Int Ident Int BackEndBody -> BEMonad BERuleAltP
convertBackEndBody functionIndex lineNumber aliasDummyId main_dcl_module_n body
= declareVars body aliasDummyId
o` convertBody False functionIndex lineNumber aliasDummyId body.bb_args body.bb_rhs main_dcl_module_n
convertFunctionBody functionIndex lineNumber aliasDummyId (TransformedBody body) main_dcl_module_n
= convertTransformedBody functionIndex lineNumber aliasDummyId body main_dcl_module_n
......
......@@ -81,8 +81,6 @@ instance sequence (Optional a) | sequence a where
// +++ this assigns sequence numbers per function, should be per alternative and moved to backendconvert
instance sequence FunctionBody where
sequence (BackendBody backEndBodies)
= sequence backEndBodies
sequence (TransformedBody transformedBody)
= sequence transformedBody
sequence body
......@@ -95,11 +93,6 @@ instance sequence TransformedBody where
o` sequence body.tb_rhs
// ... case test
instance sequence BackendBody where
sequence body
= sequence body.bb_args
o` sequence body.bb_rhs
instance sequence FreeVar where
sequence freeVar
= sequence freeVar.fv_info_ptr
......
......@@ -546,14 +546,8 @@ FI_IsUnboxedListOfRecordsConsOrNil :== 8
/* macro expansion transforms a CheckedBody into a TransformedBody */
| TransformedBody !TransformedBody
| Expanding ![FreeVar] // the parameters of the newly generated function
| BackendBody ![BackendBody]
| GeneratedBody // the body will be generated automatically - for generics
| NoBody
:: BackendBody =
{ bb_args :: ![FunctionPattern]
, bb_rhs :: !Expression
}
:: FunDef =
{ fun_ident :: !Ident
......
......@@ -525,10 +525,6 @@ where
instance <<< ParsedBody
where
(<<<) file {pb_args,pb_rhs} = file <<< pb_args <<< " = " <<< pb_rhs
instance <<< BackendBody
where
(<<<) file {bb_args,bb_rhs} = file <<< bb_args <<< " = " <<< bb_rhs
instance <<< FunctionPattern
where
......@@ -570,8 +566,6 @@ where
// <<< '[' <<< fi_free_vars <<< "] [" <<< fi_local_vars <<< ']'
<<< tb_args <<< '[' <<< fi_calls <<< ']' <<< "\n\t= " <<< tb_rhs <<< '\n'
// <<< '.' <<< fi_def_level <<< ' ' <<< '[' <<< fi_free_vars <<< ']' <<< tb_args <<< " = " <<< tb_rhs
(<<<) file {fun_ident,fun_body=BackendBody body,fun_type=Yes type} = file // <<< type <<< '\n'
<<< fun_ident <<< '.' <<< body <<< '\n'
(<<<) file {fun_ident,fun_body=NoBody,fun_type=Yes type} = file // <<< type <<< '\n'
<<< fun_ident <<< '.' <<< "Array function\n"
......@@ -582,7 +576,6 @@ where
(<<<) file (ParsedBody bodies) = file <<< bodies
(<<<) file (CheckedBody {cb_args,cb_rhs}) = file <<< "C " <<< cb_args <<< " = " <<< cb_rhs <<< '\n'
(<<<) file (TransformedBody {tb_args,tb_rhs}) = file <<< "T " <<< tb_args <<< " = " <<< tb_rhs <<< '\n'
(<<<) file (BackendBody body) = file <<< body <<< '\n'
(<<<) file (Expanding vars) = file <<< "E " <<< vars
(<<<) file GeneratedBody = file <<< "Generic function\n"
(<<<) file NoBody = file <<< "Array function\n"
......
Supports Markdown
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