@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(); }
@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(); }
/** * If we've already created the current instruction, return the value number def'ed by the current instruction. Else, create a * new symbol. */ private int reuseOrCreateDef() { if (getCurrentInstruction() == null || !getCurrentInstruction().hasDef()) { return symbolTable.newSymbol(); } else { return getCurrentInstruction().getDef(); } }
/** * If we've already created the current instruction, return the value number def'ed by the current instruction. Else, create a * new symbol. */ private int reuseOrCreateDef() { if (getCurrentInstruction() == null || !getCurrentInstruction().hasDef()) { return symbolTable.newSymbol(); } else { return getCurrentInstruction().getDef(); } }
/** * Create a dataflow equation induced by a given instruction */ private void makeEquationForInstruction(OperatorFactory<T> opFactory, SSAInstruction s) { if (s != null && s.hasDef()) { AbstractOperator<T> op = opFactory.get(s); if (op != null) { T def = getVariable(s.getDef()); if (op instanceof NullaryOperator) { newStatement(def, (NullaryOperator<T>) op, false, false); } else { int n = s.getNumberOfUses(); T[] uses = makeStmtRHS(n); for (int j = 0; j < n; j++) { if (s.getUse(j) > -1) { uses[j] = getVariable(s.getUse(j)); assert uses[j] != null; } } newStatement(def, op, uses, false, false); } } } }
/** * Create a dataflow equation induced by a given instruction */ private void makeEquationForInstruction(OperatorFactory<T> opFactory, SSAInstruction s) { if (s != null && s.hasDef()) { AbstractOperator<T> op = opFactory.get(s); if (op != null) { T def = getVariable(s.getDef()); if (op instanceof NullaryOperator) { newStatement(def, (NullaryOperator<T>) op, false, false); } else { int n = s.getNumberOfUses(); T[] uses = makeStmtRHS(n); for (int j = 0; j < n; j++) { if (s.getUse(j) > -1) { uses[j] = getVariable(s.getUse(j)); assert uses[j] != null; } } newStatement(def, op, uses, false, false); } } } }