dfa: only accel init states from smwr path

If the small-write DFA has been built from literals, then we only need
to look for accel states at init.
This commit is contained in:
Justin Viiret
2017-04-11 10:56:22 +10:00
committed by Matthew Barr
parent 41d7aa8281
commit 0dd8536c6e
11 changed files with 57 additions and 33 deletions

View File

@@ -45,8 +45,9 @@ struct raw_dfa;
class sheng_build_strat : public accel_dfa_build_strat {
public:
sheng_build_strat(raw_dfa &rdfa_in, const ReportManager &rm_in)
: accel_dfa_build_strat(rm_in), rdfa(rdfa_in) {}
sheng_build_strat(raw_dfa &rdfa_in, const ReportManager &rm_in,
bool only_accel_init_in)
: accel_dfa_build_strat(rm_in, only_accel_init_in), rdfa(rdfa_in) {}
raw_dfa &get_raw() const override { return rdfa; }
std::unique_ptr<raw_report_info> gatherReports(
std::vector<u32> &reports /* out */,
@@ -63,7 +64,7 @@ private:
};
bytecode_ptr<NFA> shengCompile(raw_dfa &raw, const CompileContext &cc,
const ReportManager &rm,
const ReportManager &rm, bool only_accel_init,
std::set<dstate_id_t> *accel_states = nullptr);
struct sheng_escape_info {