mirror of
https://github.com/VectorCamp/vectorscan.git
synced 2025-11-16 01:12:15 +03:00
Merge branch 'develop' into wip-isildur-g-cppcheck66
This commit is contained in:
@@ -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;
|
||||
@@ -1495,7 +1495,7 @@ void findExclusiveInfixes(RoseBuildImpl &build, build_context &bc,
|
||||
}
|
||||
|
||||
static
|
||||
bool buildLeftfixes(RoseBuildImpl &tbi, build_context &bc,
|
||||
void buildLeftfixes(RoseBuildImpl &tbi, build_context &bc,
|
||||
QueueIndexFactory &qif, set<u32> *no_retrigger_queues,
|
||||
set<u32> *eager_queues, bool do_prefix) {
|
||||
RoseGraph &g = tbi.g;
|
||||
@@ -1581,7 +1581,7 @@ bool buildLeftfixes(RoseBuildImpl &tbi, build_context &bc,
|
||||
leftfix);
|
||||
}
|
||||
|
||||
return true;
|
||||
return ;
|
||||
}
|
||||
|
||||
static
|
||||
@@ -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;
|
||||
@@ -2059,16 +2059,8 @@ bool buildNfas(RoseBuildImpl &tbi, build_context &bc, QueueIndexFactory &qif,
|
||||
suffixTriggers.clear();
|
||||
|
||||
*leftfixBeginQueue = qif.allocated_count();
|
||||
|
||||
if (!buildLeftfixes(tbi, bc, qif, no_retrigger_queues, eager_queues,
|
||||
true)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!buildLeftfixes(tbi, bc, qif, no_retrigger_queues, eager_queues,
|
||||
false)) {
|
||||
return false;
|
||||
}
|
||||
buildLeftfixes(tbi, bc, qif, no_retrigger_queues, eager_queues,true);
|
||||
buildLeftfixes(tbi, bc, qif, no_retrigger_queues, eager_queues,false);
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -2251,10 +2243,9 @@ vector<u32> buildSuffixEkeyLists(const RoseBuildImpl &build, build_context &bc,
|
||||
|
||||
/* for each outfix also build elists */
|
||||
for (const auto &outfix : build.outfixes) {
|
||||
u32 qi = outfix.get_queue();
|
||||
set<u32> ekeys = reportsToEkeys(all_reports(outfix), build.rm);
|
||||
|
||||
if (!ekeys.empty()) {
|
||||
u32 qi = outfix.get_queue();
|
||||
qi_to_ekeys[qi] = {ekeys.begin(), ekeys.end()};
|
||||
}
|
||||
}
|
||||
@@ -2728,7 +2719,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,9 +2964,10 @@ 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());
|
||||
!pfrag.s.any_nocase() == !cfrag.s.any_nocase());
|
||||
/** !pfrag.s.any_nocase() >= !cfrag.s.any_nocase()); **/
|
||||
u32 child_offset = cfrag.lit_program_offset;
|
||||
DEBUG_PRINTF("child %u offset %u\n", cfrag.fragment_id,
|
||||
child_offset);
|
||||
@@ -2992,8 +2984,9 @@ 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];
|
||||
assert(pfrag.s.length() >= cfrag.s.length() &&
|
||||
const auto &cfrag = fragments[pfrag.included_frag_id];
|
||||
/** assert(pfrag.s.length() >= cfrag.s.length() && **/
|
||||
assert(pfrag.s.length() == cfrag.s.length() &&
|
||||
!pfrag.s.any_nocase() >= !cfrag.s.any_nocase());
|
||||
u32 child_offset = cfrag.delay_program_offset;
|
||||
DEBUG_PRINTF("child %u offset %u\n", cfrag.fragment_id,
|
||||
@@ -3011,7 +3004,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);
|
||||
|
||||
Reference in New Issue
Block a user