]> de.git.xonotic.org Git - xonotic/gmqcc.git/blobdiff - gmqcc.h
Cache lengths in corrector. This speeds up the corrector a little.
[xonotic/gmqcc.git] / gmqcc.h
diff --git a/gmqcc.h b/gmqcc.h
index 0b97e2f40c4d6fb9f8f55c4f8df96cd45be55224..51c2dccbdc1dc41a8e7d5b4916292d79f7dc14f5 100644 (file)
--- a/gmqcc.h
+++ b/gmqcc.h
@@ -102,8 +102,10 @@ GMQCC_IND_STRING(GMQCC_VERSION_PATCH) \
  */
 #if defined(__GNUC__) || defined(__CLANG__)
 #   define GMQCC_WARN __attribute__((warn_unused_result))
+#   define GMQCC_USED __attribute__((used))
 #else
 #   define GMQCC_WARN
+#   define GMQCC_USED
 #endif
 /*
  * This is a hack to silent clang regarding empty
@@ -451,7 +453,8 @@ GMQCC_INLINE FILE   *file_open   (const char *, const char *);
 /*=========================== correct.c =============================*/
 /*===================================================================*/
 typedef struct {
-    char ***edits;
+    char   ***edits;
+    size_t  **lens;
 } correction_t;
 
 void  correct_del (correct_trie_t*, size_t **);
@@ -681,17 +684,11 @@ enum {
     INSTR_BITAND,
     INSTR_BITOR,
 
-    /*
-     * Virtual instructions used by the assembler
-     * keep at the end but before virtual instructions
-     * for the IR below.
-     */
-    AINSTR_END,
-
     /*
      * Virtual instructions used by the IR
      * Keep at the end!
      */
+    VINSTR_END,
     VINSTR_PHI,
     VINSTR_JUMP,
     VINSTR_COND,
@@ -1132,15 +1129,13 @@ enum {
     OPTION_COUNT
 };
 
-/* disabled for now */
-#if 0
-static const char *opts_options_descriptions[OPTION_COUNT + 1] = {
+
+GMQCC_USED static const char *opts_options_descriptions[] = {
 #   define GMQCC_TYPE_OPTIONS
 #   define GMQCC_DEFINE_FLAG(X, Y) Y,
 #   include "opts.def"
     ""
 };
-#endif
 
 extern unsigned int opts_optimizationcount[COUNT_OPTIMIZATIONS];
 
@@ -1152,13 +1147,6 @@ typedef enum {
     COMPILER_GMQCC    /* this   QuakeC */
 } opts_std_t;
 
-typedef enum {
-    OPT_TYPE_BOOL,
-    OPT_TYPE_U16,
-    OPT_TYPE_U32,
-    OPT_TYPE_STR
-} opt_type_t;
-
 typedef union {
     bool     B;
     uint16_t U16;