use of org.jetbrains.plugins.groovy.lang.psi.controlFlow.Instruction in project intellij-community by JetBrains.
the class ThrowingInstruction method toString.
@Override
public String toString() {
final StringBuilder builder = new StringBuilder();
builder.append(num());
builder.append("(");
for (Instruction successor : allSuccessors()) {
builder.append(successor.num());
builder.append(',');
}
if (allPredecessors().iterator().hasNext())
builder.delete(builder.length() - 1, builder.length());
builder.append(") ").append("THROW. ").append(getElementPresentation());
return builder.toString();
}
use of org.jetbrains.plugins.groovy.lang.psi.controlFlow.Instruction in project intellij-community by JetBrains.
the class ReachingDefinitionsCollector method getReachable.
private static LinkedHashSet<Integer> getReachable(final LinkedHashSet<Integer> fragmentInsns, final Instruction[] flow, final DefinitionMap dfaResult, final int[] postorder) {
final LinkedHashSet<Integer> result = new LinkedHashSet<>();
for (final Instruction insn : flow) {
if (isReadInsn(insn)) {
final int ref = insn.num();
int[] definitions = dfaResult.getDefinitions(ref);
if (definitions != null) {
for (final int def : definitions) {
if (fragmentInsns.contains(def) && (!fragmentInsns.contains(ref) || postorder[ref] < postorder[def] && checkPathIsOutsideOfFragment(def, ref, flow, fragmentInsns))) {
result.add(ref);
break;
}
}
}
}
}
return result;
}
Aggregations