mpv: native report remapping

This commit is contained in:
Justin Viiret
2016-04-19 15:22:20 +10:00
committed by Matthew Barr
parent c101beb541
commit ee7f31ac39
3 changed files with 27 additions and 26 deletions

View File

@@ -1333,16 +1333,6 @@ aligned_unique_ptr<NFA> buildOutfix(RoseBuildImpl &build, OutfixInfo &outfix) {
return n;
}
static
void remapReportsToPrograms(MpvProto &mpv, const ReportManager &rm) {
for (auto &puff : mpv.puffettes) {
puff.report = rm.getProgramOffset(puff.report);
}
for (auto &puff : mpv.triggered_puffettes) {
puff.report = rm.getProgramOffset(puff.report);
}
}
static
void prepMpv(RoseBuildImpl &tbi, build_context &bc, size_t *historyRequired,
bool *mpv_as_outfix) {
@@ -1365,9 +1355,7 @@ void prepMpv(RoseBuildImpl &tbi, build_context &bc, size_t *historyRequired,
}
auto *mpv = mpv_outfix->mpv();
auto tmp = *mpv; // copy
remapReportsToPrograms(tmp, tbi.rm);
auto nfa = mpvCompile(tmp.puffettes, tmp.triggered_puffettes);
auto nfa = mpvCompile(mpv->puffettes, mpv->triggered_puffettes, tbi.rm);
assert(nfa);
if (!nfa) {
throw CompileError("Unable to generate bytecode.");