Commit d259e79b authored by John van Groningen's avatar John van Groningen

add fusion to 'Module Options' dialog

parent e5008729
......@@ -775,6 +775,7 @@ where
, ("Reuse Unique Nodes",Nothing,toMark ini.reuseUniqueNodes,noPS (\l->{l & reuseUniqueNodes = not l.reuseUniqueNodes}))
, ("Never Time Profile",Nothing,toMark ini.neverTimeProfile,noPS (\l->{l & neverTimeProfile = not l.neverTimeProfile}))
// , ("Never Memory Profile",Nothing,toMark ini.neverMemoryProfile,noPS (\l->{l & neverMemoryProfile = not l.neverMemoryProfile}))
, ("Fusion (Experimental)",Nothing,toMark ini.fusion,noPS (\l->{l & fusion = not l.fusion}))
]
(Columns 1)
[ ControlPos (Left,zero)
......
......@@ -15,7 +15,8 @@ from PmDirCache import :: DirCache
, abcGiveWarnings :: !Bool //.
, abcBeVerbose :: !Bool //--> now abused for -exl flag
, abcGenerateComments :: !Bool
, abcReuseUniqueNodes :: !Bool
, abcReuseUniqueNodes :: !Bool
, abcFusion :: !Bool
}
DefaultABCOptions :: ABCOptions
......
......@@ -26,7 +26,8 @@ from StdLibMisc import :: Date{..}, :: Time{..}
, abcGiveWarnings :: !Bool
, abcBeVerbose :: !Bool
, abcGenerateComments :: !Bool
, abcReuseUniqueNodes :: !Bool
, abcReuseUniqueNodes :: !Bool
, abcFusion :: !Bool
}
DefaultABCOptions :: ABCOptions;
......@@ -38,6 +39,7 @@ DefaultABCOptions =
, abcBeVerbose = False
, abcGenerateComments = False
, abcReuseUniqueNodes = False
, abcFusion = False
}
//-- abc file handling
......@@ -60,8 +62,10 @@ NoTimeProfileMask :== 5;
VerboseMask :== 6;
WarningsMask :== 7;
SystemMask :== 8;
NrOfOptions :== 9;
FusionOffset :== 9;
MinimumNrOfOptions :== 9;
NrOfOptions :== 10;
Combined :: !Pathname !DATE !ABCCache !Files -> (!((!Bool, !Bool, !Int, !ABCOptions),(!List Modulename, !Maybe ModuleDate, !List ModuleDate, !List LinkObjFileName, !List LinkLibraryName),!ABCCache),!Files)
Combined path date abccache files
......@@ -113,10 +117,16 @@ Read_Version_and_Options file
where
Find_Version_and_Options :: !String -> (!Bool,!Bool,!Bool,!Int,!ABCOptions);
Find_Version_and_Options str
| match_endinfo < len_str = (True,False,False,-1,DefaultABCOptions);
| match_options - start`` == NrOfOptions = (True,sys,stack_seq,version,abcOptions);
= (True,False,False,-1,DefaultABCOptions);
where
| match_endinfo < len_str
= (True,False,False,-1,DefaultABCOptions);
| match_options - start`` < MinimumNrOfOptions
= (True,False,False,-1,DefaultABCOptions);
# version = SubStringToInt 0 start` (dec match_version) str;
abcOptions = (StringToCompilerOptions start`` match_options str);
stack_seq = ProjectABCFile start`` str;
sys = SystemABCFile start`` str;
= (True,sys,stack_seq,version,abcOptions);
where
len_str = size str;
start = SkipSpaces 0 len_str str;
stop_endinfo = start + 7;
......@@ -127,20 +137,18 @@ where
match_version = SkipDigits start` len_str str;
start`` = SkipSpaces match_version len_str str;
match_options = SkipBits start`` len_str str;
version = SubStringToInt 0 start` (dec match_version) str;
abcOptions = (StringToCompilerOptions start`` str);
stack_seq = ProjectABCFile start`` str;
sys = SystemABCFile start`` str;
StringToCompilerOptions :: !Int !String -> ABCOptions;
StringToCompilerOptions start opt
= { abcMemoryProfile = not (opt .[start+NoMemoryProfileMask] == '1'),
abcTimeProfile = not (opt .[start+NoTimeProfileMask] == '1'),
StringToCompilerOptions :: !Int !Int !String -> ABCOptions;
StringToCompilerOptions start end opt
= { abcMemoryProfile = not (opt.[start+NoMemoryProfileMask] == '1'),
abcTimeProfile = not (opt.[start+NoTimeProfileMask] == '1'),
abcStrictnessAnalysis = opt .[start+StrictnessMask] == '1',
abcGiveWarnings = opt .[start+WarningsMask] == '1',
abcBeVerbose = opt .[start+VerboseMask] == '1',
abcGenerateComments = opt .[start+DebugMask] == '1',
abcReuseUniqueNodes = not (opt.[start+DontReuseUniqueNodesMask] == '1') };
abcReuseUniqueNodes = not (opt.[start+DontReuseUniqueNodesMask] == '1'),
abcFusion = start+FusionOffset<end && opt.[start+FusionOffset]=='1'
};
ProjectABCFile :: !Int !String -> Bool;
ProjectABCFile start opt = opt .[start+ParallelMask] == '0';
......@@ -521,37 +529,18 @@ where
patchLine :: {#Char} -> (Bool, {#Char})
patchLine line
# (found, offset) = findOptionStringOffset line
| found
/* sanity checks ...
| abcNoMemoryProfile <> '0' && abcNoMemoryProfile <> '1'
= (False, line) ->> abcPath +++ " incorrect memory offset\n"
| abcNoTimeProfile <> '0' && abcNoTimeProfile <> '1'
= (False, line) ->> abcPath +++ " incorrect time offset\n"
| /*(abcNoMemoryProfile == '0') == memoryProfile &&*/ (abcNoTimeProfile == '0') == timeProfile
= (False, line) ->> abcPath +++ " unnecessary patch\n"
... sanity checks */
// otherwise
= (found, {copy line & /*[offset+NoMemoryProfileMask] = if memoryProfile '0' '1',*/
= (found, {copy line & /*[offset+NoMemoryProfileMask] = if memoryProfile '0' '1',*/
[offset+NoTimeProfileMask] = if timeProfile '0' '1'})
// | otherwise
= (False, line)
where
(found, offset)
= findOptionStringOffset line
/* sanity checks ...
abcNoMemoryProfile
= line.[offset+NoMemoryProfileMask]
abcNoTimeProfile
= line.[offset+NoTimeProfileMask]
... sanity checks */
copy array
= {el \\ el <-: array}
findOptionStringOffset :: {#Char} -> (Bool, Int)
findOptionStringOffset string
= (offset+NrOfOptions < stringLength, offset)
= (offset+MinimumNrOfOptions < stringLength, offset)
where
versionString = toString version
versionSize = size versionString
......
......@@ -19,6 +19,7 @@ instance fromString ListTypes
, bv :: !Bool // be verbose
, gc :: !Bool // generate commented abc-code
, reuseUniqueNodes :: !Bool
, fusion :: !Bool
}
DefaultCompilerOptions :: CompilerOptions
......@@ -72,6 +72,7 @@ where
, bv :: !Bool // be verbose
, gc :: !Bool // generate comments
, reuseUniqueNodes :: !Bool // reuse unique nodes
, fusion :: !Bool
}
DefaultCompilerOptions :: CompilerOptions
......@@ -84,6 +85,7 @@ DefaultCompilerOptions =
, gw = True
, bv = True
, gc = False
, reuseUniqueNodes = True
, reuseUniqueNodes = True
, fusion = False
}
......@@ -1413,18 +1413,20 @@ check_module_options modname info=:{version,abcOptions} co mp tp expectedEagerOr
= (False,"["+++modname+++".icl,]: .abc out of date, different abc version.")
| abcOptions.abcBeVerbose <> expectedBeVerbose
= (False,"["+++modname+++".icl,]: .abc out of date, different compiler options. (Dynamics)")
= incorrect_option modname "Dynamics"
| abcOptions.abcTimeProfile <> expectedTimeProfile
= (False,"["+++modname+++".icl,]: .abc out of date, different compiler options. (Time Profiling)")
= incorrect_option modname "Time Profiling"
| abcOptions.abcMemoryProfile <> expectedMemoryProfile // <- is this how we use it now?
= (False,"["+++modname+++".icl,]: .abc out of date, different compiler options. (Heap Profiling)")
= incorrect_option modname "Heap Profiling"
| abcOptions.abcStrictnessAnalysis <> expectedStrictnessAnalysis
= (False,"["+++modname+++".icl,]: .abc out of date, different compiler options. (Strictness Analysis)")
= incorrect_option modname "Strictness Analysis"
// || abcOptions.abcGenerateComments <> expectedGenerateComments // <- do we need to regenerate for this?
| (expectedGenerateComments && (not abcOptions.abcGenerateComments)) // want comments but don't have
= (False,"["+++modname+++".icl,]: .abc out of date, different compiler options. (Generate Comments)")
= incorrect_option modname "Generate Comments"
| abcOptions.abcReuseUniqueNodes <> expectedReuseUniqueNodes
= (False,"["+++modname+++".icl,]: .abc out of date, different compiler options. (Reuse Unique Nodes)")
= incorrect_option modname "Reuse Unique Nodes"
| abcOptions.abcFusion<>co.fusion
= incorrect_option modname "Fusion"
= (True,"")
where
expectedMemoryProfile = expectedEagerOrDynamic || (mp && (not co.neverMemoryProfile))
......@@ -1434,6 +1436,9 @@ where
expectedGenerateComments = co.gc
expectedReuseUniqueNodes = co.reuseUniqueNodes
incorrect_option modname option_name
= (False,"["+++modname+++".icl,]: .abc out of date, different compiler options. ("+++option_name+++")")
//-- Generate Phase...
// Generate code for the designated module.
......
......@@ -186,7 +186,8 @@ CompilerOptionsTable =
SimpleOption "Warnings" (\a->a.gw) (\v a->{a & gw=v}),
SimpleOption "Verbose" (\a->a.bv) (\v a->{a & bv=v}),
SimpleOption "ReadableABC" (\a->a.gc) (\v a->{a & gc=v}),
SimpleOption "ReuseUniqueNodes" (\a->a.reuseUniqueNodes) (\v a->{a & reuseUniqueNodes=v})
SimpleOption "ReuseUniqueNodes" (\a->a.reuseUniqueNodes) (\v a->{a & reuseUniqueNodes=v}),
SimpleOption "Fusion" (\a->a.fusion) (\v a->{a & fusion=v})
}
CodeGenOptionsTable :: OptionsTable CodeGenOptions
......
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