File tree Expand file tree Collapse file tree
cpp/ql/src/semmle/code/cpp/ir/implementation
csharp/ql/src/experimental/ir/implementation Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1645,6 +1645,19 @@ class CallInstruction extends Instruction {
16451645 * Gets the number of arguments of the call, including the `this` pointer, if any.
16461646 */
16471647 final int getNumberOfArguments ( ) { result = count ( this .getAnArgumentOperand ( ) ) }
1648+
1649+ /**
1650+ * Holds if the result is a side effect for the argument at the specified index, or `this` if
1651+ * `index` is `-1`.
1652+ *
1653+ * This helper predicate makes it easy to join on both of these columns at once, avoiding
1654+ * pathological join orders in case the argument index should get joined first.
1655+ */
1656+ pragma [ noinline]
1657+ final SideEffectInstruction getAParameterSideEffect ( int index ) {
1658+ this = result .getPrimaryInstruction ( ) and
1659+ index = result .( IndexedInstruction ) .getIndex ( )
1660+ }
16481661}
16491662
16501663/**
Original file line number Diff line number Diff line change @@ -1645,6 +1645,19 @@ class CallInstruction extends Instruction {
16451645 * Gets the number of arguments of the call, including the `this` pointer, if any.
16461646 */
16471647 final int getNumberOfArguments ( ) { result = count ( this .getAnArgumentOperand ( ) ) }
1648+
1649+ /**
1650+ * Holds if the result is a side effect for the argument at the specified index, or `this` if
1651+ * `index` is `-1`.
1652+ *
1653+ * This helper predicate makes it easy to join on both of these columns at once, avoiding
1654+ * pathological join orders in case the argument index should get joined first.
1655+ */
1656+ pragma [ noinline]
1657+ final SideEffectInstruction getAParameterSideEffect ( int index ) {
1658+ this = result .getPrimaryInstruction ( ) and
1659+ index = result .( IndexedInstruction ) .getIndex ( )
1660+ }
16481661}
16491662
16501663/**
Original file line number Diff line number Diff line change @@ -1645,6 +1645,19 @@ class CallInstruction extends Instruction {
16451645 * Gets the number of arguments of the call, including the `this` pointer, if any.
16461646 */
16471647 final int getNumberOfArguments ( ) { result = count ( this .getAnArgumentOperand ( ) ) }
1648+
1649+ /**
1650+ * Holds if the result is a side effect for the argument at the specified index, or `this` if
1651+ * `index` is `-1`.
1652+ *
1653+ * This helper predicate makes it easy to join on both of these columns at once, avoiding
1654+ * pathological join orders in case the argument index should get joined first.
1655+ */
1656+ pragma [ noinline]
1657+ final SideEffectInstruction getAParameterSideEffect ( int index ) {
1658+ this = result .getPrimaryInstruction ( ) and
1659+ index = result .( IndexedInstruction ) .getIndex ( )
1660+ }
16481661}
16491662
16501663/**
Original file line number Diff line number Diff line change @@ -1645,6 +1645,19 @@ class CallInstruction extends Instruction {
16451645 * Gets the number of arguments of the call, including the `this` pointer, if any.
16461646 */
16471647 final int getNumberOfArguments ( ) { result = count ( this .getAnArgumentOperand ( ) ) }
1648+
1649+ /**
1650+ * Holds if the result is a side effect for the argument at the specified index, or `this` if
1651+ * `index` is `-1`.
1652+ *
1653+ * This helper predicate makes it easy to join on both of these columns at once, avoiding
1654+ * pathological join orders in case the argument index should get joined first.
1655+ */
1656+ pragma [ noinline]
1657+ final SideEffectInstruction getAParameterSideEffect ( int index ) {
1658+ this = result .getPrimaryInstruction ( ) and
1659+ index = result .( IndexedInstruction ) .getIndex ( )
1660+ }
16481661}
16491662
16501663/**
Original file line number Diff line number Diff line change @@ -1645,6 +1645,19 @@ class CallInstruction extends Instruction {
16451645 * Gets the number of arguments of the call, including the `this` pointer, if any.
16461646 */
16471647 final int getNumberOfArguments ( ) { result = count ( this .getAnArgumentOperand ( ) ) }
1648+
1649+ /**
1650+ * Holds if the result is a side effect for the argument at the specified index, or `this` if
1651+ * `index` is `-1`.
1652+ *
1653+ * This helper predicate makes it easy to join on both of these columns at once, avoiding
1654+ * pathological join orders in case the argument index should get joined first.
1655+ */
1656+ pragma [ noinline]
1657+ final SideEffectInstruction getAParameterSideEffect ( int index ) {
1658+ this = result .getPrimaryInstruction ( ) and
1659+ index = result .( IndexedInstruction ) .getIndex ( )
1660+ }
16481661}
16491662
16501663/**
You can’t perform that action at this time.
0 commit comments