more covariant return types in SSACFG; use enumeration objects to print opcodes for binary op instructions; allow using a PrintWriter for Trace

git-svn-id: https://wala.svn.sourceforge.net/svnroot/wala/trunk@506 f5eafffb-2e1d-0410-98e4-8ec43c5233c4
This commit is contained in:
dolby-oss 2006-12-08 14:30:14 +00:00
parent 769d92a604
commit 9fc30f8c19
3 changed files with 16 additions and 9 deletions

View File

@ -45,8 +45,10 @@ public class SSABinaryOpInstruction extends SSAInstruction {
}
public String toString(SymbolTable symbolTable, ValueDecorator d) {
return getValueString(symbolTable, d, result) + " = binaryop(<opcode printing unsupported) "
+ getValueString(symbolTable, d, val1) + " , " + getValueString(symbolTable, d, val2);
return getValueString(symbolTable, d, result) +
" = binaryop(" + operator + ") " +
getValueString(symbolTable, d, val1) + " , " +
getValueString(symbolTable, d, val2);
}
/**

View File

@ -731,7 +731,7 @@ public class SSACFG implements ControlFlowGraph {
*
* @see com.ibm.wala.cfg.ControlFlowGraph#entry()
*/
public IBasicBlock entry() {
public SSACFG.BasicBlock entry() {
return basicBlocks[0];
}
@ -740,7 +740,7 @@ public class SSACFG implements ControlFlowGraph {
*
* @see com.ibm.wala.cfg.ControlFlowGraph#exit()
*/
public IBasicBlock exit() {
public SSACFG.BasicBlock exit() {
return exit;
}

View File

@ -10,10 +10,7 @@
*******************************************************************************/
package com.ibm.wala.util.debug;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.PrintStream;
import java.io.*;
import java.util.Collection;
import java.util.Iterator;
@ -106,6 +103,14 @@ public class Trace {
}
}
public static void flush() {
out.flush();
}
public static PrintWriter getTraceWriter() {
return new PrintWriter(out);
}
/**
* print S iff s contains substring
*
@ -161,4 +166,4 @@ public class Trace {
setTraceFile();
return traceFile;
}
}
}