Package com.strobel.decompiler.ast
Class GotoRemoval
- java.lang.Object
-
- com.strobel.decompiler.ast.GotoRemoval
-
final class GotoRemoval extends java.lang.Object
-
-
Field Summary
Fields Modifier and Type Field Description (package private) java.util.Map<Label,Node>labelLookup(package private) java.util.Map<Node,Label>labels(package private) java.util.Map<Node,Node>nextSibling(package private) static intOPTION_MERGE_ADJACENT_LABELS(package private) static intOPTION_REMOVE_REDUNDANT_RETURNS(package private) intoptions(package private) java.util.Map<Node,Node>parentLookup
-
Constructor Summary
Constructors Constructor Description GotoRemoval()GotoRemoval(int options)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description private Nodeenter(Node node, java.util.Set<Node> visitedNodes)private Nodeexit(Node node, java.util.Set<Node> visitedNodes)private java.lang.Iterable<Node>getParents(Node node)private <T extends Node>
java.lang.Iterable<T>getParents(Node node, java.lang.Class<T> parentType)voidremoveGotos(Block method)private voidremoveGotosCore(Block method)static voidremoveRedundantCode(Block method)static voidremoveRedundantCode(Block method, int options)private voidremoveRedundantCodeCore(Block method)private voidtransformLeaveStatements(Block method)private voidtraverseGraph(Block method)private booleantryInlineReturn(Expression gotoExpression, Node target, AstCode code)private booleantrySimplifyGoto(Expression gotoExpression)
-
-
-
Field Detail
-
OPTION_MERGE_ADJACENT_LABELS
static final int OPTION_MERGE_ADJACENT_LABELS
- See Also:
- Constant Field Values
-
OPTION_REMOVE_REDUNDANT_RETURNS
static final int OPTION_REMOVE_REDUNDANT_RETURNS
- See Also:
- Constant Field Values
-
options
final int options
-
-
Method Detail
-
removeGotos
public final void removeGotos(Block method)
-
removeGotosCore
private void removeGotosCore(Block method)
-
traverseGraph
private void traverseGraph(Block method)
-
trySimplifyGoto
private boolean trySimplifyGoto(Expression gotoExpression)
-
tryInlineReturn
private boolean tryInlineReturn(Expression gotoExpression, Node target, AstCode code)
-
getParents
private <T extends Node> java.lang.Iterable<T> getParents(Node node, java.lang.Class<T> parentType)
-
transformLeaveStatements
private void transformLeaveStatements(Block method)
-
removeRedundantCode
public static void removeRedundantCode(Block method)
-
removeRedundantCode
public static void removeRedundantCode(Block method, int options)
-
removeRedundantCodeCore
private void removeRedundantCodeCore(Block method)
-
-