summaryrefslogtreecommitdiff
path: root/src/analysis/collections.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/analysis/collections.cpp')
-rw-r--r--src/analysis/collections.cpp34
1 files changed, 34 insertions, 0 deletions
diff --git a/src/analysis/collections.cpp b/src/analysis/collections.cpp
index 9dc4429..81559f9 100644
--- a/src/analysis/collections.cpp
+++ b/src/analysis/collections.cpp
@@ -165,6 +165,13 @@ void mergeThenNullChecked(WalkItem &wi1, WalkItem &wi2)
wi2.checkedThenNullVars.end());
}
+// merger two checked for null var sets
+void mergeElseNullChecked(WalkItem &wi1, WalkItem &wi2)
+{
+ wi1.checkedElseNullVars.insert(wi2.checkedElseNullVars.begin(),
+ wi2.checkedElseNullVars.end());
+}
+
// merger two checked for non null var sets
void mergeThenNonNullChecked(WalkItem &wi1, WalkItem &wi2)
{
@@ -172,6 +179,13 @@ void mergeThenNonNullChecked(WalkItem &wi1, WalkItem &wi2)
wi2.checkedThenNonNullVars.end());
}
+// merger two checked for non null var sets
+void mergeElseNonNullChecked(WalkItem &wi1, WalkItem &wi2)
+{
+ wi1.checkedElseNonNullVars.insert(wi2.checkedElseNonNullVars.begin(),
+ wi2.checkedElseNonNullVars.end());
+}
+
// intersect two checked for null sets
void intersectThenNullChecked(WalkItem &wi, WalkItem &wi1, WalkItem &wi2)
{
@@ -182,6 +196,16 @@ void intersectThenNullChecked(WalkItem &wi, WalkItem &wi1, WalkItem &wi2)
}
}
+// intersect two checked for null sets
+void intersectElseNullChecked(WalkItem &wi, WalkItem &wi1, WalkItem &wi2)
+{
+ FOR_EACH (it, wi1.checkedElseNullVars)
+ {
+ if (isIn(it, wi2.checkedElseNullVars))
+ wi.checkedElseNullVars.insert(it);
+ }
+}
+
// intersect two checked for non null sets
void intersectThenNonNullChecked(WalkItem &wi, WalkItem &wi1, WalkItem &wi2)
{
@@ -192,6 +216,16 @@ void intersectThenNonNullChecked(WalkItem &wi, WalkItem &wi1, WalkItem &wi2)
}
}
+// intersect two checked for non null sets
+void intersectElseNonNullChecked(WalkItem &wi, WalkItem &wi1, WalkItem &wi2)
+{
+ FOR_EACH (it, wi1.checkedElseNonNullVars)
+ {
+ if (isIn(it, wi2.checkedElseNonNullVars))
+ wi.checkedElseNonNullVars.insert(it);
+ }
+}
+
void removeFromNeedCheckNullVars(WalkItem &wi, std::set<std::string> &vars)
{
FOR_EACH (it, vars)