C++: Add an interface for exprs that can contribute to range analysis

This commit is contained in:
lcartey@github.com
2020-07-08 16:00:07 +01:00
parent 993506d781
commit 5c1275ec5d

View File

@@ -0,0 +1,16 @@
/**
* Provides a class for modeling `Expr`s with a restricted range.
*/
import cpp
/**
* An expression for which a range can be deduced.
*/
abstract class RangeAnalysisExpr extends Expr {
/** Gets the lower bound of the expression. */
abstract float getLowerBounds();
/** Gets the upper bound of the expression. */
abstract float getUpperBounds();
/** Holds if this expression depends on the definition `srcDef` for StackVariable `srcVar`. */
predicate dependsOnDef(RangeSsaDefinition srcDef, StackVariable srcVar) { none() }
}