shift early_dfa construction earlier

This commit is contained in:
Alex Coyte
2016-12-01 16:10:34 +11:00
committed by Matthew Barr
parent caa46201f0
commit 512c049493
11 changed files with 171 additions and 46 deletions

View File

@@ -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) {