Commit f1b14889 authored by Sapphie's avatar Sapphie
Browse files

Small changes

parent 527efc2b
......@@ -318,10 +318,10 @@ object CPSValueRepresenter extends (H.Tree => L.Tree) {
L.LetP(n, CPS.XOr, Seq(res, L.AtomL(1)), transform(body))
}
case L3.IntMul =>
tempLetP(CPS.Sub, Seq(Left(x), lAtomOne)) { x1 =>
tempLetP(CPS.XOr, Seq(Left(x), lAtomOne)) { x1 =>
tempLetP(CPS.ShiftRight, Seq(Left(y), lAtomOne)) { y1 =>
tempLetP(CPS.Mul, Seq(Right(x1), Right(y1))) { z =>
L.LetP(n, CPS.Add, Seq(z, L.AtomL(1)), transform(body))
L.LetP(n, CPS.XOr, Seq(z, L.AtomL(1)), transform(body))
}
}
}
......
......@@ -20,20 +20,21 @@ object Main {
// andThen treePrinter("---------- After high optimization")
// andThen CPSInterpreterHigh
andThen CPSValueRepresenter
// andThen treeChecker
andThen CPSHoister
// andThen treePrinter("---------- After value representation")
// andThen CPSOptimizerLow
andThen CPSOptimizerLow
// andThen treePrinter("---------- After low optimization")
andThen treeChecker
andThen (new CPSInterpreterLow(stats.log _))
// andThen CPSConstantNamer
// andThen CPSRegisterAllocator
// andThen CPSToASMTranslator
// andThen treeChecker
// andThen (new CPSInterpreterLow(stats.log _))
andThen CPSConstantNamer
andThen CPSRegisterAllocator
andThen CPSToASMTranslator
// andThen seqPrinter("---------- After translation to assembly")
// andThen ASMLabelResolver
andThen ASMLabelResolver
// andThen ASMInterpreter
// andThen ASMFileWriter(Option(System.getProperty("l3.out-asm-file"))
// .getOrElse("out.l3a"))
andThen ASMFileWriter(Option(System.getProperty("l3.out-asm-file"))
.getOrElse("out.l3a"))
)
val basePath = Paths.get(".").toAbsolutePath
......@@ -44,7 +45,7 @@ object Main {
.flatMap(backEnd) match {
case Right((retCode, maybeMsg)) =>
maybeMsg foreach println
println(stats)
// println(stats)
sys.exit(retCode)
case Left(errMsg) =>
println(s"Error: $errMsg")
......
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