mirror of
https://github.com/VectorCamp/vectorscan.git
synced 2025-06-28 16:41:01 +03:00
violet: do not remove more states from holders if dfa has been built
This commit is contained in:
parent
a645201675
commit
c693c44646
@ -1556,6 +1556,12 @@ void removeRedundantLiteralsFromPrefixes(RoseInGraph &g,
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (g[e].dfa) {
|
||||||
|
/* if we removed any more states, we would need to rebuild the
|
||||||
|
* the dfa which can be time consuming. */
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
assert(!g[t].delay);
|
assert(!g[t].delay);
|
||||||
const ue2_literal &lit = g[t].s;
|
const ue2_literal &lit = g[t].s;
|
||||||
|
|
||||||
@ -1673,6 +1679,8 @@ void removeRedundantLiteralsFromInfix(const NGHolder &h, RoseInGraph &ig,
|
|||||||
/* already removed redundant parts of literals */
|
/* already removed redundant parts of literals */
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
assert(!ig[e].dfa);
|
||||||
}
|
}
|
||||||
|
|
||||||
map<ue2_literal, pair<shared_ptr<NGHolder>, u32> > graphs; /* + delay */
|
map<ue2_literal, pair<shared_ptr<NGHolder>, u32> > graphs; /* + delay */
|
||||||
@ -1746,6 +1754,11 @@ void removeRedundantLiteralsFromInfixes(RoseInGraph &g,
|
|||||||
}
|
}
|
||||||
|
|
||||||
assert(!g[t].delay);
|
assert(!g[t].delay);
|
||||||
|
if (g[e].dfa) {
|
||||||
|
/* if we removed any more states, we would need to rebuild the
|
||||||
|
* the dfa which can be time consuming. */
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
NGHolder *h = g[e].graph.get();
|
NGHolder *h = g[e].graph.get();
|
||||||
if (!contains(infixes, h)) {
|
if (!contains(infixes, h)) {
|
||||||
@ -2870,7 +2883,7 @@ bool splitForImplementability(RoseInGraph &vg, NGHolder &h,
|
|||||||
}
|
}
|
||||||
|
|
||||||
DEBUG_PRINTF("trying to netflow\n");
|
DEBUG_PRINTF("trying to netflow\n");
|
||||||
bool rv = doNetflowCut(h, nullptr, vg, edges, false, cc.grey);
|
bool rv = doNetflowCut(h, nullptr, vg, edges, false, cc.grey);
|
||||||
DEBUG_PRINTF("done\n");
|
DEBUG_PRINTF("done\n");
|
||||||
|
|
||||||
return rv;
|
return rv;
|
||||||
@ -2892,7 +2905,7 @@ bool ensureImplementable(RoseBuild &rose, RoseInGraph &vg, bool allow_changes,
|
|||||||
map<const NGHolder *, vector<RoseInEdge> > edges_by_graph;
|
map<const NGHolder *, vector<RoseInEdge> > edges_by_graph;
|
||||||
vector<NGHolder *> graphs;
|
vector<NGHolder *> graphs;
|
||||||
for (const RoseInEdge &ve : edges_range(vg)) {
|
for (const RoseInEdge &ve : edges_range(vg)) {
|
||||||
if (vg[ve].graph) {
|
if (vg[ve].graph && !vg[ve].dfa) {
|
||||||
NGHolder *h = vg[ve].graph.get();
|
NGHolder *h = vg[ve].graph.get();
|
||||||
if (!contains(edges_by_graph, h)) {
|
if (!contains(edges_by_graph, h)) {
|
||||||
graphs.push_back(h);
|
graphs.push_back(h);
|
||||||
@ -2929,7 +2942,6 @@ bool ensureImplementable(RoseBuild &rose, RoseInGraph &vg, bool allow_changes,
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
changed = true;
|
changed = true;
|
||||||
good.insert(h);
|
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user