mirror of
https://github.com/VectorCamp/vectorscan.git
synced 2025-06-28 16:41:01 +03:00
ng_violet: iterate in edge order
This commit is contained in:
parent
55c2d20e2c
commit
63528f1cd2
@ -1622,7 +1622,8 @@ void removeRedundantLiteralsFromInfix(const NGHolder &h, RoseInGraph &ig,
|
|||||||
static
|
static
|
||||||
void removeRedundantLiteralsFromInfixes(RoseInGraph &g,
|
void removeRedundantLiteralsFromInfixes(RoseInGraph &g,
|
||||||
const CompileContext &cc) {
|
const CompileContext &cc) {
|
||||||
map<NGHolder *, vector<RoseInEdge> > infixes;
|
vector<NGHolder *> seen_order;
|
||||||
|
map<NGHolder *, vector<RoseInEdge>> infixes;
|
||||||
|
|
||||||
for (const RoseInEdge &e : edges_range(g)) {
|
for (const RoseInEdge &e : edges_range(g)) {
|
||||||
RoseInVertex s = source(e, g);
|
RoseInVertex s = source(e, g);
|
||||||
@ -1637,11 +1638,16 @@ void removeRedundantLiteralsFromInfixes(RoseInGraph &g,
|
|||||||
}
|
}
|
||||||
|
|
||||||
assert(!g[t].delay);
|
assert(!g[t].delay);
|
||||||
infixes[&*g[e].graph].push_back(e);
|
|
||||||
|
NGHolder *h = g[e].graph.get();
|
||||||
|
if (!contains(infixes, h)) {
|
||||||
|
seen_order.push_back(h);
|
||||||
|
}
|
||||||
|
infixes[h].push_back(e);
|
||||||
}
|
}
|
||||||
|
|
||||||
for (const auto &info : infixes) {
|
for (NGHolder *h : seen_order) {
|
||||||
removeRedundantLiteralsFromInfix(*info.first, g, info.second, cc);
|
removeRedundantLiteralsFromInfix(*h, g, infixes[h], cc);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user