From 8c19ca57b067b11bd49b92012d672226f9cd313d Mon Sep 17 00:00:00 2001 From: dolby-oss Date: Sun, 27 Jul 2008 21:37:17 +0000 Subject: [PATCH] use variable names in toString, if available git-svn-id: https://wala.svn.sourceforge.net/svnroot/wala/trunk@2966 f5eafffb-2e1d-0410-98e4-8ec43c5233c4 --- .../com/ibm/wala/ipa/slicer/NormalStatement.java | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/com.ibm.wala.core/src/com/ibm/wala/ipa/slicer/NormalStatement.java b/com.ibm.wala.core/src/com/ibm/wala/ipa/slicer/NormalStatement.java index eb1590d23..01c6c61e8 100644 --- a/com.ibm.wala.core/src/com/ibm/wala/ipa/slicer/NormalStatement.java +++ b/com.ibm.wala.core/src/com/ibm/wala/ipa/slicer/NormalStatement.java @@ -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(); } }