Skip to content

Commit fb1ef07

Browse files
committed
C++: more parameterized modules in range analysis
This makes the modulus analysis and sign analysis into parameterized modules which are instantiated in the main range analysis module, and makes RangeAnalysisSpecific and RangeUtils into parameters to the main range analysis. Some classes also need to be moved and made into `instanceof` extensions because they'd otherwise be extending across parameterized module boundaries.
1 parent c062d5e commit fb1ef07

File tree

7 files changed

+1104
-962
lines changed

7 files changed

+1104
-962
lines changed
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
private import RangeAnalysisStage
2+
3+
module FloatDelta implements DeltaSig {
4+
class Delta = float;
5+
6+
bindingset[d]
7+
bindingset[result]
8+
float toFloat(Delta d) {result = d}
9+
10+
bindingset[d]
11+
bindingset[result]
12+
int toInt(Delta d) {result = d}
13+
14+
15+
bindingset[n]
16+
bindingset[result] Delta fromInt(int n) {result = n}
17+
18+
19+
bindingset[f]
20+
bindingset[result] Delta fromFloat(float f) {result = f}
21+
}
22+

0 commit comments

Comments
 (0)