private ParameterDefinition getParameter(Expression value) { if (value.getOperand() instanceof ParameterDefinition) return (ParameterDefinition) value.getOperand(); if (value.getOperand() instanceof Variable) return ((Variable) value.getOperand()).getOriginalParameter(); return null; } }
final boolean inlineAllVariables() { boolean modified = false; for (final Block block : _method.getSelfAndChildrenRecursive(Block.class)) { modified |= inlineAllInBlock(block); } return modified; }
private void removeGotosCore(final Block method) { transformLeaveStatements(method); boolean modified; do { modified = false; for (final Expression e : method.getSelfAndChildrenRecursive(Expression.class)) { if (e.getCode() == AstCode.Goto) { modified |= trySimplifyGoto(e); } } } while (modified); removeRedundantCodeCore(method); }
public static boolean isParameter(Expression expr) { if (expr.getCode() == AstCode.Load) { if (expr.getOperand() instanceof ParameterDefinition) return true; if (expr.getOperand() instanceof Variable && ((Variable) expr.getOperand()).getOriginalParameter() != null) return true; } return false; }
public static boolean matchUnconditionalBranch(final Node node) { return node instanceof Expression && ((Expression) node).getCode().isUnconditionalControlFlow(); }
public static boolean matchSimpleBreak(final BasicBlock block, final Label label) { final List<Node> body = block.getBody(); return body.size() == 2 && body.get(0) instanceof Label && match(body.get(1), AstCode.Goto) && ((Expression) body.get(1)).getOperand() == label; }
static boolean references(final Node node, final Variable v) { for (final Expression e : node.getSelfAndChildrenRecursive(Expression.class)) { if (matchLoad(e, v)) { return true; } } return false; }
private static boolean containsMatch(final Node node, final Expression pattern) { for (final Expression e : node.getSelfAndChildrenRecursive(Expression.class)) { if (e.isEquivalentTo(pattern)) { return true; } } return false; }
public final boolean isConditionalControlFlow() { return this instanceof Expression && ((Expression) this).getCode().isConditionalControlFlow(); }
public static boolean matchUnconditionalBranch(final Node node) { return node instanceof Expression && ((Expression) node).getCode().isUnconditionalControlFlow(); }
final boolean inlineAllVariables() { boolean modified = false; for (final Block block : _method.getSelfAndChildrenRecursive(Block.class)) { modified |= inlineAllInBlock(block); } return modified; }
static boolean references(final Node node, final Variable v) { for (final Expression e : node.getSelfAndChildrenRecursive(Expression.class)) { if (matchLoad(e, v)) { return true; } } return false; }
private static boolean containsMatch(final Node node, final Expression pattern) { for (final Expression e : node.getSelfAndChildrenRecursive(Expression.class)) { if (e.isEquivalentTo(pattern)) { return true; } } return false; }
public final boolean isConditionalControlFlow() { return this instanceof Expression && ((Expression) this).getCode().isConditionalControlFlow(); }
public final boolean isUnconditionalControlFlow() { return this instanceof Expression && ((Expression) this).getCode().isUnconditionalControlFlow(); }
final boolean inlineAllVariables() { boolean modified = false; for (final Block block : _method.getSelfAndChildrenRecursive(Block.class)) { modified |= inlineAllInBlock(block); } return modified; }
static boolean references(final Node node, final Variable v) { for (final Expression e : node.getSelfAndChildrenRecursive(Expression.class)) { if (matchLoad(e, v)) { return true; } } return false; }
private static boolean containsMatch(final Node node, final Expression pattern) { for (final Expression e : node.getSelfAndChildrenRecursive(Expression.class)) { if (e.isEquivalentTo(pattern)) { return true; } } return false; }
public final boolean isUnconditionalControlFlow() { return this instanceof Expression && ((Expression) this).getCode().isUnconditionalControlFlow(); }