Commit b94e5f7b authored by Diederik van Arkel's avatar Diederik van Arkel

Add fusion commandline flag

parent 089cde2b
......@@ -5,8 +5,6 @@ PA_BUG on off :== off
switch_import_syntax one_point_three two_point_zero :== one_point_three
/* when finally removing this switch also remove the argument of STE_Instance and ID_OldSyntax */
SwitchFusion fuse dont_fuse :== dont_fuse
SwitchPreprocessor preprocessor no_preprocessor :== preprocessor
// MV...
......
......@@ -5,8 +5,6 @@ PA_BUG on off :== off
switch_import_syntax one_point_three two_point_zero :== one_point_three
/* when finally removing this switch also remove the argument of STE_Instance and ID_OldSyntax */
SwitchFusion fuse dont_fuse :== dont_fuse
SwitchPreprocessor preprocessor no_preprocessor :== preprocessor
// MV...
......
......@@ -8,8 +8,9 @@ from general import Optional, Yes, No
import checksupport, transform, overloading
:: FrontEndOptions
= { feo_up_to_phase :: !FrontEndPhase
, feo_generics :: !Bool
= { feo_up_to_phase :: !FrontEndPhase
, feo_generics :: !Bool
, feo_fusion :: !Bool
}
:: FrontEndSyntaxTree
......
......@@ -10,7 +10,8 @@ SwitchGenerics on off :== off
:: FrontEndOptions
= { feo_up_to_phase :: !FrontEndPhase
, feo_generics :: !Bool
, feo_generics :: !Bool
, feo_fusion :: !Bool
}
:: FrontEndSyntaxTree
......@@ -234,8 +235,10 @@ frontEndInterface options mod_ident search_paths cached_dcl_modules functions_an
# (cleanup_info, acc_args, components, fun_defs, var_heap, expression_heap)
= analyseGroups common_defs imported_funs array_instances.ali_instances_range main_dcl_module_n stdStrictLists_module_n (components -*-> "Analyse") fun_defs var_heap expression_heap
// # (components, fun_defs, error) = showComponents2 components 0 fun_defs acc_args error
(components, fun_defs, dcl_types, used_conses, var_heap, type_heaps, expression_heap)
= transformGroups cleanup_info main_dcl_module_n stdStrictLists_module_n (components -*-> "Transform") fun_defs acc_args common_defs imported_funs dcl_types used_conses_in_dynamics type_def_infos var_heap type_heaps expression_heap
= transformGroups cleanup_info main_dcl_module_n stdStrictLists_module_n (components -*-> "Transform") fun_defs acc_args common_defs imported_funs dcl_types used_conses_in_dynamics type_def_infos var_heap type_heaps expression_heap options.feo_fusion
| options.feo_up_to_phase == FrontEndPhaseTransformGroups
# heaps = {hp_var_heap=var_heap, hp_type_heaps=type_heaps, hp_expression_heap=expression_heap}
......@@ -345,18 +348,21 @@ where
= show_component funs show_types fun_defs (file <<< fun_def)
// = show_component funs show_types fun_defs (file <<< fun_def.fun_symb)
showComponents2 :: !{! Group} !Int !*{# FunDef} !{! ConsClasses} !*File -> (!*{# FunDef},!*File)
showComponents2 :: !*{! Group} !Int !*{# FunDef} !{! ConsClasses} !*File -> (!*{! Group},!*{# FunDef},!*File)
showComponents2 comps comp_index fun_defs acc_args file
| comp_index >= (size comps)
= (fun_defs, file)
# (fun_defs, file) = show_component comps.[comp_index].group_members fun_defs acc_args file
= (comps, fun_defs, file)
# (comp, comps) = comps![comp_index]
# (fun_defs, file) = show_component comp.group_members fun_defs acc_args file
= showComponents2 comps (inc comp_index) fun_defs acc_args file
where
show_component [] fun_defs _ file
= (fun_defs, file <<< '\n')
show_component [fun:funs] fun_defs acc_args file
# (fd, fun_defs) = fun_defs![fun]
# file = show_accumulating_arguments acc_args.[fun].cc_args (file <<< fd.fun_symb <<< '.' <<< fun <<< " (")
# file = file <<< fd.fun_symb <<< '.' <<< fun <<< " ("
# file = show_accumulating_arguments acc_args.[fun].cc_args file
# file = show_linear_arguments acc_args.[fun].cc_linear_bits file
= show_component funs fun_defs acc_args (file <<< ") ")
show_accumulating_arguments [ cc : ccs] file
......@@ -366,10 +372,19 @@ where
= show_accumulating_arguments ccs (file <<< 'c')
| cc == cAccumulating
= show_accumulating_arguments ccs (file <<< 'a')
| cc == cVarOfMultimatchCase
= show_accumulating_arguments ccs (file <<< 'm')
= show_accumulating_arguments ccs (file <<< '?')
show_accumulating_arguments [] file
= file
show_linear_arguments [ cc : ccs] file
| cc == True
= show_linear_arguments ccs (file <<< 'l')
= show_linear_arguments ccs (file <<< 'n')
show_linear_arguments [] file
= file
//show_components comps fun_defs = map (show_component fun_defs) comps
show_component fun_defs [] = []
......
......@@ -4,9 +4,10 @@ import StdEnv
import syntax, transform
cPassive :== -1
cActive :== -2
cAccumulating :== -3
cPassive :== -1
cActive :== -2
cAccumulating :== -3
cVarOfMultimatchCase :== -4
:: CleanupInfo
......@@ -14,7 +15,7 @@ analyseGroups :: !{# CommonDefs} !{#{#FunType}} !IndexRange !Int !Int !*{! Group
-> (!CleanupInfo, !*{! ConsClasses}, !*{! Group}, !*{#FunDef}, !*VarHeap, !*ExpressionHeap)
transformGroups :: !CleanupInfo !Int !Int !*{! Group} !*{#FunDef} !{!.ConsClasses} !{# CommonDefs} !{# {# FunType} }
!*{#{# CheckedTypeDef}} !ImportedConstructors !*TypeDefInfos !*VarHeap !*TypeHeaps !*ExpressionHeap
!*{#{# CheckedTypeDef}} !ImportedConstructors !*TypeDefInfos !*VarHeap !*TypeHeaps !*ExpressionHeap !Bool
-> (!*{! Group}, !*{#FunDef}, !*{#{# CheckedTypeDef}}, !ImportedConstructors, !*VarHeap, !*TypeHeaps, !*ExpressionHeap)
partitionateFunctions :: !*{# FunDef} ![IndexRange] -> (!*{! Group}, !*{# FunDef})
......
This diff is collapsed.
......@@ -19,6 +19,9 @@ import portToNewSyntax
// MV ...
, compile_for_dynamics :: !Bool
// ... MV
// DvA ...
, compile_with_fusion :: !Bool
// ... DvA
}
InitialCoclOptions =
......@@ -32,6 +35,9 @@ InitialCoclOptions =
// MV ...
, compile_for_dynamics = False
// ... MV
// DvA ...
, compile_with_fusion = False
// ... DvA
}
:: DclCache = {
......@@ -85,6 +91,12 @@ parseCommandLine [arg1=:"-dynamics":args] options
# (args,modules,options)= parseCommandLine args {options & compile_for_dynamics = True}
= (args,modules,options)
// ... MV
// DvA ...
parseCommandLine [arg1=:"-fusion":args] options
// switch on fusion transformations
# (args,modules,options)= parseCommandLine args {options & compile_with_fusion = True}
= (args,modules,options)
// ... DvA
parseCommandLine [arg : args] options
| arg.[0] == '-'
# (args,modules,options)= parseCommandLine args options
......@@ -183,7 +195,7 @@ compileModule options commandLineArgs {dcl_modules,functions_and_macros,predef_s
# ({boxed_ident=moduleIdent}, hash_table) = putIdentInHashTable options.moduleName IC_Module hash_table
# list_inferred_types = if (isMember "-lt" commandLineArgs) (Yes (not (isMember "-lattr" commandLineArgs))) No
# (optionalSyntaxTree,cached_functions_and_macros,cached_dcl_mods,n_functions_and_macros_in_dcl_modules,main_dcl_module_n,predef_symbols, hash_table, files, error, io, out,tcl_file,heaps)
= frontEndInterface {feo_up_to_phase=FrontEndPhaseAll,feo_generics=False} moduleIdent options.searchPaths dcl_modules functions_and_macros list_inferred_types predef_symbols hash_table files error io out tcl_file heaps
= frontEndInterface {feo_up_to_phase=FrontEndPhaseAll,feo_generics=False,feo_fusion=options.compile_with_fusion} moduleIdent options.searchPaths dcl_modules functions_and_macros list_inferred_types predef_symbols hash_table files error io out tcl_file heaps
# unique_copy_of_predef_symbols={predef_symbol\\predef_symbol<-:predef_symbols}
# (closed, files)
= closeTclFile tcl_file files
......
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