mirror of
https://github.com/KarolS/millfork.git
synced 2025-01-15 09:29:49 +00:00
Cosmetic improvements
This commit is contained in:
parent
f01879e4a3
commit
84d707b932
@ -188,7 +188,7 @@ case class FunctionCallExpression(functionName: String, expressions: List[Expres
|
||||
override def getAllIdentifiers: Set[String] = expressions.map(_.getAllIdentifiers).fold(Set[String]())(_ ++ _) + functionName
|
||||
override def prettyPrint: String =
|
||||
if (expressions.size != 2 || functionName.exists(Character.isAlphabetic(_)))
|
||||
functionName + expressions.mkString("(", ", ", ")")
|
||||
functionName + expressions.map(_.prettyPrint).mkString("(", ", ", ")")
|
||||
else s"(${expressions.head.prettyPrint} $functionName ${expressions(1).prettyPrint}"
|
||||
}
|
||||
|
||||
|
@ -306,8 +306,8 @@ abstract class AbstractAssembler[T <: AbstractCode](private val program: Program
|
||||
val labelMapImm = labelMap.toMap
|
||||
val niceFunctionPropertiesImm = niceFunctionProperties.toSet
|
||||
val extraOptimizedCode = veryLateOptimizations(thisFunctionNiceProperties, options).foldLeft(code) { (c, opt) =>
|
||||
val code = opt.optimize(function, c, OptimizationContext(options, labelMapImm, env.maybeGet[ThingInMemory]("__reg"), niceFunctionPropertiesImm))
|
||||
if (code eq c) code else quickSimplify(code)
|
||||
val ocode = opt.optimize(function, c, OptimizationContext(options, labelMapImm, env.maybeGet[ThingInMemory]("__reg"), niceFunctionPropertiesImm))
|
||||
if (ocode eq c) code else quickSimplify(ocode)
|
||||
}
|
||||
compiledFunctions(f) = NormalCompiledFunction(
|
||||
function.declaredBank.getOrElse(platform.defaultCodeBank),
|
||||
@ -777,8 +777,8 @@ abstract class AbstractAssembler[T <: AbstractCode](private val program: Program
|
||||
unoptimizedCodeSize += unoptimized.map(_.sizeInBytes).sum
|
||||
// unoptimized.foreach(l => log.trace(l.toString))
|
||||
val code = optimizations.foldLeft(quickSimplify(unoptimized)) { (c, opt) =>
|
||||
val code = opt.optimize(f, c, OptimizationContext(options, labelMap, env.maybeGet[ThingInMemory]("__reg"), niceFunctionProperties))
|
||||
if (code eq c) code else quickSimplify(code)
|
||||
val ocode = opt.optimize(f, c, OptimizationContext(options, labelMap, env.maybeGet[ThingInMemory]("__reg"), niceFunctionProperties))
|
||||
if (ocode eq c) ocode else quickSimplify(ocode)
|
||||
}
|
||||
performFinalOptimizationPass(f, optimizations.nonEmpty, options, code)
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user