mirror of
https://github.com/VectorCamp/vectorscan.git
synced 2025-11-16 09:21:52 +03:00
addressing 47 [constParameterReference],48 [constVariableReference],58
[constVariable]
This commit is contained in:
@@ -1017,7 +1017,7 @@ void update_accel_prog_offset(const gough_build_strat &gbs,
|
||||
verts[gbs.gg[v].state_id] = v;
|
||||
}
|
||||
|
||||
for (auto &m : gbs.built_accel) {
|
||||
for (const auto &m : gbs.built_accel) {
|
||||
gough_accel *ga = m.first;
|
||||
assert(!ga->prog_offset);
|
||||
GoughVertex v = verts[m.second];
|
||||
|
||||
@@ -438,7 +438,7 @@ void create_slot_mapping(const GoughGraph &cfg, UNUSED u32 old_slot_count,
|
||||
}
|
||||
|
||||
static
|
||||
void update_local_slots(GoughGraph &g, set<GoughSSAVar *> &locals,
|
||||
void update_local_slots(GoughGraph &g, const set<GoughSSAVar *> &locals,
|
||||
u32 local_base) {
|
||||
DEBUG_PRINTF("%zu local variables\n", locals.size());
|
||||
/* local variables only occur on edges (joins are never local) */
|
||||
|
||||
@@ -361,7 +361,7 @@ struct raw_report_list {
|
||||
raw_report_list(const flat_set<ReportID> &reports_in,
|
||||
const ReportManager &rm, bool do_remap) {
|
||||
if (do_remap) {
|
||||
for (auto &id : reports_in) {
|
||||
for (const auto &id : reports_in) {
|
||||
reports.insert(rm.getProgramOffset(id));
|
||||
}
|
||||
} else {
|
||||
@@ -540,7 +540,7 @@ size_t calcWideRegionSize(const dfa_info &info) {
|
||||
static
|
||||
void fillInAux(mstate_aux *aux, dstate_id_t i, const dfa_info &info,
|
||||
const vector<u32> &reports, const vector<u32> &reports_eod,
|
||||
vector<u32> &reportOffsets) {
|
||||
const vector<u32> &reportOffsets) {
|
||||
const dstate &raw_state = info.states[i];
|
||||
aux->accept = raw_state.reports.empty() ? 0 : reportOffsets[reports[i]];
|
||||
aux->accept_eod = raw_state.reports_eod.empty() ? 0
|
||||
@@ -794,8 +794,8 @@ bytecode_ptr<NFA> mcclellanCompile16(dfa_info &info, const CompileContext &cc,
|
||||
}
|
||||
|
||||
for (size_t i : order) {
|
||||
vector<dstate_id_t> &state_chain = info.wide_state_chain[i];
|
||||
vector<symbol_t> &symbol_chain = info.wide_symbol_chain[i];
|
||||
const vector<dstate_id_t> &state_chain = info.wide_state_chain[i];
|
||||
const vector<symbol_t> &symbol_chain = info.wide_symbol_chain[i];
|
||||
|
||||
u16 width = verify_u16(symbol_chain.size());
|
||||
*(u16 *)(curr_wide_entry + WIDE_WIDTH_OFFSET) = width;
|
||||
@@ -1367,11 +1367,11 @@ bool store_chain_longest(vector<vector<dstate_id_t>> &candidate_chain,
|
||||
/* \brief Generate wide_symbol_chain from wide_state_chain. */
|
||||
static
|
||||
void generate_symbol_chain(dfa_info &info, vector<symbol_t> &chain_tail) {
|
||||
raw_dfa &rdfa = info.raw;
|
||||
const raw_dfa &rdfa = info.raw;
|
||||
assert(chain_tail.size() == info.wide_state_chain.size());
|
||||
|
||||
for (size_t i = 0; i < info.wide_state_chain.size(); i++) {
|
||||
vector<dstate_id_t> &state_chain = info.wide_state_chain[i];
|
||||
const vector<dstate_id_t> &state_chain = info.wide_state_chain[i];
|
||||
vector<symbol_t> symbol_chain;
|
||||
|
||||
info.extra[state_chain[0]].wideHead = true;
|
||||
|
||||
@@ -955,7 +955,7 @@ bool is_cyclic_near(const raw_dfa &raw, dstate_id_t root) {
|
||||
}
|
||||
|
||||
static
|
||||
void fill_in_sherman(NFA *nfa, dfa_info &info, UNUSED u16 sherman_limit) {
|
||||
void fill_in_sherman(NFA *nfa, const dfa_info &info, UNUSED u16 sherman_limit) {
|
||||
char *nfa_base = (char *)nfa;
|
||||
mcsheng *m = (mcsheng *)getMutableImplNfa(nfa);
|
||||
char *sherman_table = nfa_base + m->sherman_offset;
|
||||
@@ -1109,7 +1109,7 @@ void fill_in_succ_table_8(NFA *nfa, const dfa_info &info,
|
||||
}
|
||||
|
||||
static
|
||||
void fill_in_sherman64(NFA *nfa, dfa_info &info, UNUSED u16 sherman_limit) {
|
||||
void fill_in_sherman64(NFA *nfa, const dfa_info &info, UNUSED u16 sherman_limit) {
|
||||
char *nfa_base = (char *)nfa;
|
||||
mcsheng64 *m = (mcsheng64 *)getMutableImplNfa(nfa);
|
||||
char *sherman_table = nfa_base + m->sherman_offset;
|
||||
|
||||
@@ -99,7 +99,7 @@ struct dfa_info {
|
||||
return next(idx, TOP);
|
||||
}
|
||||
dstate &next(dstate_id_t idx, u16 chr) {
|
||||
auto &src = (*this)[idx];
|
||||
const auto &src = (*this)[idx];
|
||||
auto next_id = src.next[raw.alpha_remap[chr]];
|
||||
return states[next_id];
|
||||
}
|
||||
@@ -109,7 +109,7 @@ struct dfa_info {
|
||||
// if DFA can't die, shift all indices left by 1
|
||||
return can_die ? idx : idx + 1;
|
||||
}
|
||||
bool isDead(dstate &state) {
|
||||
bool isDead(const dstate &state) {
|
||||
return raw_id(state.impl_id) == DEAD_STATE;
|
||||
}
|
||||
bool isDead(dstate_id_t idx) {
|
||||
@@ -117,7 +117,7 @@ struct dfa_info {
|
||||
}
|
||||
|
||||
private:
|
||||
static bool dfaCanDie(raw_dfa &rdfa) {
|
||||
static bool dfaCanDie(const raw_dfa &rdfa) {
|
||||
for (unsigned chr = 0; chr < 256; chr++) {
|
||||
for (dstate_id_t state = 0; state < rdfa.states.size(); state++) {
|
||||
auto succ = rdfa.states[state].next[rdfa.alpha_remap[chr]];
|
||||
@@ -138,7 +138,7 @@ struct raw_report_list {
|
||||
raw_report_list(const flat_set<ReportID> &reports_in,
|
||||
const ReportManager &rm, bool do_remap) {
|
||||
if (do_remap) {
|
||||
for (auto &id : reports_in) {
|
||||
for (const auto &id : reports_in) {
|
||||
reports.insert(rm.getProgramOffset(id));
|
||||
}
|
||||
} else {
|
||||
|
||||
@@ -227,7 +227,7 @@ const u8 *fwdBlock(SuperVector<S> shuf_mask_lo_highclear, SuperVector<S> shuf_ma
|
||||
}
|
||||
|
||||
template <uint16_t S>
|
||||
const u8 *truffleExecReal(m128 &shuf_mask_lo_highclear, m128 shuf_mask_lo_highset, const u8 *buf, const u8 *buf_end) {
|
||||
const u8 *truffleExecReal(const m128 &shuf_mask_lo_highclear, m128 shuf_mask_lo_highset, const u8 *buf, const u8 *buf_end) {
|
||||
assert(buf && buf_end);
|
||||
assert(buf < buf_end);
|
||||
DEBUG_PRINTF("truffle %p len %zu\n", buf, buf_end - buf);
|
||||
@@ -349,4 +349,4 @@ const u8 *rtruffleExecReal(m128 shuf_mask_lo_highclear, m128 shuf_mask_lo_highse
|
||||
|
||||
return buf - 1;
|
||||
}
|
||||
#endif //HAVE_SVE
|
||||
#endif //HAVE_SVE
|
||||
|
||||
Reference in New Issue
Block a user