File tree Expand file tree Collapse file tree 2 files changed +20
-2
lines changed
cpp/ql/src/semmle/code/cpp Expand file tree Collapse file tree 2 files changed +20
-2
lines changed Original file line number Diff line number Diff line change @@ -71,7 +71,7 @@ class SubBasicBlock extends ControlFlowNodeBase {
7171 }
7272
7373 /**
74- * Gets the rank of this `SubBasicBlock` among the other `SubBasicBlock`s in
74+ * Gets the (1-based) rank of this `SubBasicBlock` among the other `SubBasicBlock`s in
7575 * its containing basic block `bb`, where `bb` is equal to `getBasicBlock()`.
7676 */
7777 int getRankInBasicBlock ( BasicBlock bb ) {
@@ -81,6 +81,15 @@ class SubBasicBlock extends ControlFlowNodeBase {
8181 )
8282 }
8383
84+ /**
85+ * DEPRECATED: use `getRankInBasicBlock` instead. Note that this predicate
86+ * returns a 0-based position, while `getRankInBasicBlock` returns a 1-based
87+ * position.
88+ */
89+ deprecated int getPosInBasicBlock ( BasicBlock bb ) {
90+ result = getRankInBasicBlock ( bb ) - 1
91+ }
92+
8493 pragma [ noinline]
8594 private int getIndexInBasicBlock ( BasicBlock bb ) {
8695 this = bb .getNode ( result )
Original file line number Diff line number Diff line change @@ -71,7 +71,7 @@ class SubBasicBlock extends ControlFlowNodeBase {
7171 }
7272
7373 /**
74- * Gets the rank of this `SubBasicBlock` among the other `SubBasicBlock`s in
74+ * Gets the (1-based) rank of this `SubBasicBlock` among the other `SubBasicBlock`s in
7575 * its containing basic block `bb`, where `bb` is equal to `getBasicBlock()`.
7676 */
7777 int getRankInBasicBlock ( BasicBlock bb ) {
@@ -81,6 +81,15 @@ class SubBasicBlock extends ControlFlowNodeBase {
8181 )
8282 }
8383
84+ /**
85+ * DEPRECATED: use `getRankInBasicBlock` instead. Note that this predicate
86+ * returns a 0-based position, while `getRankInBasicBlock` returns a 1-based
87+ * position.
88+ */
89+ deprecated int getPosInBasicBlock ( BasicBlock bb ) {
90+ result = getRankInBasicBlock ( bb ) - 1
91+ }
92+
8493 pragma [ noinline]
8594 private int getIndexInBasicBlock ( BasicBlock bb ) {
8695 this = bb .getNode ( result )
You can’t perform that action at this time.
0 commit comments