mirror of
https://github.com/VectorCamp/vectorscan.git
synced 2025-06-28 16:41:01 +03:00
rose: delete literal_info requires_explode flag
This commit is contained in:
parent
f964801923
commit
c6b2563df6
@ -4660,14 +4660,8 @@ map<u32, u32> groupByFragment(const RoseBuildImpl &build) {
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Combining exploded fragments with others is unsafe.
|
|
||||||
const auto &info = build.literal_info[lit_id];
|
|
||||||
if (info.requires_explode) {
|
|
||||||
final_to_frag.emplace(final_id, frag_id++);
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Combining fragments that squash their groups is unsafe.
|
// Combining fragments that squash their groups is unsafe.
|
||||||
|
const auto &info = build.literal_info[lit_id];
|
||||||
if (info.squash_group) {
|
if (info.squash_group) {
|
||||||
final_to_frag.emplace(final_id, frag_id++);
|
final_to_frag.emplace(final_id, frag_id++);
|
||||||
continue;
|
continue;
|
||||||
|
@ -568,8 +568,6 @@ void promoteEodToFloating(RoseBuildImpl &tbi, const vector<u32> &eodLiterals) {
|
|||||||
tbi.g[v].literals.insert(floating_id);
|
tbi.g[v].literals.insert(floating_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
tbi.literal_info[floating_id].requires_explode
|
|
||||||
= tbi.literal_info[eod_id].requires_explode;
|
|
||||||
tbi.literal_info[floating_id].requires_benefits
|
tbi.literal_info[floating_id].requires_benefits
|
||||||
= tbi.literal_info[eod_id].requires_benefits;
|
= tbi.literal_info[eod_id].requires_benefits;
|
||||||
}
|
}
|
||||||
|
@ -265,7 +265,6 @@ struct rose_literal_info {
|
|||||||
u32 undelayed_id = MO_INVALID_IDX;
|
u32 undelayed_id = MO_INVALID_IDX;
|
||||||
u32 final_id = MO_INVALID_IDX; /* id reported by fdr */
|
u32 final_id = MO_INVALID_IDX; /* id reported by fdr */
|
||||||
bool squash_group = false;
|
bool squash_group = false;
|
||||||
bool requires_explode = false;
|
|
||||||
bool requires_benefits = false;
|
bool requires_benefits = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -408,7 +408,6 @@ void findMoreLiteralMasks(RoseBuildImpl &build) {
|
|||||||
lit_info.vertices.clear();
|
lit_info.vertices.clear();
|
||||||
|
|
||||||
// Preserve other properties.
|
// Preserve other properties.
|
||||||
new_info.requires_explode = lit_info.requires_explode;
|
|
||||||
new_info.requires_benefits = lit_info.requires_benefits;
|
new_info.requires_benefits = lit_info.requires_benefits;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -716,42 +715,12 @@ MatcherProto makeMatcherProto(const RoseBuildImpl &build,
|
|||||||
DEBUG_PRINTF("lit requires %zu bytes of history\n", lit_hist_len);
|
DEBUG_PRINTF("lit requires %zu bytes of history\n", lit_hist_len);
|
||||||
assert(lit_hist_len <= build.cc.grey.maxHistoryAvailable);
|
assert(lit_hist_len <= build.cc.grey.maxHistoryAvailable);
|
||||||
|
|
||||||
if (info.requires_explode) {
|
|
||||||
DEBUG_PRINTF("exploding lit\n");
|
|
||||||
|
|
||||||
// We do not require_explode for literals that need confirm
|
|
||||||
// (long/medium length literals).
|
|
||||||
assert(lit.length() <= ROSE_SHORT_LITERAL_LEN_MAX);
|
|
||||||
|
|
||||||
case_iter cit = caseIterateBegin(lit);
|
|
||||||
case_iter cite = caseIterateEnd();
|
|
||||||
for (; cit != cite; ++cit) {
|
|
||||||
string s = *cit;
|
|
||||||
bool nocase = false;
|
|
||||||
|
|
||||||
DEBUG_PRINTF("id=%u, s='%s', nocase=%d, noruns=%d msk=%s, "
|
|
||||||
"cmp=%s (exploded)\n",
|
|
||||||
final_id, escapeString(s).c_str(), nocase, noruns,
|
|
||||||
dumpMask(msk).c_str(), dumpMask(cmp).c_str());
|
|
||||||
|
|
||||||
if (!maskIsConsistent(s, nocase, msk, cmp)) {
|
|
||||||
DEBUG_PRINTF("msk/cmp for literal can't match, skipping\n");
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
mp.accel_lits.emplace_back(s, nocase, msk, cmp, groups);
|
|
||||||
mp.history_required = max(mp.history_required, lit_hist_len);
|
|
||||||
mp.lits.emplace_back(move(s), nocase, noruns, final_id, groups,
|
|
||||||
msk, cmp);
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
auto lit_final = lit; // copy
|
auto lit_final = lit; // copy
|
||||||
|
|
||||||
if (lit_final.length() > ROSE_SHORT_LITERAL_LEN_MAX) {
|
if (lit_final.length() > ROSE_SHORT_LITERAL_LEN_MAX) {
|
||||||
DEBUG_PRINTF("truncating to tail of length %zu\n",
|
DEBUG_PRINTF("truncating to tail of length %zu\n",
|
||||||
size_t{ROSE_SHORT_LITERAL_LEN_MAX});
|
size_t{ROSE_SHORT_LITERAL_LEN_MAX});
|
||||||
lit_final.erase(0, lit_final.length() -
|
lit_final.erase(0, lit_final.length() - ROSE_SHORT_LITERAL_LEN_MAX);
|
||||||
ROSE_SHORT_LITERAL_LEN_MAX);
|
|
||||||
// We shouldn't have set a threshold below 8 chars.
|
// We shouldn't have set a threshold below 8 chars.
|
||||||
assert(msk.size() <= ROSE_SHORT_LITERAL_LEN_MAX);
|
assert(msk.size() <= ROSE_SHORT_LITERAL_LEN_MAX);
|
||||||
assert(!noruns);
|
assert(!noruns);
|
||||||
@ -770,13 +739,12 @@ MatcherProto makeMatcherProto(const RoseBuildImpl &build,
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
mp.accel_lits.emplace_back(lit.get_string(), lit.any_nocase(), msk,
|
mp.accel_lits.emplace_back(lit.get_string(), lit.any_nocase(), msk, cmp,
|
||||||
cmp, groups);
|
groups);
|
||||||
mp.history_required = max(mp.history_required, lit_hist_len);
|
mp.history_required = max(mp.history_required, lit_hist_len);
|
||||||
mp.lits.emplace_back(move(s), nocase, noruns, final_id, groups, msk,
|
mp.lits.emplace_back(move(s), nocase, noruns, final_id, groups, msk,
|
||||||
cmp);
|
cmp);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
auto frag_group_map = makeFragGroupMap(build, final_to_frag_map);
|
auto frag_group_map = makeFragGroupMap(build, final_to_frag_map);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user