rose_build_groups: move assignGroupsToRoles

This commit is contained in:
Justin Viiret 2016-06-02 13:13:48 +10:00 committed by Matthew Barr
parent 2b24000b1a
commit 42419a26d2
2 changed files with 24 additions and 24 deletions

View File

@ -1050,30 +1050,6 @@ void findGroupSquashers(RoseBuildImpl &tbi) {
} }
} }
/**
* The groups that a role sets are determined by the union of its successor
* literals. Requires the literals already have had groups assigned.
*/
void RoseBuildImpl::assignGroupsToRoles() {
/* Note: if there is a succ literal in the sidematcher, its successors
* literals must be added instead */
for (auto v : vertices_range(g)) {
if (isAnyStart(v)) {
continue;
}
const rose_group succ_groups = getSuccGroups(v);
g[v].groups |= succ_groups;
if (ghost.find(v) != ghost.end()) {
/* delayed roles need to supply their groups to the ghost role */
g[ghost[v]].groups |= succ_groups;
}
DEBUG_PRINTF("vertex %zu: groups=%llx\n", g[v].idx, g[v].groups);
}
}
void RoseBuildImpl::findTransientLeftfixes(void) { void RoseBuildImpl::findTransientLeftfixes(void) {
for (auto v : vertices_range(g)) { for (auto v : vertices_range(g)) {
if (!g[v].left) { if (!g[v].left) {

View File

@ -335,6 +335,30 @@ void RoseBuildImpl::assignGroupsToLiterals() {
} }
} }
/**
* The groups that a role sets are determined by the union of its successor
* literals. Requires the literals already have had groups assigned.
*/
void RoseBuildImpl::assignGroupsToRoles() {
/* Note: if there is a succ literal in the sidematcher, its successors
* literals must be added instead */
for (auto v : vertices_range(g)) {
if (isAnyStart(v)) {
continue;
}
const rose_group succ_groups = getSuccGroups(v);
g[v].groups |= succ_groups;
if (ghost.find(v) != ghost.end()) {
/* delayed roles need to supply their groups to the ghost role */
g[ghost[v]].groups |= succ_groups;
}
DEBUG_PRINTF("vertex %zu: groups=%llx\n", g[v].idx, g[v].groups);
}
}
/** /**
* \brief Returns a mapping from each graph vertex v to the intersection of the * \brief Returns a mapping from each graph vertex v to the intersection of the
* groups switched on by all of the paths leading up to (and including) v from * groups switched on by all of the paths leading up to (and including) v from