]> git.ipfire.org Git - thirdparty/vectorscan.git/commitdiff
rose: eliminate roseSize, use bytecode_ptr size
authorJustin Viiret <justin.viiret@intel.com>
Wed, 5 Apr 2017 00:29:22 +0000 (10:29 +1000)
committerMatthew Barr <matthew.barr@intel.com>
Wed, 26 Apr 2017 05:19:43 +0000 (15:19 +1000)
src/compiler/compiler.cpp
src/rose/rose_build.h
src/rose/rose_build_bytecode.cpp
src/rose/rose_build_misc.cpp

index b2deae3273b0b6976c4a586c5468ee5fd842e05f..9b726f777ef07cf1bb6d2c64b212a202eb067cb4 100644 (file)
@@ -362,7 +362,7 @@ struct hs_database *build(NG &ng, unsigned int *length) {
     if (!rose) {
         throw CompileError("Unable to generate bytecode.");
     }
-    *length = roseSize(rose.get());
+    *length = rose.size();
     if (!*length) {
         DEBUG_PRINTF("RoseEngine has zero length\n");
         assert(0);
index a14ea8ff21e5c4cd5e54b2af2c8f7fe901785ad6..cbb925f79d79657b70a3ed693c741c529df33163 100644 (file)
@@ -134,8 +134,6 @@ std::unique_ptr<RoseBuild> makeRoseBuilder(ReportManager &rm,
 bool roseCheckRose(const RoseInGraph &ig, bool prefilter,
                    const ReportManager &rm, const CompileContext &cc);
 
-size_t roseSize(const RoseEngine *t);
-
 /* used by heuristics to determine the small write engine. High numbers are
  * intended to indicate a lightweight rose. */
 u32 roseQuality(const RoseEngine *t);
index 98e1ef704d71d1e94790674d8bd2b1ceae59073c..dad00cd66ca5b21c23e82253a9f5a00d30ed7e7d 100644 (file)
@@ -5603,7 +5603,7 @@ bytecode_ptr<RoseEngine> addSmallWriteEngine(const RoseBuildImpl &build,
         return rose;
     }
 
-    const size_t mainSize = roseSize(rose.get());
+    const size_t mainSize = rose.size();
     const size_t smallWriteSize = smwr_engine.size();
     DEBUG_PRINTF("adding smwr engine, size=%zu\n", smallWriteSize);
 
index ef650714abed6aacea01cc3a3956272eff4ab265..1e353a587127afb0fe7eefd1680bd452b5750dd4 100644 (file)
@@ -239,11 +239,6 @@ unique_ptr<RoseBuild> makeRoseBuilder(ReportManager &rm,
     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) {
     return t->runtimeImpl == ROSE_RUNTIME_PURE_LITERAL;
 }