X-Git-Url: https://git.xonotic.org/?a=blobdiff_plain;ds=sidebyside;f=gmqcc.h;h=9848f20bbc19067d69cc0043e523fb7a4abe3236;hb=6bd6379c87fe82b8e0169fdd2065830f0c4688b3;hp=36406a26ea22020ea0f37e7343aa16940b1dd98f;hpb=834e8d0d7d387a0bd6aaad70a1146d49fd397d67;p=xonotic%2Fgmqcc.git diff --git a/gmqcc.h b/gmqcc.h index 36406a2..9848f20 100644 --- a/gmqcc.h +++ b/gmqcc.h @@ -332,7 +332,6 @@ void *stat_mem_allocate (size_t, size_t, const char *); bool util_filexists (const char *); bool util_strupper (const char *); bool util_strdigit (const char *); -void util_debug (const char *, const char *, ...); void util_endianswap (void *, size_t, unsigned int); size_t util_strtocmd (const char *, char *, size_t); @@ -713,11 +712,24 @@ enum { VINSTR_PHI, VINSTR_JUMP, VINSTR_COND, + /* A never returning CALL. * Creating this causes IR blocks to be marked as 'final'. * No-Return-Call */ - VINSTR_NRCALL + VINSTR_NRCALL, + + /* Emulated instructions. */ + VINSTR_BITAND_V, /* BITAND_V must be the first emulated bitop */ + VINSTR_BITAND_VF, + VINSTR_BITOR_V, + VINSTR_BITOR_VF, + VINSTR_BITXOR, + VINSTR_BITXOR_V, + VINSTR_BITXOR_VF, + VINSTR_CROSS, + VINSTR_NEG_F, + VINSTR_NEG_V }; /* TODO: elide */ @@ -731,6 +743,7 @@ typedef uint32_t qcuint_t; typedef struct { prog_section_statement_t *statements; int *linenums; + int *columnnums; prog_section_def_t *defs; prog_section_field_t *fields; prog_section_function_t *functions; @@ -742,6 +755,16 @@ typedef struct { qcint_t string_cached_empty; } code_t; +/* + * A shallow copy of a lex_file to remember where which ast node + * came from. + */ +typedef struct { + const char *file; + size_t line; + size_t column; +} lex_ctx_t; + /* * code_write -- writes out the compiled file * code_init -- prepares the code file @@ -756,18 +779,9 @@ code_t *code_init (void); void code_cleanup (code_t *); uint32_t code_genstring (code_t *, const char *string); qcint_t code_alloc_field (code_t *, size_t qcsize); -void code_push_statement(code_t *, prog_section_statement_t *stmt, int linenum); +void code_push_statement(code_t *, prog_section_statement_t *stmt, lex_ctx_t ctx); void code_pop_statement (code_t *); -/* - * A shallow copy of a lex_file to remember where which ast node - * came from. - */ -typedef struct { - const char *file; - size_t line; - size_t column; -} lex_ctx_t; /*===================================================================*/ /*============================ con.c ================================*/