svf-tools 1.0.802 → 1.0.804
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/SVF-doxygen/html/BreakConstantExpr_8cpp.html +109 -14
- package/SVF-doxygen/html/BreakConstantExpr_8cpp_source.html +188 -141
- package/SVF-doxygen/html/BreakConstantExpr_8h_source.html +1 -1
- package/SVF-doxygen/html/IntervalValue_8h.html +0 -4
- package/SVF-doxygen/html/IntervalValue_8h_source.html +354 -302
- package/SVF-doxygen/html/LLVMModule_8cpp_source.html +1 -1
- package/SVF-doxygen/html/MSSAMuChi_8h_source.html +1 -1
- package/SVF-doxygen/html/MemRegion_8cpp_source.html +1 -1
- package/SVF-doxygen/html/PointsTo_8cpp_source.html +2 -2
- package/SVF-doxygen/html/PointsTo_8h_source.html +2 -2
- package/SVF-doxygen/html/SVFType_8cpp_source.html +1 -1
- package/SVF-doxygen/html/SVFType_8h_source.html +1 -1
- package/SVF-doxygen/html/SVFValue_8h_source.html +1 -1
- package/SVF-doxygen/html/SparseBitVector_8h_source.html +2 -2
- package/SVF-doxygen/html/classSVF_1_1BreakConstantGEPs.html +102 -101
- package/SVF-doxygen/html/classSVF_1_1LLVMModuleSet.html +1 -1
- package/SVF-doxygen/html/fastcluster__dm_8cpp_8inc_source.html +1 -1
- package/SVF-doxygen/html/globals_func_h.html +6 -0
- package/SVF-doxygen/html/globals_h.html +6 -0
- package/SVF-doxygen/html/namespaceSVF.html +330 -294
- package/SVF-doxygen/html/search/all_10.js +324 -324
- package/SVF-doxygen/html/search/all_11.js +222 -222
- package/SVF-doxygen/html/search/all_12.js +542 -542
- package/SVF-doxygen/html/search/all_13.js +191 -191
- package/SVF-doxygen/html/search/all_14.js +67 -67
- package/SVF-doxygen/html/search/all_15.js +170 -170
- package/SVF-doxygen/html/search/all_16.js +63 -63
- package/SVF-doxygen/html/search/all_17.js +1 -1
- package/SVF-doxygen/html/search/all_18.js +1 -1
- package/SVF-doxygen/html/search/all_19.js +11 -11
- package/SVF-doxygen/html/search/all_1a.js +172 -172
- package/SVF-doxygen/html/search/all_8.js +135 -133
- package/SVF-doxygen/html/search/all_9.js +610 -610
- package/SVF-doxygen/html/search/all_a.js +46 -46
- package/SVF-doxygen/html/search/all_b.js +26 -26
- package/SVF-doxygen/html/search/all_c.js +116 -116
- package/SVF-doxygen/html/search/all_d.js +196 -196
- package/SVF-doxygen/html/search/all_e.js +207 -207
- package/SVF-doxygen/html/search/all_f.js +116 -116
- package/SVF-doxygen/html/search/classes_0.js +26 -26
- package/SVF-doxygen/html/search/classes_1.js +9 -9
- package/SVF-doxygen/html/search/classes_10.js +73 -73
- package/SVF-doxygen/html/search/classes_11.js +15 -15
- package/SVF-doxygen/html/search/classes_12.js +2 -2
- package/SVF-doxygen/html/search/classes_13.js +10 -10
- package/SVF-doxygen/html/search/classes_14.js +14 -14
- package/SVF-doxygen/html/search/classes_15.js +1 -1
- package/SVF-doxygen/html/search/classes_2.js +80 -80
- package/SVF-doxygen/html/search/classes_3.js +37 -37
- package/SVF-doxygen/html/search/classes_4.js +9 -9
- package/SVF-doxygen/html/search/classes_5.js +28 -28
- package/SVF-doxygen/html/search/classes_6.js +104 -104
- package/SVF-doxygen/html/search/classes_7.js +33 -33
- package/SVF-doxygen/html/search/classes_8.js +56 -56
- package/SVF-doxygen/html/search/classes_9.js +1 -1
- package/SVF-doxygen/html/search/classes_a.js +12 -12
- package/SVF-doxygen/html/search/classes_b.js +29 -29
- package/SVF-doxygen/html/search/classes_c.js +6 -6
- package/SVF-doxygen/html/search/classes_d.js +18 -18
- package/SVF-doxygen/html/search/classes_e.js +36 -36
- package/SVF-doxygen/html/search/classes_f.js +25 -25
- package/SVF-doxygen/html/search/defines_0.js +3 -3
- package/SVF-doxygen/html/search/defines_1.js +2 -2
- package/SVF-doxygen/html/search/defines_2.js +30 -30
- package/SVF-doxygen/html/search/defines_3.js +21 -21
- package/SVF-doxygen/html/search/defines_4.js +2 -2
- package/SVF-doxygen/html/search/defines_5.js +4 -4
- package/SVF-doxygen/html/search/defines_6.js +2 -2
- package/SVF-doxygen/html/search/defines_7.js +5 -5
- package/SVF-doxygen/html/search/defines_8.js +11 -11
- package/SVF-doxygen/html/search/defines_9.js +9 -9
- package/SVF-doxygen/html/search/defines_a.js +2 -2
- package/SVF-doxygen/html/search/defines_b.js +1 -1
- package/SVF-doxygen/html/search/defines_c.js +3 -3
- package/SVF-doxygen/html/search/defines_d.js +2 -2
- package/SVF-doxygen/html/search/defines_e.js +7 -7
- package/SVF-doxygen/html/search/defines_f.js +3 -3
- package/SVF-doxygen/html/search/enums_0.js +3 -3
- package/SVF-doxygen/html/search/enums_1.js +2 -2
- package/SVF-doxygen/html/search/enums_10.js +1 -1
- package/SVF-doxygen/html/search/enums_11.js +1 -1
- package/SVF-doxygen/html/search/enums_2.js +8 -8
- package/SVF-doxygen/html/search/enums_3.js +1 -1
- package/SVF-doxygen/html/search/enums_4.js +3 -3
- package/SVF-doxygen/html/search/enums_5.js +1 -1
- package/SVF-doxygen/html/search/enums_6.js +2 -2
- package/SVF-doxygen/html/search/enums_7.js +2 -2
- package/SVF-doxygen/html/search/enums_8.js +4 -4
- package/SVF-doxygen/html/search/enums_9.js +1 -1
- package/SVF-doxygen/html/search/enums_a.js +1 -1
- package/SVF-doxygen/html/search/enums_b.js +7 -7
- package/SVF-doxygen/html/search/enums_c.js +1 -1
- package/SVF-doxygen/html/search/enums_d.js +4 -4
- package/SVF-doxygen/html/search/enums_e.js +2 -2
- package/SVF-doxygen/html/search/enums_f.js +4 -4
- package/SVF-doxygen/html/search/enumvalues_0.js +14 -14
- package/SVF-doxygen/html/search/enumvalues_1.js +14 -14
- package/SVF-doxygen/html/search/enumvalues_10.js +35 -35
- package/SVF-doxygen/html/search/enumvalues_11.js +3 -3
- package/SVF-doxygen/html/search/enumvalues_12.js +10 -10
- package/SVF-doxygen/html/search/enumvalues_13.js +1 -1
- package/SVF-doxygen/html/search/enumvalues_14.js +1 -1
- package/SVF-doxygen/html/search/enumvalues_15.js +3 -3
- package/SVF-doxygen/html/search/enumvalues_2.js +36 -36
- package/SVF-doxygen/html/search/enumvalues_3.js +13 -13
- package/SVF-doxygen/html/search/enumvalues_4.js +2 -2
- package/SVF-doxygen/html/search/enumvalues_5.js +47 -47
- package/SVF-doxygen/html/search/enumvalues_6.js +6 -6
- package/SVF-doxygen/html/search/enumvalues_7.js +9 -9
- package/SVF-doxygen/html/search/enumvalues_8.js +23 -23
- package/SVF-doxygen/html/search/enumvalues_9.js +6 -6
- package/SVF-doxygen/html/search/enumvalues_a.js +15 -15
- package/SVF-doxygen/html/search/enumvalues_b.js +11 -11
- package/SVF-doxygen/html/search/enumvalues_c.js +5 -5
- package/SVF-doxygen/html/search/enumvalues_d.js +18 -18
- package/SVF-doxygen/html/search/enumvalues_e.js +9 -9
- package/SVF-doxygen/html/search/enumvalues_f.js +45 -45
- package/SVF-doxygen/html/search/files_0.js +13 -13
- package/SVF-doxygen/html/search/files_1.js +7 -7
- package/SVF-doxygen/html/search/files_10.js +8 -8
- package/SVF-doxygen/html/search/files_11.js +8 -8
- package/SVF-doxygen/html/search/files_12.js +2 -2
- package/SVF-doxygen/html/search/files_2.js +55 -55
- package/SVF-doxygen/html/search/files_3.js +14 -14
- package/SVF-doxygen/html/search/files_4.js +5 -5
- package/SVF-doxygen/html/search/files_5.js +13 -13
- package/SVF-doxygen/html/search/files_6.js +9 -9
- package/SVF-doxygen/html/search/files_7.js +14 -14
- package/SVF-doxygen/html/search/files_8.js +13 -13
- package/SVF-doxygen/html/search/files_9.js +18 -18
- package/SVF-doxygen/html/search/files_a.js +3 -3
- package/SVF-doxygen/html/search/files_b.js +2 -2
- package/SVF-doxygen/html/search/files_c.js +20 -20
- package/SVF-doxygen/html/search/files_d.js +4 -4
- package/SVF-doxygen/html/search/files_e.js +62 -62
- package/SVF-doxygen/html/search/files_f.js +8 -8
- package/SVF-doxygen/html/search/functions_0.js +12 -12
- package/SVF-doxygen/html/search/functions_1.js +359 -359
- package/SVF-doxygen/html/search/functions_10.js +140 -140
- package/SVF-doxygen/html/search/functions_11.js +138 -138
- package/SVF-doxygen/html/search/functions_12.js +277 -277
- package/SVF-doxygen/html/search/functions_13.js +59 -59
- package/SVF-doxygen/html/search/functions_14.js +39 -39
- package/SVF-doxygen/html/search/functions_15.js +71 -71
- package/SVF-doxygen/html/search/functions_16.js +32 -32
- package/SVF-doxygen/html/search/functions_17.js +3 -3
- package/SVF-doxygen/html/search/functions_18.js +172 -172
- package/SVF-doxygen/html/search/functions_2.js +86 -86
- package/SVF-doxygen/html/search/functions_3.js +257 -257
- package/SVF-doxygen/html/search/functions_4.js +75 -75
- package/SVF-doxygen/html/search/functions_5.js +53 -53
- package/SVF-doxygen/html/search/functions_6.js +59 -59
- package/SVF-doxygen/html/search/functions_7.js +851 -851
- package/SVF-doxygen/html/search/functions_8.js +148 -146
- package/SVF-doxygen/html/search/functions_9.js +428 -428
- package/SVF-doxygen/html/search/functions_a.js +30 -30
- package/SVF-doxygen/html/search/functions_b.js +2 -2
- package/SVF-doxygen/html/search/functions_c.js +26 -26
- package/SVF-doxygen/html/search/functions_d.js +77 -77
- package/SVF-doxygen/html/search/functions_e.js +35 -35
- package/SVF-doxygen/html/search/functions_f.js +56 -56
- package/SVF-doxygen/html/search/namespaces_0.js +1 -1
- package/SVF-doxygen/html/search/namespaces_1.js +7 -7
- package/SVF-doxygen/html/search/related_0.js +2 -2
- package/SVF-doxygen/html/search/related_1.js +2 -2
- package/SVF-doxygen/html/search/related_2.js +2 -2
- package/SVF-doxygen/html/search/related_3.js +2 -2
- package/SVF-doxygen/html/search/related_4.js +2 -2
- package/SVF-doxygen/html/search/related_5.js +1 -1
- package/SVF-doxygen/html/search/related_6.js +2 -2
- package/SVF-doxygen/html/search/related_7.js +4 -4
- package/SVF-doxygen/html/search/related_8.js +2 -2
- package/SVF-doxygen/html/search/related_9.js +4 -4
- package/SVF-doxygen/html/search/related_a.js +19 -19
- package/SVF-doxygen/html/search/related_b.js +4 -4
- package/SVF-doxygen/html/search/related_c.js +1 -1
- package/SVF-doxygen/html/search/related_d.js +11 -11
- package/SVF-doxygen/html/search/related_e.js +2 -2
- package/SVF-doxygen/html/search/related_f.js +2 -2
- package/SVF-doxygen/html/search/typedefs_0.js +18 -18
- package/SVF-doxygen/html/search/typedefs_1.js +26 -26
- package/SVF-doxygen/html/search/typedefs_10.js +61 -61
- package/SVF-doxygen/html/search/typedefs_11.js +13 -13
- package/SVF-doxygen/html/search/typedefs_12.js +11 -11
- package/SVF-doxygen/html/search/typedefs_13.js +35 -35
- package/SVF-doxygen/html/search/typedefs_14.js +8 -8
- package/SVF-doxygen/html/search/typedefs_2.js +129 -129
- package/SVF-doxygen/html/search/typedefs_3.js +39 -39
- package/SVF-doxygen/html/search/typedefs_4.js +17 -17
- package/SVF-doxygen/html/search/typedefs_5.js +41 -41
- package/SVF-doxygen/html/search/typedefs_6.js +55 -55
- package/SVF-doxygen/html/search/typedefs_7.js +42 -42
- package/SVF-doxygen/html/search/typedefs_8.js +1 -1
- package/SVF-doxygen/html/search/typedefs_9.js +6 -6
- package/SVF-doxygen/html/search/typedefs_a.js +29 -29
- package/SVF-doxygen/html/search/typedefs_b.js +29 -29
- package/SVF-doxygen/html/search/typedefs_c.js +41 -41
- package/SVF-doxygen/html/search/typedefs_d.js +15 -15
- package/SVF-doxygen/html/search/typedefs_e.js +52 -52
- package/SVF-doxygen/html/search/typedefs_f.js +14 -14
- package/SVF-doxygen/html/search/variables_0.js +151 -151
- package/SVF-doxygen/html/search/variables_1.js +75 -75
- package/SVF-doxygen/html/search/variables_10.js +97 -97
- package/SVF-doxygen/html/search/variables_11.js +44 -44
- package/SVF-doxygen/html/search/variables_12.js +92 -92
- package/SVF-doxygen/html/search/variables_13.js +75 -75
- package/SVF-doxygen/html/search/variables_14.js +14 -14
- package/SVF-doxygen/html/search/variables_15.js +48 -48
- package/SVF-doxygen/html/search/variables_16.js +9 -9
- package/SVF-doxygen/html/search/variables_17.js +1 -1
- package/SVF-doxygen/html/search/variables_18.js +2 -2
- package/SVF-doxygen/html/search/variables_2.js +37 -37
- package/SVF-doxygen/html/search/variables_3.js +142 -142
- package/SVF-doxygen/html/search/variables_4.js +55 -55
- package/SVF-doxygen/html/search/variables_5.js +36 -36
- package/SVF-doxygen/html/search/variables_6.js +66 -66
- package/SVF-doxygen/html/search/variables_7.js +33 -33
- package/SVF-doxygen/html/search/variables_8.js +7 -7
- package/SVF-doxygen/html/search/variables_9.js +77 -77
- package/SVF-doxygen/html/search/variables_a.js +4 -4
- package/SVF-doxygen/html/search/variables_b.js +10 -10
- package/SVF-doxygen/html/search/variables_c.js +45 -45
- package/SVF-doxygen/html/search/variables_d.js +56 -56
- package/SVF-doxygen/html/search/variables_e.js +123 -123
- package/SVF-doxygen/html/search/variables_f.js +30 -30
- package/package.json +1 -1
- package/svf/include/AbstractExecution/IntervalValue.h +74 -26
- package/svf-llvm/lib/BreakConstantExpr.cpp +53 -9
|
@@ -577,74 +577,100 @@ inline IntervalValue operator%(const IntervalValue &lhs,
|
|
|
577
577
|
}
|
|
578
578
|
}
|
|
579
579
|
|
|
580
|
-
|
|
580
|
+
// Compare two IntervalValues for greater than
|
|
581
581
|
inline IntervalValue operator>(const IntervalValue &lhs, const IntervalValue &rhs)
|
|
582
582
|
{
|
|
583
|
+
// If either lhs or rhs is bottom, the result is bottom
|
|
583
584
|
if (lhs.isBottom() || rhs.isBottom())
|
|
584
585
|
{
|
|
585
586
|
return IntervalValue::bottom();
|
|
586
587
|
}
|
|
587
|
-
|
|
588
|
+
// If either lhs or rhs is top, the result is top
|
|
589
|
+
else if (lhs.isTop() || rhs.isTop())
|
|
588
590
|
{
|
|
589
591
|
return IntervalValue::top();
|
|
590
592
|
}
|
|
591
593
|
else
|
|
592
594
|
{
|
|
595
|
+
// If both lhs and rhs are numerals (lb = ub), directly compare their values
|
|
593
596
|
if (lhs.is_numeral() && rhs.is_numeral())
|
|
594
597
|
{
|
|
598
|
+
// It means lhs.lb() > rhs.lb()? true: false
|
|
595
599
|
return lhs.lb().leq(rhs.lb()) ? IntervalValue(0, 0) : IntervalValue(1, 1);
|
|
596
600
|
}
|
|
597
601
|
else
|
|
598
602
|
{
|
|
599
|
-
//
|
|
603
|
+
// Return [1,1] means lhs is totally greater than rhs
|
|
604
|
+
// When lhs.lb > rhs.ub, e.g., lhs:[3, 4] rhs:[1, 2]
|
|
605
|
+
// lhs.lb(3) > rhs.ub(2)
|
|
606
|
+
// It means lhs.lb() > rhs.ub()
|
|
600
607
|
if (!lhs.lb().leq(rhs.ub()))
|
|
601
608
|
{
|
|
602
609
|
return IntervalValue(1, 1);
|
|
603
|
-
// lhs[1,2] rhs[3,4]
|
|
604
610
|
}
|
|
605
|
-
|
|
611
|
+
// Return [0,0] means lhs is totally impossible to be greater than rhs
|
|
612
|
+
// i.e., lhs is totally less than or equal to rhs
|
|
613
|
+
// When lhs.ub <= rhs.lb, e.g., lhs:[3, 4] rhs:[4,5]
|
|
614
|
+
// lhs.ub(4) <= rhs.lb(4)
|
|
615
|
+
else if (lhs.ub().leq(rhs.lb()))
|
|
606
616
|
{
|
|
607
617
|
return IntervalValue(0, 0);
|
|
608
618
|
}
|
|
619
|
+
// For other cases, lhs can be greater than or not, depending on the values
|
|
620
|
+
// e.g., lhs: [2,4], rhs: [1,3],
|
|
621
|
+
// lhs can be greater than rhs if lhs is 4 and rhs is 1.
|
|
622
|
+
// lhs can also not be greater than rhs if lhs is 2 and rhs is 3
|
|
609
623
|
else
|
|
610
624
|
{
|
|
611
|
-
// lhs[1,3] rhs[2,4]
|
|
612
625
|
return IntervalValue(0, 1);
|
|
613
626
|
}
|
|
614
627
|
}
|
|
615
628
|
}
|
|
616
629
|
}
|
|
617
630
|
|
|
618
|
-
|
|
631
|
+
// Compare two IntervalValues for less than
|
|
619
632
|
inline IntervalValue operator<(const IntervalValue &lhs, const IntervalValue &rhs)
|
|
620
633
|
{
|
|
634
|
+
// If either lhs or rhs is bottom, the result is bottom
|
|
621
635
|
if (lhs.isBottom() || rhs.isBottom())
|
|
622
636
|
{
|
|
623
637
|
return IntervalValue::bottom();
|
|
624
638
|
}
|
|
625
|
-
|
|
639
|
+
// If either lhs or rhs is top, the result is top
|
|
640
|
+
else if (lhs.isTop() || rhs.isTop())
|
|
626
641
|
{
|
|
627
642
|
return IntervalValue::top();
|
|
628
643
|
}
|
|
629
644
|
else
|
|
630
645
|
{
|
|
646
|
+
// If both lhs and rhs are numerals (lb = ub), directly compare their values
|
|
631
647
|
if (lhs.is_numeral() && rhs.is_numeral())
|
|
632
648
|
{
|
|
649
|
+
// It means lhs.lb() < rhs.lb()? true: false
|
|
633
650
|
return lhs.lb().geq(rhs.lb()) ? IntervalValue(0, 0) : IntervalValue(1, 1);
|
|
634
651
|
}
|
|
635
652
|
else
|
|
636
653
|
{
|
|
637
|
-
//
|
|
654
|
+
// Return [1,1] means lhs is totally less than rhs
|
|
655
|
+
// When lhs.ub < rhs.lb, e.g., lhs:[1, 2] rhs:[3, 4]
|
|
656
|
+
// lhs.ub(2) < rhs.lb(3)
|
|
657
|
+
// It means lhs.ub() < rhs.lb()
|
|
638
658
|
if (!lhs.ub().geq(rhs.lb()))
|
|
639
659
|
{
|
|
640
660
|
return IntervalValue(1, 1);
|
|
641
|
-
// lhs [3,4] rhs [1,2]
|
|
642
661
|
}
|
|
643
|
-
|
|
662
|
+
// Return [0,0] means lhs is totally impossible to be less than rhs
|
|
663
|
+
// i.e., lhs is totally greater than or equal to rhs
|
|
664
|
+
// When lhs.ub >= rhs.lb, e.g., lhs:[3, 4] rhs:[4,5]
|
|
665
|
+
// lhs.ub(4) >= rhs.lb(4)
|
|
666
|
+
else if (rhs.ub().geq(lhs.lb()))
|
|
644
667
|
{
|
|
645
668
|
return IntervalValue(0, 0);
|
|
646
|
-
// lhs [1,3] rhs [2,4]
|
|
647
669
|
}
|
|
670
|
+
// For other cases, lhs can be less than rhs or not, depending on the values
|
|
671
|
+
// e.g., lhs: [2,4], rhs: [1,3],
|
|
672
|
+
// lhs can be less than rhs if lhs is 2, rhs is 3.
|
|
673
|
+
// lhs can also not be less than rhs if lhs is 4 and rhs is 1
|
|
648
674
|
else
|
|
649
675
|
{
|
|
650
676
|
return IntervalValue(0, 1);
|
|
@@ -654,79 +680,101 @@ inline IntervalValue operator<(const IntervalValue &lhs, const IntervalValue &rh
|
|
|
654
680
|
}
|
|
655
681
|
|
|
656
682
|
|
|
657
|
-
|
|
683
|
+
// Compare two IntervalValues for greater than or equal to
|
|
658
684
|
inline IntervalValue operator>=(const IntervalValue &lhs, const IntervalValue &rhs)
|
|
659
685
|
{
|
|
686
|
+
// If either lhs or rhs is bottom, the result is bottom
|
|
660
687
|
if (lhs.isBottom() || rhs.isBottom())
|
|
661
688
|
{
|
|
662
689
|
return IntervalValue::bottom();
|
|
663
690
|
}
|
|
664
|
-
|
|
691
|
+
// If either lhs or rhs is top, the result is top
|
|
692
|
+
else if (lhs.isTop() || rhs.isTop())
|
|
665
693
|
{
|
|
666
694
|
return IntervalValue::top();
|
|
667
695
|
}
|
|
668
696
|
else
|
|
669
697
|
{
|
|
698
|
+
// If both lhs and rhs are numerals (lb = ub), directly compare their values
|
|
670
699
|
if (lhs.is_numeral() && rhs.is_numeral())
|
|
671
700
|
{
|
|
672
701
|
return lhs.lb().geq(rhs.lb()) ? IntervalValue(1, 1) : IntervalValue(0, 0);
|
|
673
702
|
}
|
|
674
703
|
else
|
|
675
704
|
{
|
|
676
|
-
//
|
|
705
|
+
// Return [1,1] means lhs is totally greater than or equal to rhs
|
|
706
|
+
// When lhs.lb >= rhs.ub, e.g., lhs:[2, 3] rhs:[1, 2]
|
|
707
|
+
// lhs.lb(2) >= rhs.ub(2)
|
|
677
708
|
if (lhs.lb().geq(rhs.ub()))
|
|
678
709
|
{
|
|
679
710
|
return IntervalValue(1, 1);
|
|
680
|
-
// lhs [1,2] rhs[3,4]
|
|
681
711
|
}
|
|
712
|
+
// Return [0,0] means lhs is totally impossible to be greater than or equal to rhs
|
|
713
|
+
// i.e., lhs is totally less than rhs
|
|
714
|
+
// When lhs.ub < rhs.lb, e.g., lhs:[1, 2] rhs:[3, 4]
|
|
715
|
+
// lhs.ub(2) < rhs.lb(3)
|
|
716
|
+
// It means lhs.ub() < rhs.lb()
|
|
682
717
|
else if (!lhs.ub().geq(rhs.lb()))
|
|
683
718
|
{
|
|
684
719
|
return IntervalValue(0, 0);
|
|
685
|
-
// lhs [1,3] rhs [2,4]
|
|
686
720
|
}
|
|
721
|
+
// For other cases, lhs can be greater than or equal to rhs or not, depending on the values
|
|
722
|
+
// e.g., lhs: [2,4], rhs: [1,3],
|
|
723
|
+
// lhs can be greater than or equal to rhs if lhs is 3, rhs is 2.
|
|
724
|
+
// lhs can also not be greater than or equal to rhs if lhs is 2 and rhs is 3
|
|
687
725
|
else
|
|
688
726
|
{
|
|
689
|
-
|
|
690
|
-
else return IntervalValue(0, 1);
|
|
727
|
+
return IntervalValue(0, 1);
|
|
691
728
|
}
|
|
692
729
|
}
|
|
693
730
|
}
|
|
694
731
|
}
|
|
695
732
|
|
|
696
|
-
|
|
733
|
+
// Compare two IntervalValues for less than or equal to
|
|
697
734
|
inline IntervalValue operator<=(const IntervalValue &lhs, const IntervalValue &rhs)
|
|
698
735
|
{
|
|
736
|
+
// If either lhs or rhs is bottom, the result is bottom
|
|
699
737
|
if (lhs.isBottom() || rhs.isBottom())
|
|
700
738
|
{
|
|
701
739
|
return IntervalValue::bottom();
|
|
702
740
|
}
|
|
703
|
-
|
|
741
|
+
// If either lhs or rhs is top, the result is top
|
|
742
|
+
else if (lhs.isTop() || rhs.isTop())
|
|
704
743
|
{
|
|
705
744
|
return IntervalValue::top();
|
|
706
745
|
}
|
|
707
746
|
else
|
|
708
747
|
{
|
|
748
|
+
// If both lhs and rhs are numerals (lb = ub), directly compare their values
|
|
709
749
|
if (lhs.is_numeral() && rhs.is_numeral())
|
|
710
750
|
{
|
|
711
751
|
return lhs.lb().leq(rhs.lb()) ? IntervalValue(1, 1) : IntervalValue(0, 0);
|
|
712
752
|
}
|
|
713
753
|
else
|
|
714
754
|
{
|
|
715
|
-
//
|
|
755
|
+
// Return [1,1] means lhs is totally less than or equal to rhs
|
|
756
|
+
// When lhs.ub <= rhs.lb, e.g., lhs:[1, 2] rhs:[2, 3]
|
|
757
|
+
// lhs.ub(2) <= rhs.lb(2)
|
|
716
758
|
if (lhs.ub().leq(rhs.lb()))
|
|
717
759
|
{
|
|
718
760
|
return IntervalValue(1, 1);
|
|
719
|
-
// lhs [3,4] rhs[1,2]
|
|
720
761
|
}
|
|
762
|
+
// Return [0,0] means lhs is totally impossible to be less than or equal to rhs
|
|
763
|
+
// i.e., lhs is totally greater than rhs
|
|
764
|
+
// When lhs.lb > rhs.ub, e.g., lhs:[3, 4] rhs:[1, 2]
|
|
765
|
+
// lhs.lb(3) > rhs.ub(2)
|
|
766
|
+
// It means lhs.lb() > rhs.ub()
|
|
721
767
|
else if (!lhs.lb().leq(rhs.ub()))
|
|
722
768
|
{
|
|
723
769
|
return IntervalValue(0, 0);
|
|
724
|
-
// lhs [1,3] rhs [2,4]
|
|
725
770
|
}
|
|
771
|
+
// For other cases, lhs can be less than or equal to rhs or not, depending on the values
|
|
772
|
+
// e.g., lhs: [2,4], rhs: [1,3],
|
|
773
|
+
// lhs can be less than or equal to rhs if lhs is 3, rhs is 3.
|
|
774
|
+
// lhs can also not be less than or equal to rhs if lhs is 3 and rhs is 2
|
|
726
775
|
else
|
|
727
776
|
{
|
|
728
|
-
|
|
729
|
-
else return IntervalValue(0, 1);
|
|
777
|
+
return IntervalValue(0, 1);
|
|
730
778
|
}
|
|
731
779
|
}
|
|
732
780
|
}
|
|
@@ -94,7 +94,7 @@ hasConstantGEP (Value* V)
|
|
|
94
94
|
}
|
|
95
95
|
else
|
|
96
96
|
{
|
|
97
|
-
for (
|
|
97
|
+
for (u32_t index = 0; index < CE->getNumOperands(); ++index)
|
|
98
98
|
{
|
|
99
99
|
if (hasConstantGEP (CE->getOperand(index)))
|
|
100
100
|
return CE;
|
|
@@ -102,7 +102,51 @@ hasConstantGEP (Value* V)
|
|
|
102
102
|
}
|
|
103
103
|
}
|
|
104
104
|
|
|
105
|
-
return
|
|
105
|
+
return nullptr;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
// Description:
|
|
109
|
+
// This function determines whether the given value is a constant expression
|
|
110
|
+
// that has a constant binary or unary operator expression embedded within it.
|
|
111
|
+
static ConstantExpr *
|
|
112
|
+
hasConstantBinaryOrUnaryOp (Value* V)
|
|
113
|
+
{
|
|
114
|
+
if (ConstantExpr * CE = SVFUtil::dyn_cast<ConstantExpr>(V))
|
|
115
|
+
{
|
|
116
|
+
if (Instruction::isBinaryOp(CE->getOpcode()) || Instruction::isUnaryOp(CE->getOpcode()))
|
|
117
|
+
{
|
|
118
|
+
return CE;
|
|
119
|
+
}
|
|
120
|
+
else
|
|
121
|
+
{
|
|
122
|
+
for (u32_t index = 0; index < CE->getNumOperands(); ++index)
|
|
123
|
+
{
|
|
124
|
+
if (hasConstantBinaryOrUnaryOp (CE->getOperand(index)))
|
|
125
|
+
return CE;
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
return nullptr;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
// Description:
|
|
134
|
+
// Return true if this is a constant Gep or binaryOp or UnaryOp expression
|
|
135
|
+
static ConstantExpr *
|
|
136
|
+
hasConstantExpr (Value* V)
|
|
137
|
+
{
|
|
138
|
+
if (ConstantExpr * gep = hasConstantGEP(V))
|
|
139
|
+
{
|
|
140
|
+
return gep;
|
|
141
|
+
}
|
|
142
|
+
else if (ConstantExpr * buop = hasConstantBinaryOrUnaryOp(V))
|
|
143
|
+
{
|
|
144
|
+
return buop;
|
|
145
|
+
}
|
|
146
|
+
else
|
|
147
|
+
{
|
|
148
|
+
return nullptr;
|
|
149
|
+
}
|
|
106
150
|
}
|
|
107
151
|
|
|
108
152
|
|
|
@@ -160,9 +204,9 @@ BreakConstantGEPs::runOnModule (Module & module)
|
|
|
160
204
|
// expression GEP, insert an instruction GEP before the instruction.
|
|
161
205
|
//
|
|
162
206
|
Instruction* I = &(*i);
|
|
163
|
-
for (
|
|
207
|
+
for (u32_t index = 0; index < I->getNumOperands(); ++index)
|
|
164
208
|
{
|
|
165
|
-
if (
|
|
209
|
+
if (hasConstantExpr(I->getOperand(index)))
|
|
166
210
|
{
|
|
167
211
|
Worklist.push_back (I);
|
|
168
212
|
}
|
|
@@ -193,7 +237,7 @@ BreakConstantGEPs::runOnModule (Module & module)
|
|
|
193
237
|
//
|
|
194
238
|
if (PHINode * PHI = SVFUtil::dyn_cast<PHINode>(I))
|
|
195
239
|
{
|
|
196
|
-
for (
|
|
240
|
+
for (u32_t index = 0; index < PHI->getNumIncomingValues(); ++index)
|
|
197
241
|
{
|
|
198
242
|
//
|
|
199
243
|
// For PHI Nodes, if an operand is a constant expression with a GEP, we
|
|
@@ -204,10 +248,10 @@ BreakConstantGEPs::runOnModule (Module & module)
|
|
|
204
248
|
// the same value is listed for the incoming block.
|
|
205
249
|
//
|
|
206
250
|
Instruction* InsertPt = PHI->getIncomingBlock(index)->getTerminator();
|
|
207
|
-
if (ConstantExpr * CE =
|
|
251
|
+
if (ConstantExpr * CE = hasConstantExpr(PHI->getIncomingValue(index)))
|
|
208
252
|
{
|
|
209
253
|
Instruction* NewInst = convertExpression (CE, InsertPt);
|
|
210
|
-
for (
|
|
254
|
+
for (u32_t i2 = index; i2 < PHI->getNumIncomingValues(); ++i2)
|
|
211
255
|
{
|
|
212
256
|
if ((PHI->getIncomingBlock (i2)) == PHI->getIncomingBlock (index))
|
|
213
257
|
PHI->setIncomingValue (i2, NewInst);
|
|
@@ -218,14 +262,14 @@ BreakConstantGEPs::runOnModule (Module & module)
|
|
|
218
262
|
}
|
|
219
263
|
else
|
|
220
264
|
{
|
|
221
|
-
for (
|
|
265
|
+
for (u32_t index = 0; index < I->getNumOperands(); ++index)
|
|
222
266
|
{
|
|
223
267
|
//
|
|
224
268
|
// For other instructions, we want to insert instructions replacing
|
|
225
269
|
// constant expressions immediately before the instruction using the
|
|
226
270
|
// constant expression.
|
|
227
271
|
//
|
|
228
|
-
if (ConstantExpr * CE =
|
|
272
|
+
if (ConstantExpr * CE = hasConstantExpr(I->getOperand(index)))
|
|
229
273
|
{
|
|
230
274
|
Instruction* NewInst = convertExpression (CE, I);
|
|
231
275
|
I->replaceUsesOfWith (CE, NewInst);
|