diff options
-rw-r--r-- | backend/backendconvert.icl | 6 | ||||
-rw-r--r-- | backendC/CleanCompilerSources/backend.c | 8 |
2 files changed, 7 insertions, 7 deletions
diff --git a/backend/backendconvert.icl b/backend/backendconvert.icl index b2dcb82..39d3bc1 100644 --- a/backend/backendconvert.icl +++ b/backend/backendconvert.icl @@ -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 diff --git a/backendC/CleanCompilerSources/backend.c b/backendC/CleanCompilerSources/backend.c index 49eedca..ae4c7f1 100644 --- a/backendC/CleanCompilerSources/backend.c +++ b/backendC/CleanCompilerSources/backend.c @@ -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); |