Skip to content

Commit 9ee313f

Browse files
committed
C++: Remove code that is now subsumed.
1 parent bf4a84b commit 9ee313f

File tree

1 file changed

+0
-54
lines changed

1 file changed

+0
-54
lines changed

cpp/ql/lib/semmle/code/cpp/controlflow/IRGuards.qll

Lines changed: 0 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -1052,14 +1052,6 @@ private module Cached {
10521052
)
10531053
}
10541054

1055-
private predicate isConvertedBool(Instruction instr) {
1056-
instr.getResultIRType() instanceof IRBooleanType
1057-
or
1058-
isConvertedBool(instr.(ConvertInstruction).getUnary())
1059-
or
1060-
isConvertedBool(instr.(BuiltinExpectCallInstruction).getCondition())
1061-
}
1062-
10631055
/**
10641056
* Holds if `op == k` is `areEqual` given that `test` is equal to `value`.
10651057
*/
@@ -1206,56 +1198,12 @@ private module Cached {
12061198
}
12071199
}
12081200

1209-
/**
1210-
* Holds if `left == right + k` is `areEqual` if `cmp` evaluates to `value`,
1211-
* and `cmp` is an instruction that compares the value of
1212-
* `__builtin_expect(left == right + k, _)` to `0`.
1213-
*/
1214-
private predicate builtin_expect_eq(
1215-
CompareValueNumber cmp, Operand left, Operand right, int k, boolean areEqual,
1216-
AbstractValue value
1217-
) {
1218-
exists(BuiltinExpectCallValueNumber call, Instruction const, AbstractValue innerValue |
1219-
int_value(const) = 0 and
1220-
cmp.hasOperands(call.getAUse(), const.getAUse()) and
1221-
compares_eq(call.getCondition(), left, right, k, areEqual, innerValue)
1222-
|
1223-
cmp instanceof CompareNEValueNumber and
1224-
value = innerValue
1225-
or
1226-
cmp instanceof CompareEQValueNumber and
1227-
value.getDualValue() = innerValue
1228-
)
1229-
}
1230-
12311201
private predicate complex_eq(
12321202
ValueNumber cmp, Operand left, Operand right, int k, boolean areEqual, AbstractValue value
12331203
) {
12341204
sub_eq(cmp, left, right, k, areEqual, value)
12351205
or
12361206
add_eq(cmp, left, right, k, areEqual, value)
1237-
or
1238-
builtin_expect_eq(cmp, left, right, k, areEqual, value)
1239-
}
1240-
1241-
/**
1242-
* Holds if `op == k` is `areEqual` if `cmp` evaluates to `value`, and `cmp` is
1243-
* an instruction that compares the value of `__builtin_expect(op == k, _)` to `0`.
1244-
*/
1245-
private predicate unary_builtin_expect_eq(
1246-
CompareValueNumber cmp, Operand op, int k, boolean areEqual, AbstractValue value
1247-
) {
1248-
exists(BuiltinExpectCallValueNumber call, Instruction const, AbstractValue innerValue |
1249-
int_value(const) = 0 and
1250-
cmp.hasOperands(call.getAUse(), const.getAUse()) and
1251-
unary_compares_eq(call.getCondition(), op, k, areEqual, innerValue)
1252-
|
1253-
cmp instanceof CompareNEValueNumber and
1254-
value = innerValue
1255-
or
1256-
cmp instanceof CompareEQValueNumber and
1257-
value.getDualValue() = innerValue
1258-
)
12591207
}
12601208

12611209
private predicate unary_complex_eq(
@@ -1264,8 +1212,6 @@ private module Cached {
12641212
unary_sub_eq(test, op, k, areEqual, value)
12651213
or
12661214
unary_add_eq(test, op, k, areEqual, value)
1267-
or
1268-
unary_builtin_expect_eq(test, op, k, areEqual, value)
12691215
}
12701216

12711217
/*

0 commit comments

Comments
 (0)