mirror of
https://github.com/github/codeql.git
synced 2026-05-04 05:05:12 +02:00
C++: more semantic range analysis perf tweaks
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user