SSAInstruction instr = ir.getInstructions()[i]; if (instr == null) continue; // Some instructions are null (padding NoOps) LOG(DEBUG, "DEBUG", "\tinst: " + instr.toString()); int derefValueNumber = -1; if (instr instanceof SSAGetInstruction && !((SSAGetInstruction) instr).isStatic()) {
@Override public String toString() { return toString(null); }
@Override public String toString() { return toString(null); }
@Override public String toString() { final StringBuilder s = new StringBuilder(super.toString()); for (TypeReference t : declaredResultTypes) { s.append(' ').append(t); } return s.toString(); }
@Override public String toString() { final StringBuilder s = new StringBuilder(super.toString()); for (TypeReference t : declaredResultTypes) { s.append(' ').append(t); } return s.toString(); }
@Override public String toString() { SSAInstruction[] insts = getInstructions(); StringBuilder s = new StringBuilder("CAst CFG of " + functionName); int params[] = symtab.getParameterValueNumbers(); for (int param : params) s.append(' ').append(param); s.append('\n'); for (int i = 0; i < getNumberOfNodes(); i++) { PreBasicBlock bb = getNode(i); s.append(bb).append('\n'); for (PreBasicBlock pbb : Iterator2Iterable.make(getSuccNodes(bb))) s.append(" -->").append(pbb).append('\n'); for (int j = bb.getFirstInstructionIndex(); j <= bb.getLastInstructionIndex(); j++) if (insts[j] != null) s.append(" ").append(insts[j].toString(symtab)).append('\n'); } s.append("-- END --"); return s.toString(); } }
@Override public String toString() { SSAInstruction[] insts = getInstructions(); StringBuilder s = new StringBuilder("CAst CFG of " + functionName); int params[] = symtab.getParameterValueNumbers(); for (int param : params) s.append(' ').append(param); s.append('\n'); for (int i = 0; i < getNumberOfNodes(); i++) { PreBasicBlock bb = getNode(i); s.append(bb).append('\n'); for (PreBasicBlock pbb : Iterator2Iterable.make(getSuccNodes(bb))) s.append(" -->").append(pbb).append('\n'); for (int j = bb.getFirstInstructionIndex(); j <= bb.getLastInstructionIndex(); j++) if (insts[j] != null) s.append(" ").append(insts[j].toString(symtab)).append('\n'); } s.append("-- END --"); return s.toString(); } }
public static synchronized Statement ssaInstruction2Statement(CGNode node, SSAInstruction s, Map<SSAInstruction, Integer> instructionIndices, IR ir) { if (node == null) { throw new IllegalArgumentException("null node"); } if (s == null) { throw new IllegalArgumentException("null s"); } if (s instanceof SSAPhiInstruction) { SSAPhiInstruction phi = (SSAPhiInstruction) s; return new PhiStatement(node, phi); } else if (s instanceof SSAPiInstruction) { SSAPiInstruction pi = (SSAPiInstruction) s; return new PiStatement(node, pi); } else if (s instanceof SSAGetCaughtExceptionInstruction) { return new GetCaughtExceptionStatement(node, ((SSAGetCaughtExceptionInstruction) s)); } else { Integer x = instructionIndices.get(s); if (x == null) { Assertions.UNREACHABLE(s.toString() + "\nnot found in map of\n" + ir); } return new NormalStatement(node, x.intValue()); } }
public static synchronized Statement ssaInstruction2Statement(CGNode node, SSAInstruction s, Map<SSAInstruction, Integer> instructionIndices, IR ir) { if (node == null) { throw new IllegalArgumentException("null node"); } if (s == null) { throw new IllegalArgumentException("null s"); } if (s instanceof SSAPhiInstruction) { SSAPhiInstruction phi = (SSAPhiInstruction) s; return new PhiStatement(node, phi); } else if (s instanceof SSAPiInstruction) { SSAPiInstruction pi = (SSAPiInstruction) s; return new PiStatement(node, pi); } else if (s instanceof SSAGetCaughtExceptionInstruction) { return new GetCaughtExceptionStatement(node, ((SSAGetCaughtExceptionInstruction) s)); } else { Integer x = instructionIndices.get(s); if (x == null) { Assertions.UNREACHABLE(s.toString() + "\nnot found in map of\n" + ir); } return new NormalStatement(node, x.intValue()); } }
@Override public String toString() { StringBuilder name = new StringBuilder(); if (getInstruction().hasDef()) { String[] names = getNode().getIR().getLocalNames(getInstructionIndex(), getInstruction().getDef()); if (names != null && names.length > 0) { name = new StringBuilder("[").append(names[0]); for (int i = 1; i < names.length; i++) { name.append(", ").append(names[i]); } name.append("]: "); } } return "NORMAL " + getNode().getMethod().getName() + ':' + name + getInstruction().toString() + ' ' + getNode(); }
for (int j = start; j <= end; j++) { if (instructions[j] != null) { StringBuilder x = new StringBuilder(j + " " + instructions[j].toString(ir.getSymbolTable())); StringStuff.padWithSpaces(x, 35); result.append(x);
return s.toString();
@Override public String toString() { StringBuilder name = new StringBuilder(); if (getInstruction().hasDef()) { String[] names = getNode().getIR().getLocalNames(getInstructionIndex(), getInstruction().getDef()); if (names != null && names.length > 0) { name = new StringBuilder("[").append(names[0]); for (int i = 1; i < names.length; i++) { name.append(", ").append(names[i]); } name.append("]: "); } } return "NORMAL " + getNode().getMethod().getName() + ':' + name + getInstruction().toString() + ' ' + getNode(); }
for (int j = start; j <= end; j++) { if (instructions[j] != null) { StringBuilder x = new StringBuilder(j + " " + instructions[j].toString(ir.getSymbolTable())); StringStuff.padWithSpaces(x, 35); result.append(x);
StringBuilder x = new StringBuilder(j + " " + instructions[j].toString(symbolTable)); StringStuff.padWithSpaces(x, 45); result.append(x);
StringBuilder x = new StringBuilder(j + " " + instructions[j].toString(symbolTable)); StringStuff.padWithSpaces(x, 45); result.append(x);
@Test public void testMultiNewArray1() throws IOException, ClassHierarchyException { AnalysisScope scope = null; scope = AnalysisScopeReader.readJavaScope(TestConstants.WALA_TESTDATA, (new FileProvider()).getFile("J2SEClassHierarchyExclusions.txt"), MY_CLASSLOADER); ClassHierarchy cha = ClassHierarchyFactory.make(scope); IClass klass = cha.lookupClass(TypeReference.findOrCreate(ClassLoaderReference.Application, TestConstants.MULTI_DIM_MAIN)); Assert.assertTrue(klass != null); IMethod m = klass.getMethod(Selector.make(Language.JAVA, "testNewMultiArray()V")); Assert.assertTrue(m != null); IAnalysisCacheView cache = new AnalysisCacheImpl(); IR ir = cache.getIRFactory().makeIR(m, Everywhere.EVERYWHERE, new SSAOptions()); Assert.assertTrue(ir != null); SSAInstruction[] instructions = ir.getInstructions(); for (SSAInstruction instr : instructions) { if (instr instanceof SSANewInstruction) { System.err.println(instr.toString(ir.getSymbolTable())); Assert.assertTrue(instr.getNumberOfUses() == 2); Assert.assertTrue(ir.getSymbolTable().getIntValue(instr.getUse(0)) == 3); Assert.assertTrue(ir.getSymbolTable().getIntValue(instr.getUse(1)) == 4); } } } }