Creates the three-address representation for some method(s) and prints it to std out or writes
it to a file.
Example:
To convert all files of a project to the AI based three-address code, you can use:
import org.opalj.io.write
import org.opalj.util.PerformanceEvaluation.time
import org.opalj.tac._
val f = new java.io.File("OPAL/bi/target/scala-2.11/resource_managed/test/ai.jar")
val p = org.opalj.br.analyses.Project(f)
var i = 0val errors = time {
p.parForeachMethodWithBody(parallelizationLevel=32){ mi =>val TACode(code,cfg,ehs,_) = org.opalj.tac.TACAI(p,mi.method)()
val tac = ToTxt(code, Some(cfg))
val fileNamePrefix = mi.classFile.thisType.toJava+"."+mi.method.name
val file = write(tac, fileNamePrefix, ".tac.txt")
i+= 1
println(i+":"+file)
}
}(t => println("transformation time: "+t.toSeconds))
if(errors.nonEmpty) println(errors.mkString("\n"))
Creates the three-address representation for some method(s) and prints it to std out or writes it to a file.
To convert all files of a project to the AI based three-address code, you can use: