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 int
OPTION_MERGE_ADJACENT_LABELS
(package private) static int
OPTION_REMOVE_REDUNDANT_RETURNS
(package private) int
options
(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 Node
enter(Node node, java.util.Set<Node> visitedNodes)
private Node
exit(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)
void
removeGotos(Block method)
private void
removeGotosCore(Block method)
static void
removeRedundantCode(Block method)
static void
removeRedundantCode(Block method, int options)
private void
removeRedundantCodeCore(Block method)
private void
transformLeaveStatements(Block method)
private void
traverseGraph(Block method)
private boolean
tryInlineReturn(Expression gotoExpression, Node target, AstCode code)
private boolean
trySimplifyGoto(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)
-
-