mirror of
https://github.com/VectorCamp/vectorscan.git
synced 2025-12-31 13:49:07 +03:00
insertion_ordered_{map,set}: add new containers
These are associative map/set structures that are iterable in insertion order.
This commit is contained in:
committed by
Matthew Barr
parent
72973ccb47
commit
3ff70d5568
@@ -86,6 +86,7 @@
|
||||
#include "util/container.h"
|
||||
#include "util/fatbit_build.h"
|
||||
#include "util/graph_range.h"
|
||||
#include "util/insertion_ordered.h"
|
||||
#include "util/make_unique.h"
|
||||
#include "util/multibit_build.h"
|
||||
#include "util/noncopyable.h"
|
||||
@@ -1474,11 +1475,11 @@ bool buildLeftfixes(RoseBuildImpl &tbi, build_context &bc,
|
||||
RoseGraph &g = tbi.g;
|
||||
const CompileContext &cc = tbi.cc;
|
||||
|
||||
map<left_id, set<PredTopPair> > infixTriggers;
|
||||
vector<left_id> order;
|
||||
unordered_map<left_id, vector<RoseVertex>> succs;
|
||||
map<left_id, set<PredTopPair>> infixTriggers;
|
||||
findInfixTriggers(tbi, &infixTriggers);
|
||||
|
||||
insertion_ordered_map<left_id, vector<RoseVertex>> succs;
|
||||
|
||||
if (cc.grey.allowTamarama && cc.streaming && !do_prefix) {
|
||||
findExclusiveInfixes(tbi, bc, qif, infixTriggers, no_retrigger_queues);
|
||||
}
|
||||
@@ -1517,10 +1518,6 @@ bool buildLeftfixes(RoseBuildImpl &tbi, build_context &bc,
|
||||
}
|
||||
}
|
||||
|
||||
if (!contains(succs, leftfix)) {
|
||||
order.push_back(leftfix);
|
||||
}
|
||||
|
||||
succs[leftfix].push_back(v);
|
||||
}
|
||||
|
||||
@@ -1529,8 +1526,9 @@ bool buildLeftfixes(RoseBuildImpl &tbi, build_context &bc,
|
||||
|
||||
map<left_id, eager_info> eager;
|
||||
|
||||
for (const left_id &leftfix : order) {
|
||||
const auto &left_succs = succs[leftfix];
|
||||
for (const auto &m : succs) {
|
||||
const left_id &leftfix = m.first;
|
||||
const auto &left_succs = m.second;
|
||||
|
||||
rose_group squash_mask = tbi.rose_squash_masks.at(leftfix);
|
||||
eager_info ei;
|
||||
@@ -1549,9 +1547,11 @@ bool buildLeftfixes(RoseBuildImpl &tbi, build_context &bc,
|
||||
eager.clear();
|
||||
}
|
||||
|
||||
for (const left_id &leftfix : order) {
|
||||
for (const auto &m : succs) {
|
||||
const left_id &leftfix = m.first;
|
||||
const auto &left_succs = m.second;
|
||||
buildLeftfix(tbi, bc, do_prefix, qif.get_queue(), infixTriggers,
|
||||
no_retrigger_queues, eager_queues, eager, succs[leftfix],
|
||||
no_retrigger_queues, eager_queues, eager, left_succs,
|
||||
leftfix);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user