Skip to content

Commit

Permalink
minor cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
ailrst committed Sep 20, 2023
1 parent c9a6dc7 commit e3c3573
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 9 deletions.
4 changes: 0 additions & 4 deletions src/main/scala/ir/Program.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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]) {
Expand Down
7 changes: 3 additions & 4 deletions src/main/scala/translating/ILtoIL.scala
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ private class ILSerialiser extends Visitor {
var indentLevel = 0

def getIndent(): String = {
" " * indentLevel
" " * indentLevel
}

def blockIdentifier(block: Block) : String = {
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
}
Expand Down Expand Up @@ -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 = {
Expand Down
2 changes: 1 addition & 1 deletion src/main/scala/util/RunUtils.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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")

Expand Down

0 comments on commit e3c3573

Please sign in to comment.