Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
clean-compiler-and-rts
compiler
Commits
3c204f52
Commit
3c204f52
authored
Dec 01, 2017
by
John van Groningen
Browse files
move compile_with_fusion and strip_unused in to new record FusionOptions
parent
0a3eb782
Changes
5
Hide whitespace changes
Inline
Side-by-side
frontend/frontend.dcl
View file @
3c204f52
...
...
@@ -6,14 +6,14 @@ definition module frontend
from
scanner
import
::
SearchPaths
from
general
import
::
Optional
(
Yes
,
No
)
import
checksupport
,
overloading
from
trans
import
::
FusionOptions
(..)
from
partition
import
::
Component
(..),::
ComponentMembers
::
FrontEndOptions
=
{
feo_up_to_phase
::
!
FrontEndPhase
,
feo_fusion
::
!
FusionOptions
,
feo_generics
::
!
Bool
,
feo_fusion
::
!
Bool
,
feo_dump_core
::
!
Bool
,
feo_strip_unused
::
!
Bool
}
::
FrontEndSyntaxTree
...
...
frontend/frontend.icl
View file @
3c204f52
...
...
@@ -202,11 +202,11 @@ frontEndInterface opt_file_dir_time options mod_ident search_paths cached_dcl_mo
sri
->
[{
ir_from
=
sri
,
ir_to
=
inc
sri
},
icl_exported_global_functions
]
#
exported_functions
=
exported_global_functions
++
[
dcl_instances
,
dcl_specials
,
dcl_gencases
,
dcl_type_funs
]
#
(
components
,
fun_defs
,
predef_symbols
,
var_heap
,
expression_heap
,
error_admin
)
=
case
options
.
feo_strip_unused
of
=
case
options
.
feo_
fusion
.
strip_unused
of
True
->
partitionateFunctions`
fun_defs
(
exported_functions
++
[
icl_function_indices
.
ifi_type_function_indices
!!
1
])
main_dcl_module_n
def_min
def_max
predef_symbols
var_heap
expression_heap
error_admin
_
->
case
options
.
feo_fusion
of
->
case
options
.
feo_fusion
.
compile_with_fusion
of
True
#
(
fun_defs
,
predef_symbols
,
var_heap
,
expression_heap
,
error_admin
)
=
stripStrictLets
fun_defs
predef_symbols
var_heap
expression_heap
error_admin
...
...
frontend/trans.dcl
View file @
3c204f52
...
...
@@ -3,6 +3,8 @@ definition module trans
import
StdEnv
import
syntax
,
classify
,
predef
::
FusionOptions
=
{
compile_with_fusion
::
!
Bool
,
strip_unused
::
!
Bool
}
transformGroups
::
!
CleanupInfo
!
Int
!
Int
!
Int
!
Int
!*{!
Component
}
!*{#
FunDef
}
!*{!.
ConsClasses
}
!{#
CommonDefs
}
!{#
{#
FunType
}
}
!*
ImportedTypes
!*
TypeDefInfos
!*
VarHeap
!*
TypeHeaps
!*
ExpressionHeap
!
Bool
!*
File
!*
PredefinedSymbols
!*
ImportedTypes
!*
TypeDefInfos
!*
VarHeap
!*
TypeHeaps
!*
ExpressionHeap
!
FusionOptions
!*
File
!*
PredefinedSymbols
->
(!*{!
Component
},
!*{#
FunDef
},
!*
ImportedTypes
,
!
ImportedConstructors
,
!*
VarHeap
,
!*
TypeHeaps
,
!*
ExpressionHeap
,
!*
File
,
!*
PredefinedSymbols
)
frontend/trans.icl
View file @
3c204f52
...
...
@@ -4255,10 +4255,10 @@ mark_unused_functions_in_components [] ti
= ti
transformGroups :: !CleanupInfo !Int !Int !Int !Int !*{!Component} !*{#FunDef} !*{!.ConsClasses} !{# CommonDefs} !{# {# FunType} }
!*
ImportedTypes
!*
TypeDefInfos
!*
VarHeap
!*
TypeHeaps
!*
ExpressionHeap
!
Bool
!*
File
!*
PredefinedSymbols
!*ImportedTypes !*TypeDefInfos !*VarHeap !*TypeHeaps !*ExpressionHeap !
FusionOptions
!*File !*PredefinedSymbols
-> (!*{!Component}, !*{#FunDef}, !*ImportedTypes, !ImportedConstructors, !*VarHeap, !*TypeHeaps, !*ExpressionHeap, !*File, !*PredefinedSymbols)
transformGroups cleanup_info main_dcl_module_n ro_StdStrictLists_module_n def_min def_max groups fun_defs cons_args common_defs imported_funs
imported_types
type_def_infos
var_heap
type_heaps
symbol_heap
compile_with_fusion
error
predef_symbols
imported_types type_def_infos var_heap type_heaps symbol_heap
{
compile_with_fusion
}
error predef_symbols
#! nr_of_funs = size fun_defs
# initial_ti = { ti_fun_defs = fun_defs
, ti_instances = createArray nr_of_funs II_Empty
...
...
main/compile.icl
View file @
3c204f52
...
...
@@ -104,10 +104,9 @@ closeTclFile _ files
,
outMode
::
Int
,
searchPaths
::
SearchPaths
,
listTypes
::
ListTypesOption
,
fusion_options
::
!
FusionOptions
,
compile_for_dynamics
::
!
Bool
,
compile_with_fusion
::
!
Bool
,
dump_core
::
!
Bool
,
strip_unused
::
!
Bool
,
compile_with_generics
::
!
Bool
}
...
...
@@ -124,10 +123,9 @@ InitialCoclOptions =
,
outMode
=
FWriteText
,
searchPaths
=
{
sp_locations
=
[],
sp_paths
=
[]}
,
listTypes
=
{
lto_showAttributes
=
True
,
lto_listTypesKind
=
ListTypesNone
}
,
fusion_options
=
{
compile_with_fusion
=
False
,
strip_unused
=
False
}
,
compile_for_dynamics
=
False
,
compile_with_fusion
=
False
,
dump_core
=
False
,
strip_unused
=
False
,
compile_with_generics
=
True
}
...
...
@@ -187,12 +185,12 @@ parseCommandLine [arg1=:"-dynamics":args] options
=
([
arg1
:
args
],
modules
,
options
)
parseCommandLine
[
arg1
=:
"-fusion"
:
args
]
options
// switch on fusion transformations
#
(
args
,
modules
,
options
)
=
parseCommandLine
args
{
options
&
compile_with_fusion
=
True
}
#
(
args
,
modules
,
options
)
=
parseCommandLine
args
{
options
&
fusion_options
.
compile_with_fusion
=
True
}
=
([
arg1
:
args
],
modules
,
options
)
parseCommandLine
[
arg1
=:
"-dump"
:
args
]
options
=
parseCommandLine
args
{
options
&
dump_core
=
True
}
parseCommandLine
[
arg1
=:
"-strip"
:
args
]
options
=
parseCommandLine
args
{
options
&
strip_unused
=
True
}
=
parseCommandLine
args
{
options
&
fusion_options
.
strip_unused
=
True
}
parseCommandLine
[
"-generics"
:
args
]
options
// enable generics
=
parseCommandLine
args
{
options
&
compile_with_generics
=
True
}
...
...
@@ -308,9 +306,8 @@ compileModule options backendArgs cache=:{dcl_modules,functions_and_macros,prede
=
frontEndInterface
opt_file_dir_time
{
feo_up_to_phase
=
FrontEndPhaseAll
,
feo_generics
=
options
.
compile_with_generics
,
feo_fusion
=
options
.
compile_with_fus
ion
,
feo_fusion
=
options
.
fusion_opt
ion
s
,
feo_dump_core
=
options
.
dump_core
,
feo_strip_unused
=
options
.
strip_unused
}
moduleIdent
options
.
searchPaths
dcl_modules
functions_and_macros
list_inferred_types
predef_symbols
hash_table
fmodificationtime
files
error
io
out
tcl_file
heaps
#
unique_copy_of_predef_symbols
={
predef_symbol
\\
predef_symbol
<-:
predef_symbols
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment