C++: more semantic range analysis perf tweaks

This commit is contained in:
Robert Marsh
2022-09-01 10:49:54 -04:00
parent b1de54e9aa
commit 35701373ee
2 changed files with 16 additions and 0 deletions

View File

@@ -204,6 +204,7 @@ private class BinarySignExpr extends FlowSignExpr {
}
}
pragma[noinline]
private predicate binaryExprOperands(SemBinaryExpr binary, SemExpr left, SemExpr right) {
binary.getLeftOperand() = left and binary.getRightOperand() = right
}

View File

@@ -6,6 +6,21 @@ import experimental.semmle.code.cpp.semantic.SemanticExprSpecific
import semmle.code.cpp.ir.IR
import semmle.code.cpp.valuenumbering.GlobalValueNumbering
import semmle.code.cpp.models.interfaces.Allocation
import semmle.code.cpp.ir.IRConfiguration
class RangeAnalysisIRConfig extends IRConfiguration {
override predicate shouldCreateIRForFunction(Declaration decl) {
not exists(DeclStmt stmt |
stmt.getEnclosingFunction() = decl and
(
not exists(stmt.getADeclaration())
or
not exists(stmt.getADeclarationEntry())
)
)
}
}
predicate bounded(Instruction i, Bound b, int delta, boolean upper) {
// TODO: reason