use variable names in toString, if available

git-svn-id: https://wala.svn.sourceforge.net/svnroot/wala/trunk@2966 f5eafffb-2e1d-0410-98e4-8ec43c5233c4
This commit is contained in:
dolby-oss 2008-07-27 21:37:17 +00:00
parent ba37e01522
commit 8c19ca57b0
1 changed files with 13 additions and 1 deletions

View File

@ -31,7 +31,19 @@ public class NormalStatement extends StatementWithInstructionIndex {
@Override
public String toString() {
return "NORMAL " + getNode().getMethod().getName() + ":" + getInstruction().toString() + " " + getNode();
String name = "";
if (getInstruction().hasDef()) {
String[] names = getNode().getIR().getLocalNames(getInstructionIndex(), getInstruction().getDef());
if (names != null && names.length > 0) {
name = "[" + names[0];
for(int i = 1; i < names.length; i++) {
name = name + ", " + names[i];
}
name = name + "]: ";
}
}
return "NORMAL " + getNode().getMethod().getName() + ":" + name + getInstruction().toString() + " " + getNode();
}
}