mirror of
https://github.com/VectorCamp/vectorscan.git
synced 2025-11-19 10:34:25 +03:00
shift early_dfa construction earlier
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2015, Intel Corporation
|
||||
* Copyright (c) 2015-2017, Intel Corporation
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
@@ -65,6 +65,26 @@ bool can_exhaust(const NGHolder &g, const ReportManager &rm) {
|
||||
return true;
|
||||
}
|
||||
|
||||
void set_report(NGHolder &g, ReportID internal_report) {
|
||||
// First, wipe the report IDs on all vertices.
|
||||
for (auto v : vertices_range(g)) {
|
||||
g[v].reports.clear();
|
||||
}
|
||||
|
||||
// Any predecessors of accept get our id.
|
||||
for (auto v : inv_adjacent_vertices_range(g.accept, g)) {
|
||||
g[v].reports.insert(internal_report);
|
||||
}
|
||||
|
||||
// Same for preds of acceptEod, except accept itself.
|
||||
for (auto v : inv_adjacent_vertices_range(g.acceptEod, g)) {
|
||||
if (v == g.accept) {
|
||||
continue;
|
||||
}
|
||||
g[v].reports.insert(internal_report);
|
||||
}
|
||||
}
|
||||
|
||||
/** Derive a maximum offset for the graph from the max_offset values of its
|
||||
* reports. Returns MAX_OFFSET for inf. */
|
||||
u64a findMaxOffset(const NGHolder &g, const ReportManager &rm) {
|
||||
|
||||
Reference in New Issue
Block a user