]> git.ipfire.org Git - thirdparty/vectorscan.git/commitdiff
rose_build_groups: move getGroups, getSuccGroups
authorJustin Viiret <justin.viiret@intel.com>
Thu, 2 Jun 2016 03:18:23 +0000 (13:18 +1000)
committerMatthew Barr <matthew.barr@intel.com>
Fri, 8 Jul 2016 00:47:07 +0000 (10:47 +1000)
src/rose/rose_build_compile.cpp
src/rose/rose_build_groups.cpp

index 05bde212a45b796681ec742eb143037302f36920..af8f7e960c479dd375c60f2ec8494d890823cfa0 100644 (file)
@@ -87,30 +87,6 @@ namespace ue2 {
 #define ANCHORED_REHOME_DEEP 25
 #define ANCHORED_REHOME_SHORT_LEN 3
 
-rose_group RoseBuildImpl::getGroups(RoseVertex v) const {
-    rose_group groups = 0;
-
-    for (u32 id : g[v].literals) {
-        u32 lit_id = literal_info.at(id).undelayed_id;
-
-        rose_group mygroups = literal_info[lit_id].group_mask;
-        groups |= mygroups;
-    }
-
-    return groups;
-}
-
-/** \brief Get the groups of the successor literals of a given vertex. */
-rose_group RoseBuildImpl::getSuccGroups(RoseVertex start) const {
-    rose_group initialGroups = 0;
-
-    for (auto v : adjacent_vertices_range(start, g)) {
-        initialGroups |= getGroups(v);
-    }
-
-    return initialGroups;
-}
-
 #ifdef DEBUG
 static UNUSED
 void printLitInfo(const rose_literal_info &li, u32 id) {
index 1a8d556e365362580cd5d7c633605b4df82ae5ee..4fc125d2e2a35b6aebcda20c6b05aaefb9e67694 100644 (file)
@@ -335,6 +335,30 @@ void RoseBuildImpl::assignGroupsToLiterals() {
     }
 }
 
+rose_group RoseBuildImpl::getGroups(RoseVertex v) const {
+    rose_group groups = 0;
+
+    for (u32 id : g[v].literals) {
+        u32 lit_id = literal_info.at(id).undelayed_id;
+
+        rose_group mygroups = literal_info[lit_id].group_mask;
+        groups |= mygroups;
+    }
+
+    return groups;
+}
+
+/** \brief Get the groups of the successor literals of a given vertex. */
+rose_group RoseBuildImpl::getSuccGroups(RoseVertex start) const {
+    rose_group initialGroups = 0;
+
+    for (auto v : adjacent_vertices_range(start, g)) {
+        initialGroups |= getGroups(v);
+    }
+
+    return initialGroups;
+}
+
 /**
  * The groups that a role sets are determined by the union of its successor
  * literals. Requires the literals already have had groups assigned.