File tree Expand file tree Collapse file tree
cpp/ql/src/semmle/code/cpp Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -97,23 +97,27 @@ class SubBasicBlock extends ControlFlowNodeBase {
9797 }
9898
9999 /**
100- * Gets the `pos `th control-flow node in this `SubBasicBlock`. Positions
101- * start from 0, and the node at position 0 always exists and compares equal
100+ * Gets the `index `th control-flow node in this `SubBasicBlock`. Indexes
101+ * start from 0, and the node at index 0 always exists and compares equal
102102 * to `this`.
103103 */
104104 pragma [ nomagic]
105- ControlFlowNode getNode ( int pos ) {
105+ ControlFlowNode getNode ( int index ) {
106106 exists ( BasicBlock bb |
107- exists ( int outerPos |
108- result = bb .getNode ( outerPos ) and
109- pos = outerPosToInnerPos ( bb , outerPos )
107+ exists ( int outerIndex |
108+ result = bb .getNode ( outerIndex ) and
109+ index = outerToInnerIndex ( bb , outerIndex )
110110 )
111111 )
112112 }
113113
114+ /**
115+ * Gets the index of the node in this `SubBasicBlock` that has `indexInBB` in
116+ * `bb`, where `bb` is equal to `getBasicBlock()`.
117+ */
114118 pragma [ nomagic]
115- private int outerPosToInnerPos ( BasicBlock bb , int posInBB ) {
116- posInBB = result + this .getIndexInBasicBlock ( bb ) and
119+ private int outerToInnerIndex ( BasicBlock bb , int indexInBB ) {
120+ indexInBB = result + this .getIndexInBasicBlock ( bb ) and
117121 result = [ 0 .. this .getNumberOfNodes ( ) - 1 ]
118122 }
119123
Original file line number Diff line number Diff line change @@ -97,23 +97,27 @@ class SubBasicBlock extends ControlFlowNodeBase {
9797 }
9898
9999 /**
100- * Gets the `pos `th control-flow node in this `SubBasicBlock`. Positions
101- * start from 0, and the node at position 0 always exists and compares equal
100+ * Gets the `index `th control-flow node in this `SubBasicBlock`. Indexes
101+ * start from 0, and the node at index 0 always exists and compares equal
102102 * to `this`.
103103 */
104104 pragma [ nomagic]
105- ControlFlowNode getNode ( int pos ) {
105+ ControlFlowNode getNode ( int index ) {
106106 exists ( BasicBlock bb |
107- exists ( int outerPos |
108- result = bb .getNode ( outerPos ) and
109- pos = outerPosToInnerPos ( bb , outerPos )
107+ exists ( int outerIndex |
108+ result = bb .getNode ( outerIndex ) and
109+ index = outerToInnerIndex ( bb , outerIndex )
110110 )
111111 )
112112 }
113113
114+ /**
115+ * Gets the index of the node in this `SubBasicBlock` that has `indexInBB` in
116+ * `bb`, where `bb` is equal to `getBasicBlock()`.
117+ */
114118 pragma [ nomagic]
115- private int outerPosToInnerPos ( BasicBlock bb , int posInBB ) {
116- posInBB = result + this .getIndexInBasicBlock ( bb ) and
119+ private int outerToInnerIndex ( BasicBlock bb , int indexInBB ) {
120+ indexInBB = result + this .getIndexInBasicBlock ( bb ) and
117121 result = [ 0 .. this .getNumberOfNodes ( ) - 1 ]
118122 }
119123
You can’t perform that action at this time.
0 commit comments