From ad561c6f2055303bc355cc5e84dbf1e8b614f30e Mon Sep 17 00:00:00 2001 From: johnvg Date: Thu, 31 Mar 2011 15:26:26 +0000 Subject: use type Component instead of Group in the fusion modules: partition, classify and trans, because function pointers for generated functions are stored in the Component, they can be found without searching the new functions list git-svn-id: https://svn.cs.ru.nl/repos/clean-compiler/trunk@1895 1f8540f1-abd5-4d5b-9d24-4c5ce8603e2d --- backend/backendconvert.icl | 19 ++++++++++++++++--- backend/backendinterface.icl | 33 +++++++++++++++++++++++++++++---- 2 files changed, 45 insertions(+), 7 deletions(-) (limited to 'backend') diff --git a/backend/backendconvert.icl b/backend/backendconvert.icl index 357209f..52f2c77 100644 --- a/backend/backendconvert.icl +++ b/backend/backendconvert.icl @@ -6,11 +6,10 @@ implementation module backendconvert import code from library "backend_library" import StdEnv -// import StdDebug - import frontend import backend import backendsupport, backendpreprocess +import partition // trace macro (-*->) infixl @@ -489,7 +488,21 @@ backEndConvertModulesH predefs {fe_icl = = (backEnd -*-> "backend done") where functionIndices - = flatten [[(componentIndex, member) \\ member <- group.group_members] \\ group <-: fe_components & componentIndex <- [1..]] + = function_indices 0 fe_components + + function_indices i components + | i BackEnder declareOtherDclModules dcls main_dcl_module_n used_module_numbers diff --git a/backend/backendinterface.icl b/backend/backendinterface.icl index aa7bc00..41c0b1c 100644 --- a/backend/backendinterface.icl +++ b/backend/backendinterface.icl @@ -9,6 +9,7 @@ import frontend import backend import backendpreprocess, backendsupport, backendconvert import Version +import partition checkVersion :: VersionsCompatability *File -> (!Bool, !*File) checkVersion VersionsAreCompatible errorFile @@ -49,7 +50,19 @@ backEndInterface outputFileName commandLineArgs listTypes typesPath predef_symbo # varHeap = backEndPreprocess predefined_idents.[PD_DummyForStrictAliasFun] functionIndices fe_icl var_heap with - functionIndices = flatten [group.group_members \\ group <-: fe_components] + functionIndices = function_indices 0 fe_components + + function_indices i components + | i (*AttrVarHeap, *File, *BackEnd) +optionallyPrintFunctionTypes :: ListTypesOption {#Char} DictionaryToClassInfo {!Component} {#FunDef} *AttrVarHeap *File !*BackEnd -> (*AttrVarHeap, *File, *BackEnd) optionallyPrintFunctionTypes {lto_listTypesKind, lto_showAttributes} typesPath info components functions attrHeap outFile backEnd | lto_listTypesKind == ListTypesStrictExports || lto_listTypesKind == ListTypesAll = printFunctionTypes (lto_listTypesKind == ListTypesAll) lto_showAttributes info components functions attrHeap outFile backEnd = (attrHeap, outFile, backEnd) -printFunctionTypes :: Bool Bool DictionaryToClassInfo {!Group} {#FunDef} *AttrVarHeap *File *BackEnd -> (*AttrVarHeap, *File, *BackEnd) +printFunctionTypes :: Bool Bool DictionaryToClassInfo {!Component} {#FunDef} *AttrVarHeap *File *BackEnd -> (*AttrVarHeap, *File, *BackEnd) printFunctionTypes all attr info components functions attrHeap file backEnd = foldSt (printFunctionType all attr info) functionIndicesAndFunctions (attrHeap, file, backEnd) where functionIndicesAndFunctions - = [(member,functions.[member]) \\ group <-: components, member <- group.group_members] + = function_indices_and_functions 0 components + + function_indices_and_functions i components + | i (*AttrVarHeap, *File, *BackEnd) printFunctionType all attr info (functionIndex, {fun_ident,fun_type=Yes type}) (attrHeap, file, backEnd) -- cgit v1.2.3