From: Wolfgang (Blub) Bumiller Date: Thu, 26 Apr 2012 08:16:15 +0000 (+0200) Subject: qbool -> bool X-Git-Tag: 0.1-rc1~593 X-Git-Url: https://de.git.xonotic.org/?a=commitdiff_plain;h=13ec68bc4fe00f52bedf49ee35afcd7cea2584c2;hp=234567cb9fd0d1dc32d50202b10ab7ce75d31f09;p=xonotic%2Fgmqcc.git qbool -> bool --- diff --git a/ast.h b/ast.h index 7db57b4..1e2f0d1 100644 --- a/ast.h +++ b/ast.h @@ -55,9 +55,9 @@ typedef struct * Any expression or block returns an ir_value, and needs * to know the current function. */ -typedef qbool ast_expression_codegen(ast_expression*, - ast_function*, - ir_value**); +typedef bool ast_expression_codegen(ast_expression*, + ast_function*, + ir_value**); typedef struct { ast_node_common node; @@ -80,7 +80,7 @@ struct ast_value_s int vtype; ast_value *next; - qbool isconst; + bool isconst; union { double vfloat; int vint; @@ -102,7 +102,7 @@ void ast_value_delete(ast_value*); void ast_value_set_name(ast_value*, const char *name); -qbool ast_value_codegen(ast_value*, ast_function*, ir_value**); +bool ast_value_codegen(ast_value*, ast_function*, ir_value**); /* Binary * @@ -123,14 +123,14 @@ ast_binary* ast_binary_new(lex_ctx_t ctx, void ast_binary_delete(ast_binary*); /* hmm, seperate functions? */ -qbool ast_bin_add_codegen(ast_binary*, ir_function*, ir_value**); +bool ast_bin_add_codegen(ast_binary*, ir_function*, ir_value**); /* ... */ /* maybe for this one */ -qbool ast_bin_store_codegen(ast_binary*, ir_function*, ir_value**); +bool ast_bin_store_codegen(ast_binary*, ir_function*, ir_value**); /* could decide what to use */ -qbool ast_binary_codegen(ast_binary*, ir_function*, ir_value**); +bool ast_binary_codegen(ast_binary*, ir_function*, ir_value**); /* Blocks * @@ -148,7 +148,7 @@ void ast_block_delete(ast_block*); MEM_VECTOR_PROTO(ast_block, ast_value*, locals); MEM_VECTOR_PROTO(ast_block, ast_expression*, exprs); -qbool ast_block_codegen(ast_block*, ir_function*, ir_value**); +bool ast_block_codegen(ast_block*, ir_function*, ir_value**); /* Function * @@ -174,7 +174,7 @@ void ast_function_delete(ast_function*); MEM_VECTOR_PROTO(ast_function, ast_block*, blocks); -qbool ast_function_codegen(ast_function *self, ir_builder *builder); +bool ast_function_codegen(ast_function *self, ir_builder *builder); /* Expression union */ diff --git a/astir.h b/astir.h index de0ffc0..6b3d2e5 100644 --- a/astir.h +++ b/astir.h @@ -29,7 +29,7 @@ #define MEM_VECTOR_PROTO_ALL(Towner, Tmem, mem) \ MEM_VECTOR_PROTO(Towner, Tmem, mem) \ - qbool Towner##_##mem##_find(Towner*, Tmem, size_t*); \ + bool Towner##_##mem##_find(Towner*, Tmem, size_t*); \ void Towner##_##mem##_clear(Towner*); #define MEM_VECTOR_MAKE(Twhat, name) \ @@ -69,7 +69,7 @@ void Tself##_##mem##_remove(Tself *self, size_t idx) \ } #define _MEM_VEC_FUN_FIND(Tself, Twhat, mem) \ -qbool Tself##_##mem##_find(Tself *self, Twhat obj, size_t *idx) \ +bool Tself##_##mem##_find(Tself *self, Twhat obj, size_t *idx) \ { \ size_t i; \ for (i = 0; i < self->mem##_count; ++i) { \ @@ -116,8 +116,6 @@ MEM_VEC_FUNCTIONS(Tself, Twhat, mem) \ _MEM_VEC_FUN_CLEAR(Tself, mem) \ _MEM_VEC_FUN_FIND(Tself, Twhat, mem) -typedef enum { false, true } qbool; - enum qc_types { /* Main QC types */ qc_void, diff --git a/ir.c b/ir.c index b17d329..f82d95e 100644 --- a/ir.c +++ b/ir.c @@ -299,7 +299,7 @@ void ir_instr_delete(ir_instr *self) mem_d(self); } -void ir_instr_op(ir_instr *self, int op, ir_value *v, qbool writing) +void ir_instr_op(ir_instr *self, int op, ir_value *v, bool writing) { if (self->_ops[op]) { if (writing) @@ -369,7 +369,7 @@ void ir_value_set_name(ir_value *self, const char *name) self->name = util_strdup(name); } -qbool ir_value_set_float(ir_value *self, float f) +bool ir_value_set_float(ir_value *self, float f) { if (self->vtype != qc_float) return false; @@ -378,7 +378,7 @@ qbool ir_value_set_float(ir_value *self, float f) return true; } -qbool ir_value_set_vector(ir_value *self, vector_t v) +bool ir_value_set_vector(ir_value *self, vector_t v) { if (self->vtype != qc_vector) return false; @@ -387,7 +387,7 @@ qbool ir_value_set_vector(ir_value *self, vector_t v) return true; } -qbool ir_value_set_string(ir_value *self, const char *str) +bool ir_value_set_string(ir_value *self, const char *str) { if (self->vtype != qc_string) return false; @@ -396,7 +396,7 @@ qbool ir_value_set_string(ir_value *self, const char *str) return true; } -qbool ir_value_set_int(ir_value *self, int i) +bool ir_value_set_int(ir_value *self, int i) { if (self->vtype != qc_int) return false; @@ -405,7 +405,7 @@ qbool ir_value_set_int(ir_value *self, int i) return true; } -qbool ir_value_lives(ir_value *self, size_t at) +bool ir_value_lives(ir_value *self, size_t at) { size_t i; for (i = 0; i < self->life_count; ++i) @@ -428,7 +428,7 @@ void ir_value_life_insert(ir_value *self, size_t idx, ir_life_entry_t e) self->life[idx] = e; } -qbool ir_value_life_merge(ir_value *self, size_t s) +bool ir_value_life_merge(ir_value *self, size_t s) { size_t i; ir_life_entry_t *life = NULL; @@ -495,7 +495,7 @@ qbool ir_value_life_merge(ir_value *self, size_t s) *IR main operations */ -qbool ir_block_create_store_op(ir_block *self, int op, ir_value *target, ir_value *what) +bool ir_block_create_store_op(ir_block *self, int op, ir_value *target, ir_value *what) { if (target->store == store_value) { fprintf(stderr, "cannot store to an SSA value\n"); @@ -509,7 +509,7 @@ qbool ir_block_create_store_op(ir_block *self, int op, ir_value *target, ir_valu } } -qbool ir_block_create_store(ir_block *self, ir_value *target, ir_value *what) +bool ir_block_create_store(ir_block *self, ir_value *target, ir_value *what) { int op = 0; int vtype; @@ -1057,11 +1057,11 @@ void ir_function_enumerate(ir_function *self) } } -static void ir_block_life_propagate(ir_block *b, ir_block *prev, qbool *changed); +static void ir_block_life_propagate(ir_block *b, ir_block *prev, bool *changed); void ir_function_calculate_liferanges(ir_function *self) { size_t i; - qbool changed; + bool changed; do { self->run_id++; @@ -1104,11 +1104,11 @@ static void ir_op_read_write(int op, size_t *read, size_t *write) }; } -static qbool ir_block_living_add_instr(ir_block *self, size_t eid) +static bool ir_block_living_add_instr(ir_block *self, size_t eid) { size_t i; - qbool changed = false; - qbool tempbool; + bool changed = false; + bool tempbool; for (i = 0; i != self->living_count; ++i) { tempbool = ir_value_life_merge(self->living[i], eid); @@ -1121,7 +1121,7 @@ static qbool ir_block_living_add_instr(ir_block *self, size_t eid) return changed; } -static void ir_block_life_prop_previous(ir_block* self, ir_block *prev, qbool *changed) +static void ir_block_life_prop_previous(ir_block* self, ir_block *prev, bool *changed) { size_t i; /* values which have been read in a previous iteration are now @@ -1152,11 +1152,11 @@ static void ir_block_life_prop_previous(ir_block* self, ir_block *prev, qbool *c } } -static void ir_block_life_propagate(ir_block *self, ir_block *prev, qbool *changed) +static void ir_block_life_propagate(ir_block *self, ir_block *prev, bool *changed) { ir_instr *instr; ir_value *value; - qbool tempbool; + bool tempbool; size_t i, o, p, rd; /* bitmasks which operands are read from or written to */ size_t read, write; @@ -1223,8 +1223,8 @@ static void ir_block_life_propagate(ir_block *self, ir_block *prev, qbool *chang if (write & (1<