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

pass TypeVarHeap to backEndInterface (currently not used, but we will need it later)

parent 28558a7d
......@@ -5,4 +5,6 @@ definition module backendinterface
import frontend
backEndInterface :: !{#Char} [{#Char}] !ListTypesOption !{#Char} !PredefinedSymbols !FrontEndSyntaxTree !Int !*VarHeap !*AttrVarHeap !*File !*File -> (!Bool, !*VarHeap, !*AttrVarHeap, !*File, !*File)
backEndInterface :: !{#Char} [{#Char}] !ListTypesOption !{#Char} !PredefinedSymbols !FrontEndSyntaxTree !Int
!*VarHeap !*TypeVarHeap !*AttrVarHeap !*File !*File
-> (!Bool,!*VarHeap,!*TypeVarHeap,!*AttrVarHeap,!*File,!*File)
......@@ -23,8 +23,11 @@ checkVersion VersionObservedIsTooOld errorFile
= fwrites "Error: the back end library is too old\n" errorFile
= (False, errorFile)
backEndInterface :: !{#Char} [{#Char}] !ListTypesOption !{#Char} !PredefinedSymbols !FrontEndSyntaxTree !Int !*VarHeap !*AttrVarHeap !*File !*File -> (!Bool, !*VarHeap, !*AttrVarHeap, !*File, !*File)
backEndInterface outputFileName commandLineArgs listTypes typesPath predef_symbols syntaxTree=:{fe_icl,fe_components,fe_dcls} main_dcl_module_n var_heap attrHeap errorFile outFile
backEndInterface :: !{#Char} [{#Char}] !ListTypesOption !{#Char} !PredefinedSymbols !FrontEndSyntaxTree !Int
!*VarHeap !*TypeVarHeap !*AttrVarHeap !*File !*File
-> (!Bool,!*VarHeap,!*TypeVarHeap,!*AttrVarHeap,!*File,!*File)
backEndInterface outputFileName commandLineArgs listTypes typesPath predef_symbols syntaxTree=:{fe_icl,fe_components,fe_dcls} main_dcl_module_n
var_heap type_var_heap attrHeap errorFile outFile
# (observedCurrent, observedOldestDefinition, observedOldestImplementation)
= BEGetVersion
observedVersion =
......@@ -46,7 +49,7 @@ backEndInterface outputFileName commandLineArgs listTypes typesPath predef_symbo
# (compatible, errorFile)
= checkVersion (versionCompare expectedVersion observedVersion) errorFile
| not compatible
= (False, var_heap, attrHeap, errorFile, outFile)
= (False, var_heap, type_var_heap, attrHeap, errorFile, outFile)
# varHeap
= backEndPreprocess predefined_idents.[PD_DummyForStrictAliasFun] functionIndices fe_icl var_heap
with
......@@ -79,7 +82,7 @@ backEndInterface outputFileName commandLineArgs listTypes typesPath predef_symbo
= optionallyPrintFunctionTypes listTypes typesPath (DictionaryToClassInfo main_dcl_module_n fe_icl fe_dcls) fe_components fe_icl.icl_functions attrHeap outFile backEnd
# backEndFiles
= BEFree backEnd backEndFiles
= (backEndFiles == 0 && success, var_heap, attrHeap, errorFile, outFile)
= (backEndFiles == 0 && success, var_heap, type_var_heap, attrHeap, errorFile, outFile)
:: DictionaryToClassInfo =
{ dtci_iclModuleIndex :: Int
......
......@@ -324,14 +324,16 @@ compileModule options backendArgs cache=:{dcl_modules,functions_and_macros,prede
= abort ("couldn't close stdio")
# var_heap=heaps.hp_var_heap
hp_type_heaps=heaps.hp_type_heaps
type_var_heap=hp_type_heaps.th_vars
attrHeap=hp_type_heaps.th_attrs
# (success,functions_and_macros,var_heap,attrHeap,error, out)
# (success,functions_and_macros,var_heap,type_var_heap,attrHeap,error,out)
= case optionalSyntaxTree of
Yes syntaxTree
# functions_and_macros = syntaxTree.fe_icl.icl_functions
# (success, var_heap, attrHeap, error, out)
= backEndInterface outputPath (map appendRedirection backendArgs) options.listTypes options.outPath predef_symbols syntaxTree main_dcl_module_n var_heap attrHeap error out
-> (success,functions_and_macros,var_heap,attrHeap, error, out)
# (success, var_heap, type_var_heap, attrHeap, error, out)
= backEndInterface outputPath (map appendRedirection backendArgs) options.listTypes options.outPath predef_symbols syntaxTree main_dcl_module_n
var_heap type_var_heap attrHeap error out
-> (success,functions_and_macros,var_heap,type_var_heap,attrHeap,error,out)
with
appendRedirection arg
= case arg of
......@@ -342,7 +344,7 @@ compileModule options backendArgs cache=:{dcl_modules,functions_and_macros,prede
arg
-> arg
No
-> (False,{},var_heap,attrHeap,error, out)
-> (False,{},var_heap,type_var_heap,attrHeap,error,out)
with
/*
outputPath
......@@ -353,7 +355,7 @@ compileModule options backendArgs cache=:{dcl_modules,functions_and_macros,prede
outputPath
// = /* directoryName options.pathName +++ "Clean System Files" +++ {DirectorySeparator} +++ */ baseName options.pathName
= baseName options.pathName
# heaps = {heaps & hp_var_heap=var_heap, hp_type_heaps = {hp_type_heaps & th_attrs = attrHeap}}
# heaps = {heaps & hp_var_heap=var_heap, hp_type_heaps = {th_vars=type_var_heap, th_attrs=attrHeap}}
# (closed, files) = fclose out files
| not closed
= abort ("couldn't close out file \"" +++ options.outPath +++ "\"\n")
......
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