Package ghidra.pcode.struct
Class StructuredSleigh.FreshLabel
java.lang.Object
ghidra.pcode.struct.StructuredSleigh.FreshLabel
- All Implemented Interfaces:
StructuredSleigh.Label
- Enclosing class:
StructuredSleigh
A fresh Sleigh label
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionBorrow this labelGenerate code for this labelGenerate a goto statement that targets this labelgenGoto(StructuredSleigh.RVal cond, StructuredSleigh.Label fall) Generate a conditional goto statement that targets this labelref()Generate a reference to this label as it should appear in a Sleigh "goto" statement
-
Constructor Details
-
FreshLabel
protected FreshLabel()
-
-
Method Details
-
freshOrBorrow
Description copied from interface:StructuredSleigh.LabelBorrow this labelThis should be used whenever a statement (or its children) may need to generate a goto using the "next" label passed into it. If "next" is the fall-through label, this will generate a fresh label. If this label is already fresh, this will "borrow" the label, meaning references will be generated, but it will not produce another anchor. This is to prevent generation of duplicate anchors.
- Specified by:
freshOrBorrowin interfaceStructuredSleigh.Label- Returns:
- the resulting label
-
genAnchor
Description copied from interface:StructuredSleigh.LabelGenerate code for this labelThis must be the last method called on the label, because it relies on knowing whether or not the label is actually used. (The Sleigh compiler rejects code if it contains unused labels.)
- Specified by:
genAnchorin interfaceStructuredSleigh.Label- Returns:
- the Sleigh code
-
ref
Description copied from interface:StructuredSleigh.LabelGenerate a reference to this label as it should appear in a Sleigh "goto" statement- Specified by:
refin interfaceStructuredSleigh.Label- Returns:
- the label's expression
-
genGoto
Description copied from interface:StructuredSleigh.LabelGenerate a goto statement that targets this label- Specified by:
genGotoin interfaceStructuredSleigh.Label- Parameters:
fall- the label following the goto- Returns:
- the Sleigh code
-
genGoto
Description copied from interface:StructuredSleigh.LabelGenerate a conditional goto statement that targets this label- Specified by:
genGotoin interfaceStructuredSleigh.Label- Parameters:
cond- the condition valuefall- the label following the goto- Returns:
- the Sleigh code
-