mirror of
https://github.com/VectorCamp/vectorscan.git
synced 2025-09-29 19:24:25 +03:00
tidy: "ue2::flat_set/map" -> "flat_set/map"
This commit is contained in:
committed by
Matthew Barr
parent
9cf66b6ac9
commit
33823d60d1
@@ -121,7 +121,7 @@ RoseVertex createVertex(RoseBuildImpl *build, u32 literalId, u32 min_offset,
|
||||
RoseVertex createVertex(RoseBuildImpl *build, const RoseVertex parent,
|
||||
u32 minBound, u32 maxBound, u32 literalId,
|
||||
size_t literalLength,
|
||||
const ue2::flat_set<ReportID> &reports) {
|
||||
const flat_set<ReportID> &reports) {
|
||||
assert(parent != RoseGraph::null_vertex());
|
||||
|
||||
RoseGraph &g = build->g;
|
||||
@@ -1641,7 +1641,7 @@ bool roseCheckRose(const RoseInGraph &ig, bool prefilter,
|
||||
}
|
||||
|
||||
void RoseBuildImpl::add(bool anchored, bool eod, const ue2_literal &lit,
|
||||
const ue2::flat_set<ReportID> &reports) {
|
||||
const flat_set<ReportID> &reports) {
|
||||
assert(!reports.empty());
|
||||
|
||||
if (cc.grey.floodAsPuffette && !anchored && !eod && is_flood(lit) &&
|
||||
|
@@ -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:
|
||||
@@ -31,8 +31,7 @@
|
||||
|
||||
#include "rose_graph.h"
|
||||
#include "ue2common.h"
|
||||
|
||||
#include <set>
|
||||
#include "util/flat_containers.h"
|
||||
|
||||
namespace ue2 {
|
||||
|
||||
@@ -41,8 +40,8 @@ class RoseBuildImpl;
|
||||
RoseVertex createVertex(RoseBuildImpl *build, const RoseVertex parent,
|
||||
u32 minBound, u32 maxBound, u32 literalId,
|
||||
size_t literalLength,
|
||||
const ue2::flat_set<ReportID> &reports);
|
||||
const flat_set<ReportID> &reports);
|
||||
|
||||
} // namespace ue2
|
||||
|
||||
#endif
|
||||
#endif // ROSE_BUILD_ADD_INTERNAL_H
|
||||
|
@@ -414,8 +414,8 @@ bool validateTransientMask(const vector<CharReach> &mask, bool anchored,
|
||||
|
||||
static
|
||||
bool maskIsNeeded(const ue2_literal &lit, const NGHolder &g) {
|
||||
ue2::flat_set<NFAVertex> curr = {g.accept};
|
||||
ue2::flat_set<NFAVertex> next;
|
||||
flat_set<NFAVertex> curr = {g.accept};
|
||||
flat_set<NFAVertex> next;
|
||||
|
||||
for (auto it = lit.rbegin(), ite = lit.rend(); it != ite; ++it) {
|
||||
const CharReach &cr = *it;
|
||||
@@ -451,7 +451,7 @@ bool maskIsNeeded(const ue2_literal &lit, const NGHolder &g) {
|
||||
|
||||
static
|
||||
void addTransientMask(RoseBuildImpl &build, const vector<CharReach> &mask,
|
||||
const ue2::flat_set<ReportID> &reports, bool anchored,
|
||||
const flat_set<ReportID> &reports, bool anchored,
|
||||
bool eod) {
|
||||
vector<ue2_literal> lits;
|
||||
u32 lit_minBound; /* minBound of each literal in lit */
|
||||
@@ -516,7 +516,7 @@ void addTransientMask(RoseBuildImpl &build, const vector<CharReach> &mask,
|
||||
ENSURE_AT_LEAST(&build.ematcher_region_size, mask.size());
|
||||
}
|
||||
|
||||
const ue2::flat_set<ReportID> no_reports;
|
||||
const flat_set<ReportID> no_reports;
|
||||
|
||||
for (const auto &lit : lits) {
|
||||
u32 lit_id = build.getLiteralId(lit, msk, cmp, delay, table);
|
||||
@@ -553,7 +553,7 @@ void addTransientMask(RoseBuildImpl &build, const vector<CharReach> &mask,
|
||||
}
|
||||
|
||||
static
|
||||
unique_ptr<NGHolder> buildMaskRhs(const ue2::flat_set<ReportID> &reports,
|
||||
unique_ptr<NGHolder> buildMaskRhs(const flat_set<ReportID> &reports,
|
||||
const vector<CharReach> &mask,
|
||||
u32 suffix_len) {
|
||||
assert(suffix_len);
|
||||
@@ -581,10 +581,9 @@ unique_ptr<NGHolder> buildMaskRhs(const ue2::flat_set<ReportID> &reports,
|
||||
}
|
||||
|
||||
static
|
||||
void doAddMask(RoseBuildImpl &tbi, bool anchored,
|
||||
const vector<CharReach> &mask, const ue2_literal &lit,
|
||||
u32 prefix_len, u32 suffix_len,
|
||||
const ue2::flat_set<ReportID> &reports) {
|
||||
void doAddMask(RoseBuildImpl &tbi, bool anchored, const vector<CharReach> &mask,
|
||||
const ue2_literal &lit, u32 prefix_len, u32 suffix_len,
|
||||
const flat_set<ReportID> &reports) {
|
||||
/* Note: bounds are relative to literal start */
|
||||
RoseInGraph ig;
|
||||
RoseInVertex s = add_vertex(RoseInVertexProps::makeStart(anchored), ig);
|
||||
@@ -711,7 +710,7 @@ bool checkAllowMask(const vector<CharReach> &mask, ue2_literal *lit,
|
||||
}
|
||||
|
||||
bool RoseBuildImpl::add(bool anchored, const vector<CharReach> &mask,
|
||||
const ue2::flat_set<ReportID> &reports) {
|
||||
const flat_set<ReportID> &reports) {
|
||||
if (validateTransientMask(mask, anchored, false, cc.grey)) {
|
||||
bool eod = false;
|
||||
addTransientMask(*this, mask, reports, anchored, eod);
|
||||
@@ -734,14 +733,14 @@ bool RoseBuildImpl::add(bool anchored, const vector<CharReach> &mask,
|
||||
}
|
||||
|
||||
bool RoseBuildImpl::validateMask(const vector<CharReach> &mask,
|
||||
UNUSED const ue2::flat_set<ReportID> &reports,
|
||||
UNUSED const flat_set<ReportID> &reports,
|
||||
bool anchored, bool eod) const {
|
||||
return validateTransientMask(mask, anchored, eod, cc.grey);
|
||||
}
|
||||
|
||||
static
|
||||
unique_ptr<NGHolder> makeAnchoredGraph(const vector<CharReach> &mask,
|
||||
const ue2::flat_set<ReportID> &reports,
|
||||
const flat_set<ReportID> &reports,
|
||||
bool eod) {
|
||||
auto gp = ue2::make_unique<NGHolder>();
|
||||
NGHolder &g = *gp;
|
||||
@@ -763,7 +762,7 @@ unique_ptr<NGHolder> makeAnchoredGraph(const vector<CharReach> &mask,
|
||||
|
||||
static
|
||||
bool addAnchoredMask(RoseBuildImpl &build, const vector<CharReach> &mask,
|
||||
const ue2::flat_set<ReportID> &reports, bool eod) {
|
||||
const flat_set<ReportID> &reports, bool eod) {
|
||||
if (!build.cc.grey.allowAnchoredAcyclic) {
|
||||
return false;
|
||||
}
|
||||
@@ -775,8 +774,8 @@ bool addAnchoredMask(RoseBuildImpl &build, const vector<CharReach> &mask,
|
||||
}
|
||||
|
||||
void RoseBuildImpl::addMask(const vector<CharReach> &mask,
|
||||
const ue2::flat_set<ReportID> &reports,
|
||||
bool anchored, bool eod) {
|
||||
const flat_set<ReportID> &reports, bool anchored,
|
||||
bool eod) {
|
||||
if (anchored && addAnchoredMask(*this, mask, reports, eod)) {
|
||||
DEBUG_PRINTF("added mask as anchored acyclic graph\n");
|
||||
return;
|
||||
|
@@ -1087,13 +1087,13 @@ bool triggerKillsRoseGraph(const RoseBuildImpl &build, const left_id &left,
|
||||
assert(left.graph());
|
||||
const NGHolder &h = *left.graph();
|
||||
|
||||
ue2::flat_set<NFAVertex> all_states;
|
||||
flat_set<NFAVertex> all_states;
|
||||
insert(&all_states, vertices(h));
|
||||
assert(out_degree(h.startDs, h) == 1); /* triggered don't use sds */
|
||||
DEBUG_PRINTF("removing sds\n");
|
||||
all_states.erase(h.startDs);
|
||||
|
||||
ue2::flat_set<NFAVertex> states;
|
||||
flat_set<NFAVertex> states;
|
||||
|
||||
/* check each pred literal to see if they all kill previous graph
|
||||
* state */
|
||||
|
@@ -39,7 +39,7 @@ using namespace std;
|
||||
namespace ue2 {
|
||||
|
||||
static
|
||||
bool requiresDedupe(const NGHolder &h, const ue2::flat_set<ReportID> &reports,
|
||||
bool requiresDedupe(const NGHolder &h, const flat_set<ReportID> &reports,
|
||||
const Grey &grey) {
|
||||
/* TODO: tighten */
|
||||
NFAVertex seen_vert = NGHolder::null_vertex();
|
||||
@@ -83,10 +83,10 @@ class RoseDedupeAuxImpl : public RoseDedupeAux {
|
||||
public:
|
||||
explicit RoseDedupeAuxImpl(const RoseBuildImpl &build_in);
|
||||
bool requiresDedupeSupport(
|
||||
const ue2::flat_set<ReportID> &reports) const override;
|
||||
const flat_set<ReportID> &reports) const override;
|
||||
|
||||
private:
|
||||
bool hasSafeMultiReports(const ue2::flat_set<ReportID> &reports) const;
|
||||
bool hasSafeMultiReports(const flat_set<ReportID> &reports) const;
|
||||
|
||||
const RoseBuildImpl &build;
|
||||
map<ReportID, set<RoseVertex>> vert_map; //!< ordinary literals
|
||||
|
@@ -26,9 +26,9 @@
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#include "ue2common.h"
|
||||
|
||||
#include "rose_build_exclusive.h"
|
||||
|
||||
#include "ue2common.h"
|
||||
#include "rose_build_merge.h"
|
||||
#include "nfa/castlecompile.h"
|
||||
#include "nfagraph/ng_execute.h"
|
||||
@@ -37,6 +37,7 @@
|
||||
#include "util/clique.h"
|
||||
#include "util/compile_context.h"
|
||||
#include "util/container.h"
|
||||
#include "util/flat_containers.h"
|
||||
#include "util/graph.h"
|
||||
#include "util/make_unique.h"
|
||||
|
||||
@@ -228,7 +229,7 @@ bool isExclusive(const NGHolder &h,
|
||||
lower_bound = ~0U;
|
||||
}
|
||||
|
||||
ue2::flat_set<NFAVertex> states;
|
||||
flat_set<NFAVertex> states;
|
||||
for (const auto &v : vertices_range(h)) {
|
||||
if (h[v].index >= lower_bound || h[v].index < 2) {
|
||||
states.insert(v);
|
||||
|
@@ -1738,7 +1738,7 @@ void dedupeLeftfixesVariableLag(RoseBuildImpl &tbi) {
|
||||
}
|
||||
|
||||
static
|
||||
u32 findUnusedTop(const ue2::flat_set<u32> &tops) {
|
||||
u32 findUnusedTop(const flat_set<u32> &tops) {
|
||||
u32 i = 0;
|
||||
while (contains(tops, i)) {
|
||||
i++;
|
||||
@@ -1766,7 +1766,7 @@ void replaceTops(NGHolder &h, const map<u32, u32> &top_mapping) {
|
||||
static
|
||||
bool setDistinctTops(NGHolder &h1, const NGHolder &h2,
|
||||
map<u32, u32> &top_mapping) {
|
||||
ue2::flat_set<u32> tops1 = getTops(h1), tops2 = getTops(h2);
|
||||
flat_set<u32> tops1 = getTops(h1), tops2 = getTops(h2);
|
||||
|
||||
DEBUG_PRINTF("before: h1 has %zu tops, h2 has %zu tops\n", tops1.size(),
|
||||
tops2.size());
|
||||
|
Reference in New Issue
Block a user