rose: eliminate roseSize, use bytecode_ptr size

This commit is contained in:
Justin Viiret 2017-04-05 10:29:22 +10:00 committed by Matthew Barr
parent 820f1432aa
commit 3e5a8c9c90
4 changed files with 2 additions and 9 deletions

View File

@ -362,7 +362,7 @@ struct hs_database *build(NG &ng, unsigned int *length) {
if (!rose) { if (!rose) {
throw CompileError("Unable to generate bytecode."); throw CompileError("Unable to generate bytecode.");
} }
*length = roseSize(rose.get()); *length = rose.size();
if (!*length) { if (!*length) {
DEBUG_PRINTF("RoseEngine has zero length\n"); DEBUG_PRINTF("RoseEngine has zero length\n");
assert(0); assert(0);

View File

@ -134,8 +134,6 @@ std::unique_ptr<RoseBuild> makeRoseBuilder(ReportManager &rm,
bool roseCheckRose(const RoseInGraph &ig, bool prefilter, bool roseCheckRose(const RoseInGraph &ig, bool prefilter,
const ReportManager &rm, const CompileContext &cc); const ReportManager &rm, const CompileContext &cc);
size_t roseSize(const RoseEngine *t);
/* used by heuristics to determine the small write engine. High numbers are /* used by heuristics to determine the small write engine. High numbers are
* intended to indicate a lightweight rose. */ * intended to indicate a lightweight rose. */
u32 roseQuality(const RoseEngine *t); u32 roseQuality(const RoseEngine *t);

View File

@ -5603,7 +5603,7 @@ bytecode_ptr<RoseEngine> addSmallWriteEngine(const RoseBuildImpl &build,
return rose; return rose;
} }
const size_t mainSize = roseSize(rose.get()); const size_t mainSize = rose.size();
const size_t smallWriteSize = smwr_engine.size(); const size_t smallWriteSize = smwr_engine.size();
DEBUG_PRINTF("adding smwr engine, size=%zu\n", smallWriteSize); DEBUG_PRINTF("adding smwr engine, size=%zu\n", smallWriteSize);

View File

@ -239,11 +239,6 @@ unique_ptr<RoseBuild> makeRoseBuilder(ReportManager &rm,
return ue2::make_unique<RoseBuildImpl>(rm, ssm, smwr, cc, boundary); return ue2::make_unique<RoseBuildImpl>(rm, ssm, smwr, cc, boundary);
} }
size_t roseSize(const RoseEngine *t) {
assert(t);
return t->size;
}
bool roseIsPureLiteral(const RoseEngine *t) { bool roseIsPureLiteral(const RoseEngine *t) {
return t->runtimeImpl == ROSE_RUNTIME_PURE_LITERAL; return t->runtimeImpl == ROSE_RUNTIME_PURE_LITERAL;
} }