Commit cb71daec authored by clean's avatar clean
Browse files

caching of dcl modules, return unique heap

parent 9207c4bf
...@@ -3,4 +3,4 @@ definition module backendconvert ...@@ -3,4 +3,4 @@ definition module backendconvert
from backend import BackEnd from backend import BackEnd
import frontend import frontend
backEndConvertModules :: PredefinedSymbols FrontEndSyntaxTree VarHeap *BackEnd -> *BackEnd backEndConvertModules :: PredefinedSymbols FrontEndSyntaxTree !Int *VarHeap *BackEnd -> (!*VarHeap,!*BackEnd)
This diff is collapsed.
...@@ -2,4 +2,4 @@ definition module backendinterface ...@@ -2,4 +2,4 @@ definition module backendinterface
import frontend import frontend
backEndInterface :: !{#Char} [{#Char}] !PredefinedSymbols !*FrontEndSyntaxTree !*File !*Files -> (!Bool, !*File, !*Files) backEndInterface :: !{#Char} [{#Char}] !PredefinedSymbols !FrontEndSyntaxTree !Int !*VarHeap !*File !*Files -> (!Bool,!*VarHeap, !*File, !*Files)
...@@ -19,8 +19,8 @@ checkVersion VersionObservedIsTooOld errorFile ...@@ -19,8 +19,8 @@ checkVersion VersionObservedIsTooOld errorFile
= fwrites "[Backend] the back end library is too old\n" errorFile = fwrites "[Backend] the back end library is too old\n" errorFile
= (False, errorFile) = (False, errorFile)
backEndInterface :: !{#Char} [{#Char}] !PredefinedSymbols !*FrontEndSyntaxTree !*File !*Files -> (!Bool, !*File, !*Files) backEndInterface :: !{#Char} [{#Char}] !PredefinedSymbols !FrontEndSyntaxTree !Int !*VarHeap !*File !*Files -> (!Bool,!*VarHeap, !*File, !*Files)
backEndInterface outputFileName commandLineArgs predefs syntaxTree errorFile files backEndInterface outputFileName commandLineArgs predef_symbols syntaxTree=:{fe_icl,fe_components} main_dcl_module_n var_heap errorFile files
# (observedCurrent, observedOldestDefinition, observedOldestImplementation) # (observedCurrent, observedOldestDefinition, observedOldestImplementation)
= BEGetVersion = BEGetVersion
observedVersion = observedVersion =
...@@ -42,25 +42,22 @@ backEndInterface outputFileName commandLineArgs predefs syntaxTree errorFile fil ...@@ -42,25 +42,22 @@ backEndInterface outputFileName commandLineArgs predefs syntaxTree errorFile fil
# (compatible, errorFile) # (compatible, errorFile)
= checkVersion (versionCompare expectedVersion observedVersion) errorFile = checkVersion (versionCompare expectedVersion observedVersion) errorFile
| not compatible | not compatible
= (False, errorFile, files) = (False, var_heap,errorFile, files)
# varHeap # varHeap
= backEndPreprocess predefs.[PD_DummyForStrictAliasFun].pds_ident functionIndices = backEndPreprocess predef_symbols.[PD_DummyForStrictAliasFun].pds_ident functionIndices fe_icl var_heap
syntaxTree.fe_icl syntaxTree.fe_varHeap
with with
functionIndices functionIndices
= flatten [[member \\ member <- group.group_members] \\ group <-: syntaxTree.fe_components] = flatten [[member \\ member <- group.group_members] \\ group <-: fe_components]
syntaxTree
= {syntaxTree & fe_varHeap = varHeap}
# backEndFiles # backEndFiles
= 0 = 0
# (backEnd, backEndFiles) # (backEnd, backEndFiles)
= BEInit (length commandLineArgs) backEndFiles = BEInit (length commandLineArgs) backEndFiles
# backEnd # backEnd
= foldState BEArg commandLineArgs backEnd = foldState BEArg commandLineArgs backEnd
# backEnd # (var_heap,backEnd)
= backEndConvertModules predefs syntaxTree varHeap backEnd = backEndConvertModules predef_symbols syntaxTree main_dcl_module_n varHeap backEnd
# (success, backEnd) # (success, backEnd)
= BEGenerateCode outputFileName backEnd = BEGenerateCode outputFileName backEnd
# backEndFiles # backEndFiles
= BEFree backEnd backEndFiles = BEFree backEnd backEndFiles
= (backEndFiles == 0 && success, errorFile, files) = (backEndFiles == 0 && success, var_heap,errorFile, files)
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