mirror of
https://github.com/VectorCamp/vectorscan.git
synced 2025-11-19 18:44:24 +03:00
addressing 47 [constParameterReference],48 [constVariableReference],58
[constVariable]
This commit is contained in:
@@ -353,7 +353,7 @@ void createVertices(RoseBuildImpl *tbi,
|
||||
edge_props.minBound, edge_props.maxBound);
|
||||
}
|
||||
|
||||
for (auto &m : created) {
|
||||
for (const auto &m : created) {
|
||||
tbi->ghost[m.second] = g_v;
|
||||
}
|
||||
}
|
||||
@@ -938,7 +938,7 @@ void shift_accepts_to_end(const RoseInGraph &ig,
|
||||
}
|
||||
|
||||
static
|
||||
void populateRoseGraph(RoseBuildImpl *tbi, RoseBuildData &bd) {
|
||||
void populateRoseGraph(RoseBuildImpl *tbi, const RoseBuildData &bd) {
|
||||
const RoseInGraph &ig = bd.ig;
|
||||
|
||||
/* add the pattern in to the main rose graph */
|
||||
|
||||
@@ -674,7 +674,7 @@ buildSuffix(const ReportManager &rm, const SomSlotManager &ssm,
|
||||
}
|
||||
|
||||
assert(suff.graph());
|
||||
NGHolder &holder = *suff.graph();
|
||||
const NGHolder &holder = *suff.graph();
|
||||
assert(holder.kind == NFA_SUFFIX);
|
||||
const bool oneTop = onlyOneTop(holder);
|
||||
bool compress_state = cc.streaming;
|
||||
@@ -1378,7 +1378,7 @@ void updateExclusiveSuffixProperties(const RoseBuildImpl &build,
|
||||
const vector<ExclusiveInfo> &exclusive_info,
|
||||
set<u32> *no_retrigger_queues) {
|
||||
const RoseGraph &g = build.g;
|
||||
for (auto &info : exclusive_info) {
|
||||
for (const auto &info : exclusive_info) {
|
||||
const auto &qi = info.queue;
|
||||
const auto &subengines = info.subengines;
|
||||
bool no_retrigger = true;
|
||||
@@ -1627,11 +1627,11 @@ public:
|
||||
build.rm);
|
||||
}
|
||||
|
||||
bytecode_ptr<NFA> operator()(unique_ptr<NGHolder> &holder) const {
|
||||
bytecode_ptr<NFA> operator()(const unique_ptr<NGHolder> &holder) const {
|
||||
const CompileContext &cc = build.cc;
|
||||
const ReportManager &rm = build.rm;
|
||||
|
||||
NGHolder &h = *holder;
|
||||
const NGHolder &h = *holder;
|
||||
assert(h.kind == NFA_OUTFIX);
|
||||
|
||||
// Build NFA.
|
||||
@@ -1657,7 +1657,7 @@ public:
|
||||
return n;
|
||||
}
|
||||
|
||||
bytecode_ptr<NFA> operator()(UNUSED MpvProto &mpv) const {
|
||||
bytecode_ptr<NFA> operator()(UNUSED const MpvProto &mpv) const {
|
||||
// MPV construction handled separately.
|
||||
assert(mpv.puffettes.empty());
|
||||
return nullptr;
|
||||
@@ -2728,7 +2728,7 @@ void buildLeftInfoTable(const RoseBuildImpl &tbi, build_context &bc,
|
||||
}
|
||||
|
||||
static
|
||||
RoseProgram makeLiteralProgram(const RoseBuildImpl &build, build_context &bc,
|
||||
RoseProgram makeLiteralProgram(const RoseBuildImpl &build, const build_context &bc,
|
||||
ProgramBuild &prog_build, u32 lit_id,
|
||||
const vector<vector<RoseEdge>> &lit_edge_map,
|
||||
bool is_anchored_replay_program) {
|
||||
@@ -2973,7 +2973,7 @@ void buildFragmentPrograms(const RoseBuildImpl &build,
|
||||
pfrag.lit_ids, lit_edge_map);
|
||||
if (pfrag.included_frag_id != INVALID_FRAG_ID &&
|
||||
!lit_prog.empty()) {
|
||||
auto &cfrag = fragments[pfrag.included_frag_id];
|
||||
const auto &cfrag = fragments[pfrag.included_frag_id];
|
||||
assert(pfrag.s.length() >= cfrag.s.length() &&
|
||||
!pfrag.s.any_nocase() >= !cfrag.s.any_nocase());
|
||||
u32 child_offset = cfrag.lit_program_offset;
|
||||
@@ -2992,7 +2992,7 @@ void buildFragmentPrograms(const RoseBuildImpl &build,
|
||||
pfrag.lit_ids);
|
||||
if (pfrag.included_delay_frag_id != INVALID_FRAG_ID &&
|
||||
!rebuild_prog.empty()) {
|
||||
auto &cfrag = fragments[pfrag.included_delay_frag_id];
|
||||
const auto &cfrag = fragments[pfrag.included_delay_frag_id];
|
||||
assert(pfrag.s.length() >= cfrag.s.length() &&
|
||||
!pfrag.s.any_nocase() >= !cfrag.s.any_nocase());
|
||||
u32 child_offset = cfrag.delay_program_offset;
|
||||
@@ -3011,7 +3011,7 @@ void updateLitProtoProgramOffset(vector<LitFragment> &fragments,
|
||||
auto &proto = *litProto.hwlmProto;
|
||||
for (auto &lit : proto.lits) {
|
||||
auto fragId = lit.id;
|
||||
auto &frag = fragments[fragId];
|
||||
const auto &frag = fragments[fragId];
|
||||
if (delay) {
|
||||
DEBUG_PRINTF("delay_program_offset:%u\n",
|
||||
frag.delay_program_offset);
|
||||
|
||||
@@ -118,7 +118,7 @@ bool addPrefixLiterals(NGHolder &h, unordered_set<u32> &tailId,
|
||||
|
||||
for (auto v : adjacent_vertices_range(start, h)) {
|
||||
if (v != h.startDs) {
|
||||
for (auto &t : tails) {
|
||||
for (const auto &t : tails) {
|
||||
add_edge(t, v, h);
|
||||
}
|
||||
}
|
||||
@@ -126,7 +126,7 @@ bool addPrefixLiterals(NGHolder &h, unordered_set<u32> &tailId,
|
||||
|
||||
clear_out_edges(start, h);
|
||||
add_edge(h.start, h.start, h);
|
||||
for (auto &t : heads) {
|
||||
for (const auto &t : heads) {
|
||||
add_edge(start, t, h);
|
||||
}
|
||||
|
||||
|
||||
@@ -275,7 +275,7 @@ void assignGroupsToLiterals(RoseBuildImpl &build) {
|
||||
// Second pass: the other literals.
|
||||
for (u32 id = 0; id < literals.size(); id++) {
|
||||
const rose_literal_id &lit = literals.at(id);
|
||||
rose_literal_info &info = literal_info[id];
|
||||
const rose_literal_info &info = literal_info[id];
|
||||
|
||||
if (!requires_group_assignment(lit, info)) {
|
||||
continue;
|
||||
|
||||
@@ -1338,7 +1338,7 @@ void chunk(vector<T> in, vector<vector<T>> *out, size_t chunk_size) {
|
||||
}
|
||||
|
||||
static
|
||||
insertion_ordered_map<left_id, vector<RoseVertex>> get_eng_verts(RoseGraph &g) {
|
||||
insertion_ordered_map<left_id, vector<RoseVertex>> get_eng_verts(const RoseGraph &g) {
|
||||
insertion_ordered_map<left_id, vector<RoseVertex>> eng_verts;
|
||||
for (auto v : vertices_range(g)) {
|
||||
const auto &left = g[v].left;
|
||||
@@ -1924,7 +1924,7 @@ void mergeSmallLeftfixes(RoseBuildImpl &tbi) {
|
||||
}
|
||||
|
||||
assert(left.graph());
|
||||
NGHolder &h = *left.graph();
|
||||
const NGHolder &h = *left.graph();
|
||||
|
||||
/* Ensure that kind on the graph is correct */
|
||||
assert(h.kind == (tbi.isRootSuccessor(v) ? NFA_PREFIX : NFA_INFIX));
|
||||
@@ -2024,7 +2024,7 @@ void mergeCastleLeftfixes(RoseBuildImpl &build) {
|
||||
return;
|
||||
}
|
||||
|
||||
RoseGraph &g = build.g;
|
||||
const RoseGraph &g = build.g;
|
||||
|
||||
insertion_ordered_map<left_id, vector<RoseVertex>> eng_verts;
|
||||
|
||||
@@ -2306,7 +2306,7 @@ void mergeOutfixInfo(OutfixInfo &winner, const OutfixInfo &victim) {
|
||||
}
|
||||
|
||||
static
|
||||
map<NGHolder *, NGHolder *> chunkedNfaMerge(RoseBuildImpl &build,
|
||||
map<NGHolder *, NGHolder *> chunkedNfaMerge(const RoseBuildImpl &build,
|
||||
const vector<NGHolder *> &nfas) {
|
||||
map<NGHolder *, NGHolder *> merged;
|
||||
|
||||
|
||||
@@ -1352,8 +1352,8 @@ bool attemptRoseMerge(RoseBuildImpl &build, bool preds_same, RoseVertex a,
|
||||
assert(a != b);
|
||||
|
||||
RoseGraph &g = build.g;
|
||||
LeftEngInfo &a_left = g[a].left;
|
||||
LeftEngInfo &b_left = g[b].left;
|
||||
const LeftEngInfo &a_left = g[a].left;
|
||||
const LeftEngInfo &b_left = g[b].left;
|
||||
|
||||
// Trivial case.
|
||||
if (a_left == b_left) {
|
||||
@@ -1601,7 +1601,7 @@ void diamondMergePass(CandidateSet &candidates, RoseBuildImpl &build,
|
||||
vector<RoseVertex> *dead, bool mergeRoses,
|
||||
RoseAliasingInfo &rai) {
|
||||
DEBUG_PRINTF("begin\n");
|
||||
RoseGraph &g = build.g;
|
||||
const RoseGraph &g = build.g;
|
||||
|
||||
if (candidates.empty()) {
|
||||
return;
|
||||
@@ -1972,7 +1972,7 @@ bool hasNoDiamondSiblings(const RoseGraph &g, RoseVertex v) {
|
||||
* merge.
|
||||
*/
|
||||
static
|
||||
void filterDiamondCandidates(RoseGraph &g, CandidateSet &candidates) {
|
||||
void filterDiamondCandidates(const RoseGraph &g, CandidateSet &candidates) {
|
||||
DEBUG_PRINTF("%zu candidates enter\n", candidates.size());
|
||||
|
||||
vector<RoseVertex> dead;
|
||||
|
||||
Reference in New Issue
Block a user