]> git.ipfire.org Git - thirdparty/vectorscan.git/commitdiff
limex_dump: dump LimEx type and flags in text
authorJustin Viiret <justin.viiret@intel.com>
Mon, 3 Apr 2017 02:30:30 +0000 (12:30 +1000)
committerMatthew Barr <matthew.barr@intel.com>
Wed, 26 Apr 2017 05:19:35 +0000 (15:19 +1000)
src/nfa/limex_dump.cpp

index 852639ea3c35cc9647846bbbe7a9cbdf3d190453..797e87ba2580be3a4091f81e0b01518290145a34 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015-2016, Intel Corporation
+ * Copyright (c) 2015-2017, Intel Corporation
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are met:
@@ -290,6 +290,20 @@ static
 void dumpLimexText(const limex_type *limex, FILE *f) {
     u32 size = limex_traits<limex_type>::size;
 
+    fprintf(f, "%u-bit LimEx NFA (%u shifts, %u exceptions)\n", size,
+            limex->shiftCount, limex->exceptionCount);
+    fprintf(f, "flags: ");
+    if (limex->flags & LIMEX_FLAG_COMPRESS_STATE) {
+        fprintf(f, "COMPRESS_STATE ");
+    }
+    if (limex->flags & LIMEX_FLAG_COMPRESS_MASKED) {
+        fprintf(f, "COMPRESS_MASKED ");
+    }
+    if (limex->flags & LIMEX_FLAG_CANNOT_DIE) {
+        fprintf(f, "CANNOT_DIE ");
+    }
+    fprintf(f, "\n\n");
+
     dumpMask(f, "init", (const u8 *)&limex->init, size);
     dumpMask(f, "init_dot_star", (const u8 *)&limex->initDS, size);
     dumpMask(f, "accept", (const u8 *)&limex->accept, size);