Commit 3ac1e9ee authored by John van Groningen's avatar John van Groningen
Browse files

bug fix: reverse order of functions (in components)

(backendconvert.icl,backend.c)
parent cc8dbec0
......@@ -469,7 +469,7 @@ backEndConvertModulesH predefs {fe_icl =
= (backEnd -*-> "backend done")
where
functionIndices
= flatten [[(componentIndex, member) \\ member <- group.group_members] \\ group <-: fe_components & componentIndex <- [0..]]
= flatten [[(componentIndex, member) \\ member <- group.group_members] \\ group <-: fe_components & componentIndex <- [1..]]
declareOtherDclModules :: {#DclModule} Int NumberSet -> BackEnder
declareOtherDclModules dcls main_dcl_module_n used_module_numbers
......@@ -705,9 +705,9 @@ instance declare {#a} | declareWithIndex a & Array {#} a where
declareFunctionSymbols :: {#FunDef} {#Int} [(Int, Int)] IndexRange *BackEndState -> *BackEndState
declareFunctionSymbols functions iclDclConversions functionIndices globalFunctions backEnd
= foldr (declare iclDclConversions) backEnd [(functionIndex, componentIndex, functions.[functionIndex]) \\ (componentIndex, functionIndex) <- functionIndices]
= foldl (declare iclDclConversions) backEnd [(functionIndex, componentIndex, functions.[functionIndex]) \\ (componentIndex, functionIndex) <- functionIndices]
where
declare iclDclConversions (functionIndex, componentIndex, function) backEnd
declare iclDclConversions backEnd (functionIndex, componentIndex, function)
= appBackEnd (BEDeclareFunction (functionName function.fun_symb.id_name functionIndex iclDclConversions globalFunctions)
function.fun_arity functionIndex componentIndex) backEnd
where
......
......@@ -29,7 +29,7 @@ extern void InitARC_Info (void); /* from typeconv.h */
# include <limits.h>
# if 1
# if 0
# include "dbprint.h"
# endif
......@@ -387,7 +387,7 @@ BEDeclareIclModule (CleanString name, int nFunctions, int nTypes, int nConstruct
icl->beicl_module = ConvertAllocType (ImpRepr);
icl->beicl_dcl_module = gBEState.be_modules [main_dcl_module_n];
icl->beicl_previousAncestor = UINT_MAX;
icl->beicl_previousAncestor = 0;
scc_dependency_list = NULL;
icl->beicl_depsP = &scc_dependency_list;
......@@ -414,7 +414,7 @@ BEDeclareIclModule (CleanString name, int nFunctions, int nTypes, int nConstruct
locallyGeneratedFunction = &gLocallyGeneratedFunctions [i];
DeclareFunctionC (locallyGeneratedFunction->lgf_name, locallyGeneratedFunction->lgf_arity, nFunctions-ArraySize(gLocallyGeneratedFunctions)+i, UINT_MAX);
DeclareFunctionC (locallyGeneratedFunction->lgf_name, locallyGeneratedFunction->lgf_arity, nFunctions-ArraySize(gLocallyGeneratedFunctions)+i,0);
}
/* +++ hack */
......@@ -2187,7 +2187,7 @@ DeclareFunctionC (char *name, int arity, int functionIndex, unsigned int ancesto
functions = module->bem_functions;
Assert (functions != NULL);
Assert (icl->beicl_previousAncestor >= ancestor);
Assert (icl->beicl_previousAncestor <= ancestor);
icl->beicl_previousAncestor = ancestor;
Assert (functionIndex < module->bem_nFunctions);
......
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