Package ghidra.pcode.struct
Class GotoStmt
java.lang.Object
ghidra.pcode.struct.GotoStmt
- All Implemented Interfaces:
StructuredSleigh.Stmt
-
Field Summary
Modifier and TypeFieldDescriptionprotected final StructuredSleigh
protected ghidra.pcode.struct.AbstractStmt
-
Constructor Summary
ModifierConstructorDescriptionprotected
GotoStmt
(StructuredSleigh ctx, StructuredSleigh.RVal target) -
Method Summary
Modifier and TypeMethodDescriptionprotected StringTree
generate
(StructuredSleigh.Label next, StructuredSleigh.Label fall) Generate the Sleigh code that implements this statementInternal: Provides the implementation ofRValInternal.getContext()
forAssignStmt
protected StructuredSleigh.Label
getNext()
Get the label for the statement immediately following this statementprotected boolean
Check if the statement is or contains a single branch statementprotected <T extends StructuredSleigh.Stmt>
TGet the innermost statement of the given class containing this statementprotected ghidra.pcode.struct.AbstractStmt
reparent
(ghidra.pcode.struct.AbstractStmt newParent)
-
Field Details
-
ctx
-
parent
protected ghidra.pcode.struct.AbstractStmt parent
-
-
Constructor Details
-
GotoStmt
-
-
Method Details
-
generate
Generate the Sleigh code that implements this statement- Parameters:
next
- the label receiving control immediately after this statement is executedfall
- the label positioned immediately after this statement in the generated code- Returns:
- the generated Sleigh code
-
getContext
Internal: Provides the implementation ofRValInternal.getContext()
forAssignStmt
- Returns:
- the context
-
reparent
protected ghidra.pcode.struct.AbstractStmt reparent(ghidra.pcode.struct.AbstractStmt newParent) -
nearest
Get the innermost statement of the given class containing this statementThis is used to implement "truncation" statements like "break", "continue", and "result".
- Type Parameters:
T
- the type of the statement sought- Parameters:
cls
- the class of the statement sought- Returns:
- the found statement or null
-
isSingleGoto
protected boolean isSingleGoto()Check if the statement is or contains a single branch statementThis is to avoid the unnecessary generation of labels forming chains of unconditional gotos.
- Returns:
- true if so, false otherwise.
-
getNext
Get the label for the statement immediately following this statementFor statements that always fall-through, this is just {#link
StructuredSleigh.FALL
.- Returns:
- the label
-