Add spv.branch-return.vert and fix inReadableOrder().

This commit is contained in:
Dejan Mircevski
2016-01-18 17:12:59 -05:00
parent 44bfb0d0cd
commit baa55a1591
4 changed files with 78 additions and 3 deletions

View File

@@ -27,10 +27,11 @@ using BlockSet = std::unordered_set<Id>;
using IdToBool = std::unordered_map<Id, bool>;
namespace {
// True if any of prerequisites have not yet been visited.
bool delay(const BlockSet& prereqs, const IdToBool& visited) {
// True if any of prerequisites have not yet been visited. May add new,
// zero-initialized, values to visited, but doesn't modify any existing values.
bool delay(const BlockSet& prereqs, IdToBool& visited) {
return std::any_of(prereqs.begin(), prereqs.end(),
[&visited](Id b) { return !visited.count(b); });
[&visited](Id b) { return !visited[b]; });
}
}