X-Git-Url: https://git.xonotic.org/?p=xonotic%2Fgmqcc.git;a=blobdiff_plain;f=ast.h;h=4720b402d4b3d4a9dbe28a209a604155e56db678;hp=52858ac7f132ce14372fe7e92570593e11d2071f;hb=3945f26d925046e4f15524d384a49bde5883c641;hpb=1d745fd1f9b0448a00140cef0b68d9a3aa73f1f1 diff --git a/ast.h b/ast.h index 52858ac..4720b40 100644 --- a/ast.h +++ b/ast.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2012, 2013 + * Copyright (C) 2012, 2013, 2014 * Wolfgang Bumiller * Dale Weiler * @@ -56,25 +56,37 @@ typedef struct ast_goto_s ast_goto; typedef struct ast_argpipe_s ast_argpipe; enum { - AST_FLAG_VARIADIC = 1 << 0, - AST_FLAG_NORETURN = 1 << 1, - AST_FLAG_INLINE = 1 << 2, - AST_FLAG_INITIALIZED = 1 << 3, - AST_FLAG_DEPRECATED = 1 << 4, - AST_FLAG_INCLUDE_DEF = 1 << 5, - AST_FLAG_IS_VARARG = 1 << 6, - AST_FLAG_ALIAS = 1 << 7, - AST_FLAG_ERASEABLE = 1 << 8, - AST_FLAG_ACCUMULATE = 1 << 9, - - /* - * An array declared as [] + AST_FLAG_VARIADIC = 1 << 0, + AST_FLAG_NORETURN = 1 << 1, + AST_FLAG_INLINE = 1 << 2, + AST_FLAG_INITIALIZED = 1 << 3, + AST_FLAG_DEPRECATED = 1 << 4, + AST_FLAG_INCLUDE_DEF = 1 << 5, + AST_FLAG_IS_VARARG = 1 << 6, + AST_FLAG_ALIAS = 1 << 7, + AST_FLAG_ERASEABLE = 1 << 8, + AST_FLAG_ACCUMULATE = 1 << 9, + + /* An array declared as [] * so that the size is taken from the initializer */ - AST_FLAG_ARRAY_INIT = 1 << 10, + AST_FLAG_ARRAY_INIT = 1 << 10, + + AST_FLAG_FINAL_DECL = 1 << 11, + + /* Several coverage options + * AST_FLAG_COVERAGE means there was an explicit [[coverage]] attribute, + * which will overwrite the default set via the commandline switches. + * BLOCK_COVERAGE inserts coverage() calls into every basic block. + * In the future there might be more options like tracking variable access + * by creating get/set wrapper functions. + */ + AST_FLAG_COVERAGE = 1 << 12, + AST_FLAG_BLOCK_COVERAGE = 1 << 13, AST_FLAG_LAST, - AST_FLAG_TYPE_MASK = (AST_FLAG_VARIADIC | AST_FLAG_NORETURN) + AST_FLAG_TYPE_MASK = (AST_FLAG_VARIADIC | AST_FLAG_NORETURN), + AST_FLAG_COVERAGE_MASK = (AST_FLAG_BLOCK_COVERAGE) }; enum { @@ -202,6 +214,7 @@ struct ast_value_s bool isfield; /* this declares a field */ bool isimm; /* an immediate, not just const */ bool hasvalue; + bool inexact; /* inexact coming from folded expression */ basic_value_t constval; /* for TYPE_ARRAY we have an optional vector * of constants when an initializer list @@ -625,6 +638,14 @@ struct ast_function_s int builtin; + /* list of used-up names for statics without the count suffix */ + char **static_names; + /* number of static variables, by convention this includes the + * ones without the count-suffix - remember this when dealing + * with savegames. uint instead of size_t as %zu in printf is + * C99, so no windows support. */ + unsigned int static_count; + ir_function *ir_func; ir_block *curblock; ir_block **breakblocks;