From e3c3573abb920c7ed1d5e260df9fe1b8e57a0d92 Mon Sep 17 00:00:00 2001 From: Alistair Michael Date: Wed, 20 Sep 2023 17:12:23 +1000 Subject: [PATCH] minor cleanup --- src/main/scala/ir/Program.scala | 4 ---- src/main/scala/translating/ILtoIL.scala | 7 +++---- src/main/scala/util/RunUtils.scala | 2 +- 3 files changed, 4 insertions(+), 9 deletions(-) diff --git a/src/main/scala/ir/Program.scala b/src/main/scala/ir/Program.scala index f8b71aee9..4aeff086a 100644 --- a/src/main/scala/ir/Program.scala +++ b/src/main/scala/ir/Program.scala @@ -98,10 +98,6 @@ class Program(var procedures: ArrayBuffer[Procedure], var initialMemory: ArrayBu } - override def toString() : String = { - procedures.map(_.toString).mkString("\n") - } - } class Procedure(var name: String, var address: Option[Int], var blocks: ArrayBuffer[Block], var in: ArrayBuffer[Parameter], var out: ArrayBuffer[Parameter]) { diff --git a/src/main/scala/translating/ILtoIL.scala b/src/main/scala/translating/ILtoIL.scala index 70d186fde..2686745a6 100644 --- a/src/main/scala/translating/ILtoIL.scala +++ b/src/main/scala/translating/ILtoIL.scala @@ -8,7 +8,7 @@ private class ILSerialiser extends Visitor { var indentLevel = 0 def getIndent(): String = { - " " * indentLevel + " " * indentLevel } def blockIdentifier(block: Block) : String = { @@ -93,7 +93,7 @@ private class ILSerialiser extends Visitor { program ++= "IndirectCall(" node.target = visitVariable(node.target) program ++= ", " - program ++= "Condition(" + program ++= "condition(" node.condition = node.condition.map(visitExpr) program ++= ")" // Condition program ++= ")" // IndirectCall @@ -152,7 +152,7 @@ private class ILSerialiser extends Visitor { for (i <- node.blocks.indices) { node.blocks(i) = visitBlock(node.blocks(i)) } - program ++= "))\n" + program ++= ")),\n" indentLevel -= 1 node } @@ -250,7 +250,6 @@ private class ILSerialiser extends Visitor { override def visitVariable(node: Variable): Variable = { program ++= node.toString() node - //node.acceptVisit(this) } override def visitRegister(node: Register): Register = { diff --git a/src/main/scala/util/RunUtils.scala b/src/main/scala/util/RunUtils.scala index 2f3797b74..20c557a02 100644 --- a/src/main/scala/util/RunUtils.scala +++ b/src/main/scala/util/RunUtils.scala @@ -122,7 +122,7 @@ object RunUtils { val cfg = IntraproceduralProgramCfg.generateFromProgram(IRProgram) // Output.output(OtherOutput(OutputKindE.cfg), cfg.toDot({ x => - // x.toStrin + // x.toString // }, Output.dotIder)) //Output.output(OtherOutput(OutputKindE.cfg), cfg.toDot(x => x.toString, Output.dotIder), "intra_cfg")