public class StatementInfo extends NodeInfo
Modifier and Type | Field and Description |
---|---|
private java.util.ArrayList<Label> |
annotatedLabels
List of labels with which the owner statement has been annotated.
|
Constructor and Description |
---|
StatementInfo(Node owner) |
Modifier and Type | Method and Description |
---|---|
void |
addLabelAnnotation(int index,
Label newLabel)
Adds a labeled annotation to the owner statement at the specified index.
|
void |
addLabelAnnotation(Label newLabel)
Adds a labeled annotation to the owner statement.
|
java.util.HashSet<Node> |
adjustSemanticsForLabelAddition(Label label)
Re-adjusts the edges upon addition of
label to this statement. |
java.util.HashSet<Node> |
adjustSemanticsForLabelRemoval(Label label)
Readjusts the edges upon removal of
label from this
statement.Currently, this method performs adjustment of semantics to the following data structures: CFG Edges. If a simple-label is being removed, Incompleteness needs to be added to the corresponding goto-statements in the enclosing function. |
void |
clearLabelAnnotations()
Clears all the label annotations from the owner statement.
|
void |
crudeAddLabelAnnotation(int index,
Label newLabel)
Adds a labeled annotation to the owner statement at the specified index.
|
void |
crudeAddLabelAnnotation(Label newLabel)
Adds a labeled annotation to the owner statement.
|
java.util.ArrayList<Label> |
getLabelAnnotations()
Obtain a list of labels that annotate the owner node.
|
java.util.ArrayList<Label> |
getLabels()
Obtain an ArrayList of all the labels that may be annotated to the owner
statement
n (or rather, that of the CFG node that it
wraps). |
boolean |
hasLabelAnnotations()
Checks whether the owner node has any label annotations.
|
boolean |
hasLabels()
Check whether there are any immediate labels that annotate the owner,
or the CFG node that it wraps.
|
boolean |
removeLabelAnnotation(Label oldLabel)
Removes a label annotation from the owner statement.
|
private static void |
removeLabelFromAllInFunction(FunctionDefinition enclosingFunction,
Label newLabel)
Removes
newLabel from all the statements in
enclosingFunction . |
private static void |
removeLabelFromAllInSwitch(SwitchStatement enclosingSwitch,
Label newLabel)
Removes the label
newLabel from all the statements in the
enclosingSwitch . |
void |
updateUponLabelAddition(Label newLabel)
This method performs required updates to various data structures upon
addition of label
newLabel to a node. |
void |
updateUponLabelRemoval(Label oldLabel)
This method performs required updates to various data structures upon
removal of label
oldLabel to a node. |
clone, deprecated_getDefinitionList, deprecated_isControlConfined, getAccesses, getAllNonLeafEnclosersExclusive, getAllSymbolsAtNode, getAntiDestinations, getAntiEdgeDestList, getAntiEdgeSrcList, getAntiSources, getCallSites, getCallStatements, getCFGInfo, getCFGInfoProtected, getDefsInUD, getFlowDestinations, getFlowEdgeDestList, getFlowEdgeSrcList, getFlowFactIN, getFlowFactIN, getFlowFactOUT, getFlowFactOUT, getFlowSources, getIdNumber, getIN, getIncompleteSemantics, getInJumpSources, getLiveOut, getLiveOutCells, getLockSet, getNode, getNodePhaseInfo, getNonLeafNestingPathExclusive, getOUT, getOuterMostNonLeafEncloser, getOutJumpDestinations, getOutJumpSources, getOutputDestinations, getOutputEdgeDestList, getOutputEdgeSrcList, getOutputSources, getParallelFlowFactIN, getParallelFlowFactOUT, getReachingDefinitions, getReads, getRegionInfo, getSharedAccesses, getSharedCellsAtNode, getSharedReads, getSharedWrites, getSharingAttribute, getStatementWithLabel, getString, getString, getUsesInDU, getWrites, hasBarrierInAST, hasBarrierInCFG, hasBarrierInCFGVisited, hasCallSites, hasCallStatements, hasFlowFactIN, hasFlowFactOUT, hasParalleleFlowFactOUT, hasParallelFlowFactIN, invalidateAccessLists, isControlConfined, isRunnableInRegion, makeSymbolsFreeInRWList, printNode, readAntiEdgeDestList, readAntiEdgeSrcList, readDefsInUD, readFlowEdgeDestList, readFlowEdgeSrcList, readNodePhaseInfo, readOutputEdgeDestList, readOutputEdgeSrcList, readReachingDefinitions, readRegionInfo, readUsesInDU, removeAllAnalysisInformation, removeAnalysisInformation, removeExtraScopes, removeFlowFact, removeParallelFlowFact, resetCallSites, setCFGInfoProtected, setCopySourceNode, setFlowFactIN, setFlowFactOUT, setIdNumber, setIN, setInfo, setNode, setOUT, setParallelFlowFactIN, setParallelFlowFactOUT
private java.util.ArrayList<Label> annotatedLabels
public StatementInfo(Node owner)
public java.util.ArrayList<Label> getLabelAnnotations()
hasLabeledAnnotations
or getLabeledAnnotations
on this node.public boolean hasLabelAnnotations()
hasLabeledAnnotations
or getLabeledAnnotations
on this node.public void clearLabelAnnotations()
public boolean removeLabelAnnotation(Label oldLabel)
oldLabel
- the label that has to be removed.public void updateUponLabelRemoval(Label oldLabel)
oldLabel
to a node.
Note that this method does not itself remove the label. It helps in
modeling the scenario where the node has to be removed from its current
position.oldLabel
- a label of the owner node.public java.util.HashSet<Node> adjustSemanticsForLabelRemoval(Label label)
label
from this
statement.removeLabelAnnotation
, which in turn calls
this method.)label
- label that has to be removed from this statement.
Note that this label should be removed only
after the call to this method returns.public void crudeAddLabelAnnotation(Label newLabel)
newLabel
- public void crudeAddLabelAnnotation(int index, Label newLabel)
index
- newLabel
- public void addLabelAnnotation(Label newLabel)
newLabel
- public void addLabelAnnotation(int index, Label newLabel)
index
- newLabel
- public void updateUponLabelAddition(Label newLabel)
newLabel
to a node.
Note that this method does not itself add the label. In general, the
label might already be present in annotatedLabels
of the owner
node, but the node might have been newly added to its new position.newLabel
- a label of the owner node.private static void removeLabelFromAllInSwitch(SwitchStatement enclosingSwitch, Label newLabel)
newLabel
from all the statements in the
enclosingSwitch
.
enclosingSwitch
- a SwitchStatement from which newLabel
has to be
removed.newLabel
- a caseLabel or defaultLabel that needs to be removed from all
the statements in the enclosingSwitch
.private static void removeLabelFromAllInFunction(FunctionDefinition enclosingFunction, Label newLabel)
newLabel
from all the statements in
enclosingFunction
.enclosingFunction
- function from which newLabel
has to be removed.newLabel
- label that has to be removed.public java.util.HashSet<Node> adjustSemanticsForLabelAddition(Label label)
label
to this statement.
This method assumes that any pre-existing labels with the same name
have been removed already.
Currently, this method performs adjustment of semantics represented by
the following data structures:
addLabelAnnotation
,
which in turn calls this method after the addition.)label
- a new label that has been added to the owner node.label
.public java.util.ArrayList<Label> getLabels()
n
(or rather, that of the CFG node that it
wraps).n
.public boolean hasLabels()
n
.