mirror of
https://github.com/KarolS/millfork.git
synced 2025-01-11 12:29:46 +00:00
Don't enable -fsubroutine-extraction when using -Os or -Of
This commit is contained in:
parent
14d6cf4d5c
commit
261486b3cd
@ -212,12 +212,12 @@ Whether identical functions should be merged into one function.
|
|||||||
Default: yes.
|
Default: yes.
|
||||||
|
|
||||||
* `-fsubroutine-extraction`, `-fno-subroutine-extraction` –
|
* `-fsubroutine-extraction`, `-fno-subroutine-extraction` –
|
||||||
Whether identical fragments of functions should be extracted into subroutines.
|
Whether identical fragments of functions should be extracted into subroutines (experimental).
|
||||||
|
Makes the code smaller. Computationally very expensive.
|
||||||
`.ini` equivalent: `subroutine_extraction`.
|
`.ini` equivalent: `subroutine_extraction`.
|
||||||
Default: no.
|
Default: no.
|
||||||
|
|
||||||
* `-Os`, `--size` – Optimize for size, sacrificing some speed (experimental).
|
* `-Os`, `--size` – Optimize for size, sacrificing some speed (experimental).
|
||||||
Also enables `-fsubroutine-extraction`.
|
|
||||||
|
|
||||||
* `-Of`, `--fast` – Optimize for speed, even if it increases the size a bit (experimental).
|
* `-Of`, `--fast` – Optimize for speed, even if it increases the size a bit (experimental).
|
||||||
Also enables `-finline`.
|
Also enables `-finline`.
|
||||||
|
@ -32,34 +32,33 @@ case class Context(errorReporting: Logger,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
def isFlagSet(f: CompilationFlag.Value): Boolean = flags.getOrElse(f, false)
|
||||||
|
|
||||||
def filloutFlags(): Context = {
|
def filloutFlags(): Context = {
|
||||||
var addons = Map[CompilationFlag.Value, Boolean]()
|
var addons = Map[CompilationFlag.Value, Boolean]()
|
||||||
if (flags.contains(CompilationFlag.EmitNative65816Opcodes)
|
if (isFlagSet(CompilationFlag.EmitNative65816Opcodes)
|
||||||
|| flags.contains(CompilationFlag.EmitEmulation65816Opcodes)
|
|| isFlagSet(CompilationFlag.EmitEmulation65816Opcodes)
|
||||||
|| flags.contains(CompilationFlag.EmitHudsonOpcodes)
|
|| isFlagSet(CompilationFlag.EmitHudsonOpcodes)
|
||||||
|| flags.contains(CompilationFlag.Emit65CE02Opcodes)) {
|
|| isFlagSet(CompilationFlag.Emit65CE02Opcodes)) {
|
||||||
addons += CompilationFlag.EmitCmosOpcodes -> true
|
addons += CompilationFlag.EmitCmosOpcodes -> true
|
||||||
}
|
}
|
||||||
if (flags.contains(CompilationFlag.EmitEZ80Opcodes)) {
|
if (isFlagSet(CompilationFlag.EmitEZ80Opcodes)) {
|
||||||
addons += CompilationFlag.EmitZ80Opcodes -> true
|
addons += CompilationFlag.EmitZ80Opcodes -> true
|
||||||
}
|
}
|
||||||
if (flags.contains(CompilationFlag.EmitZ80Opcodes) || flags.contains(CompilationFlag.EmitSharpOpcodes)) {
|
if (isFlagSet(CompilationFlag.EmitZ80Opcodes) || isFlagSet(CompilationFlag.EmitSharpOpcodes)) {
|
||||||
addons += CompilationFlag.EmitExtended80Opcodes -> true
|
addons += CompilationFlag.EmitExtended80Opcodes -> true
|
||||||
}
|
}
|
||||||
if (flags.contains(CompilationFlag.EmitZ80Opcodes) || flags.contains(CompilationFlag.EmitIntel8085Opcodes)) {
|
if (isFlagSet(CompilationFlag.EmitZ80Opcodes) || isFlagSet(CompilationFlag.EmitIntel8085Opcodes)) {
|
||||||
addons += CompilationFlag.EmitIntel8080Opcodes -> true
|
addons += CompilationFlag.EmitIntel8080Opcodes -> true
|
||||||
}
|
}
|
||||||
if (flags.contains(CompilationFlag.OptimizeForSpeed)) {
|
if (isFlagSet(CompilationFlag.OptimizeForSpeed)) {
|
||||||
addons += CompilationFlag.InlineFunctions -> true
|
addons += CompilationFlag.InlineFunctions -> true
|
||||||
}
|
}
|
||||||
if (flags.contains(CompilationFlag.OptimizeForSize)) {
|
if (isFlagSet(CompilationFlag.DangerousOptimizations)) {
|
||||||
addons += CompilationFlag.SubroutineExtraction -> true
|
|
||||||
}
|
|
||||||
if (flags.contains(CompilationFlag.DangerousOptimizations)) {
|
|
||||||
addons += CompilationFlag.InterproceduralOptimization -> true
|
addons += CompilationFlag.InterproceduralOptimization -> true
|
||||||
addons += CompilationFlag.OptimizeStdlib -> true
|
addons += CompilationFlag.OptimizeStdlib -> true
|
||||||
}
|
}
|
||||||
if (flags.contains(CompilationFlag.OptimizeForDebugging)) {
|
if (isFlagSet(CompilationFlag.OptimizeForDebugging)) {
|
||||||
addons += CompilationFlag.VariableOverlap -> false
|
addons += CompilationFlag.VariableOverlap -> false
|
||||||
addons += CompilationFlag.RegisterVariables -> false
|
addons += CompilationFlag.RegisterVariables -> false
|
||||||
addons += CompilationFlag.FunctionDeduplication -> false
|
addons += CompilationFlag.FunctionDeduplication -> false
|
||||||
|
Loading…
x
Reference in New Issue
Block a user