mirror of
https://github.com/github/codeql.git
synced 2026-05-05 05:35:13 +02:00
C++: remove abstract classes in IR
This commit is contained in:
@@ -46,21 +46,31 @@ class GuardCondition extends Expr {
|
||||
* being short-circuited) then it will only control blocks dominated by the
|
||||
* true (for `&&`) or false (for `||`) branch.
|
||||
*/
|
||||
abstract cached predicate controls(BasicBlock controlled, boolean testIsTrue);
|
||||
cached predicate controls(BasicBlock controlled, boolean testIsTrue) {
|
||||
none()
|
||||
}
|
||||
|
||||
/** Holds if (determined by this guard) `left < right + k` evaluates to `isLessThan` if this expression evaluates to `testIsTrue`. */
|
||||
abstract cached predicate comparesLt(Expr left, Expr right, int k, boolean isLessThan, boolean testIsTrue);
|
||||
cached predicate comparesLt(Expr left, Expr right, int k, boolean isLessThan, boolean testIsTrue) {
|
||||
none()
|
||||
}
|
||||
|
||||
/** Holds if (determined by this guard) `left < right + k` must be `isLessThan` in `block`.
|
||||
If `isLessThan = false` then this implies `left >= right + k`. */
|
||||
abstract cached predicate ensuresLt(Expr left, Expr right, int k, BasicBlock block, boolean isLessThan);
|
||||
cached predicate ensuresLt(Expr left, Expr right, int k, BasicBlock block, boolean isLessThan) {
|
||||
none()
|
||||
}
|
||||
|
||||
/** Holds if (determined by this guard) `left == right + k` evaluates to `areEqual` if this expression evaluates to `testIsTrue`. */
|
||||
abstract cached predicate comparesEq(Expr left, Expr right, int k, boolean areEqual, boolean testIsTrue);
|
||||
cached predicate comparesEq(Expr left, Expr right, int k, boolean areEqual, boolean testIsTrue) {
|
||||
none()
|
||||
}
|
||||
|
||||
/** Holds if (determined by this guard) `left == right + k` must be `areEqual` in `block`.
|
||||
If `areEqual = false` then this implies `left != right + k`. */
|
||||
abstract cached predicate ensuresEq(Expr left, Expr right, int k, BasicBlock block, boolean areEqual);
|
||||
cached predicate ensuresEq(Expr left, Expr right, int k, BasicBlock block, boolean areEqual) {
|
||||
none()
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -980,7 +980,9 @@ class RelationalInstruction extends CompareInstruction {
|
||||
* if the overall instruction evaluates to `true`; for example on
|
||||
* `x <= 20` this is the `20`, and on `y > 0` it is `y`.
|
||||
*/
|
||||
abstract Instruction getGreaterOperand();
|
||||
Instruction getGreaterOperand() {
|
||||
none()
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the operand on the "lesser" (or "lesser-or-equal") side
|
||||
@@ -988,11 +990,15 @@ class RelationalInstruction extends CompareInstruction {
|
||||
* if the overall instruction evaluates to `true`; for example on
|
||||
* `x <= 20` this is `x`, and on `y > 0` it is the `0`.
|
||||
*/
|
||||
abstract Instruction getLesserOperand();
|
||||
Instruction getLesserOperand() {
|
||||
none()
|
||||
}
|
||||
/**
|
||||
* Holds if this relational instruction is strict (is not an "or-equal" instruction).
|
||||
*/
|
||||
abstract predicate isStrict();
|
||||
predicate isStrict() {
|
||||
none()
|
||||
}
|
||||
}
|
||||
|
||||
class CompareLTInstruction extends RelationalInstruction {
|
||||
|
||||
@@ -980,7 +980,9 @@ class RelationalInstruction extends CompareInstruction {
|
||||
* if the overall instruction evaluates to `true`; for example on
|
||||
* `x <= 20` this is the `20`, and on `y > 0` it is `y`.
|
||||
*/
|
||||
abstract Instruction getGreaterOperand();
|
||||
Instruction getGreaterOperand() {
|
||||
none()
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the operand on the "lesser" (or "lesser-or-equal") side
|
||||
@@ -988,11 +990,15 @@ class RelationalInstruction extends CompareInstruction {
|
||||
* if the overall instruction evaluates to `true`; for example on
|
||||
* `x <= 20` this is `x`, and on `y > 0` it is the `0`.
|
||||
*/
|
||||
abstract Instruction getLesserOperand();
|
||||
Instruction getLesserOperand() {
|
||||
none()
|
||||
}
|
||||
/**
|
||||
* Holds if this relational instruction is strict (is not an "or-equal" instruction).
|
||||
*/
|
||||
abstract predicate isStrict();
|
||||
predicate isStrict() {
|
||||
none()
|
||||
}
|
||||
}
|
||||
|
||||
class CompareLTInstruction extends RelationalInstruction {
|
||||
|
||||
@@ -980,7 +980,9 @@ class RelationalInstruction extends CompareInstruction {
|
||||
* if the overall instruction evaluates to `true`; for example on
|
||||
* `x <= 20` this is the `20`, and on `y > 0` it is `y`.
|
||||
*/
|
||||
abstract Instruction getGreaterOperand();
|
||||
Instruction getGreaterOperand() {
|
||||
none()
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the operand on the "lesser" (or "lesser-or-equal") side
|
||||
@@ -988,11 +990,15 @@ class RelationalInstruction extends CompareInstruction {
|
||||
* if the overall instruction evaluates to `true`; for example on
|
||||
* `x <= 20` this is `x`, and on `y > 0` it is the `0`.
|
||||
*/
|
||||
abstract Instruction getLesserOperand();
|
||||
Instruction getLesserOperand() {
|
||||
none()
|
||||
}
|
||||
/**
|
||||
* Holds if this relational instruction is strict (is not an "or-equal" instruction).
|
||||
*/
|
||||
abstract predicate isStrict();
|
||||
predicate isStrict() {
|
||||
none()
|
||||
}
|
||||
}
|
||||
|
||||
class CompareLTInstruction extends RelationalInstruction {
|
||||
|
||||
Reference in New Issue
Block a user