mirror of
https://github.com/DarkPlacesEngine/gmqcc.git
synced 2024-11-27 14:12:36 +00:00
Using GMQCC_WARN some more where it makes sense
This commit is contained in:
parent
86564686f3
commit
e4d92130da
2 changed files with 16 additions and 14 deletions
6
ir.c
6
ir.c
|
@ -1072,7 +1072,8 @@ static bool ir_naive_phi_emit_store(ir_block *block, size_t iid, ir_value *old,
|
||||||
size_t i;
|
size_t i;
|
||||||
|
|
||||||
/* create a store */
|
/* create a store */
|
||||||
ir_block_create_store(block, old, what);
|
if (!ir_block_create_store(block, old, what))
|
||||||
|
return false;
|
||||||
|
|
||||||
/* we now move it up */
|
/* we now move it up */
|
||||||
instr = block->instr[block->instr_count-1];
|
instr = block->instr[block->instr_count-1];
|
||||||
|
@ -1121,7 +1122,8 @@ static bool ir_block_naive_phi(ir_block *self)
|
||||||
/* If it originally wrote to a global we need to store the value
|
/* If it originally wrote to a global we need to store the value
|
||||||
* there as welli
|
* there as welli
|
||||||
*/
|
*/
|
||||||
ir_naive_phi_emit_store(self, i+1, old, v);
|
if (!ir_naive_phi_emit_store(self, i+1, old, v))
|
||||||
|
return false;
|
||||||
if (i+1 < self->instr_count)
|
if (i+1 < self->instr_count)
|
||||||
instr = self->instr[i+1];
|
instr = self->instr[i+1];
|
||||||
else
|
else
|
||||||
|
|
24
ir.h
24
ir.h
|
@ -70,10 +70,10 @@ void ir_value_set_name(ir_value*, const char *name);
|
||||||
MEM_VECTOR_PROTO_ALL(ir_value, struct ir_instr_s*, reads)
|
MEM_VECTOR_PROTO_ALL(ir_value, struct ir_instr_s*, reads)
|
||||||
MEM_VECTOR_PROTO_ALL(ir_value, struct ir_instr_s*, writes)
|
MEM_VECTOR_PROTO_ALL(ir_value, struct ir_instr_s*, writes)
|
||||||
|
|
||||||
bool ir_value_set_float(ir_value*, float f);
|
bool GMQCC_WARN ir_value_set_float(ir_value*, float f);
|
||||||
bool ir_value_set_int(ir_value*, int i);
|
bool GMQCC_WARN ir_value_set_int(ir_value*, int i);
|
||||||
bool ir_value_set_string(ir_value*, const char *s);
|
bool GMQCC_WARN ir_value_set_string(ir_value*, const char *s);
|
||||||
bool ir_value_set_vector(ir_value*, vector_t v);
|
bool GMQCC_WARN ir_value_set_vector(ir_value*, vector_t v);
|
||||||
/*bool ir_value_set_pointer_v(ir_value*, ir_value* p); */
|
/*bool ir_value_set_pointer_v(ir_value*, ir_value* p); */
|
||||||
/*bool ir_value_set_pointer_i(ir_value*, int i); */
|
/*bool ir_value_set_pointer_i(ir_value*, int i); */
|
||||||
|
|
||||||
|
@ -148,8 +148,8 @@ MEM_VECTOR_PROTO_ALL(ir_block, ir_block*, entries)
|
||||||
|
|
||||||
ir_value* ir_block_create_binop(ir_block*, const char *label, int op,
|
ir_value* ir_block_create_binop(ir_block*, const char *label, int op,
|
||||||
ir_value *left, ir_value *right);
|
ir_value *left, ir_value *right);
|
||||||
bool ir_block_create_store_op(ir_block*, int op, ir_value *target, ir_value *what);
|
bool GMQCC_WARN ir_block_create_store_op(ir_block*, int op, ir_value *target, ir_value *what);
|
||||||
bool ir_block_create_store(ir_block*, ir_value *target, ir_value *what);
|
bool GMQCC_WARN ir_block_create_store(ir_block*, ir_value *target, ir_value *what);
|
||||||
|
|
||||||
ir_value* ir_block_create_add(ir_block*, const char *label, ir_value *l, ir_value *r);
|
ir_value* ir_block_create_add(ir_block*, const char *label, ir_value *l, ir_value *r);
|
||||||
ir_value* ir_block_create_sub(ir_block*, const char *label, ir_value *l, ir_value *r);
|
ir_value* ir_block_create_sub(ir_block*, const char *label, ir_value *l, ir_value *r);
|
||||||
|
@ -157,11 +157,11 @@ ir_value* ir_block_create_mul(ir_block*, const char *label, ir_value *l, ir_valu
|
||||||
ir_value* ir_block_create_div(ir_block*, const char *label, ir_value *l, ir_value *r);
|
ir_value* ir_block_create_div(ir_block*, const char *label, ir_value *l, ir_value *r);
|
||||||
ir_instr* ir_block_create_phi(ir_block*, const char *label, int vtype);
|
ir_instr* ir_block_create_phi(ir_block*, const char *label, int vtype);
|
||||||
ir_value* ir_phi_value(ir_instr*);
|
ir_value* ir_phi_value(ir_instr*);
|
||||||
bool ir_phi_add(ir_instr*, ir_block *b, ir_value *v);
|
bool GMQCC_WARN ir_phi_add(ir_instr*, ir_block *b, ir_value *v);
|
||||||
|
|
||||||
bool ir_block_create_return(ir_block*, ir_value *opt_value);
|
bool GMQCC_WARN ir_block_create_return(ir_block*, ir_value *opt_value);
|
||||||
|
|
||||||
bool ir_block_create_if(ir_block*, ir_value *cond,
|
bool GMQCC_WARN ir_block_create_if(ir_block*, ir_value *cond,
|
||||||
ir_block *ontrue, ir_block *onfalse);
|
ir_block *ontrue, ir_block *onfalse);
|
||||||
/* A 'goto' is an actual 'goto' coded in QC, whereas
|
/* A 'goto' is an actual 'goto' coded in QC, whereas
|
||||||
* a 'jump' is a virtual construct which simply names the
|
* a 'jump' is a virtual construct which simply names the
|
||||||
|
@ -169,8 +169,8 @@ bool ir_block_create_if(ir_block*, ir_value *cond,
|
||||||
* A goto usually becomes an OP_GOTO in the resulting code,
|
* A goto usually becomes an OP_GOTO in the resulting code,
|
||||||
* whereas a 'jump' usually doesn't add any actual instruction.
|
* whereas a 'jump' usually doesn't add any actual instruction.
|
||||||
*/
|
*/
|
||||||
bool ir_block_create_jump(ir_block*, ir_block *to);
|
bool GMQCC_WARN ir_block_create_jump(ir_block*, ir_block *to);
|
||||||
bool ir_block_create_goto(ir_block*, ir_block *to);
|
bool GMQCC_WARN ir_block_create_goto(ir_block*, ir_block *to);
|
||||||
|
|
||||||
MEM_VECTOR_PROTO_ALL(ir_block, ir_value*, living)
|
MEM_VECTOR_PROTO_ALL(ir_block, ir_value*, living)
|
||||||
|
|
||||||
|
@ -217,7 +217,7 @@ MEM_VECTOR_PROTO(ir_function, ir_block*, blocks)
|
||||||
ir_value* ir_function_get_local(ir_function *self, const char *name);
|
ir_value* ir_function_get_local(ir_function *self, const char *name);
|
||||||
ir_value* ir_function_create_local(ir_function *self, const char *name, int vtype);
|
ir_value* ir_function_create_local(ir_function *self, const char *name, int vtype);
|
||||||
|
|
||||||
bool ir_function_finalize(ir_function*);
|
bool GMQCC_WARN ir_function_finalize(ir_function*);
|
||||||
/*
|
/*
|
||||||
bool ir_function_naive_phi(ir_function*);
|
bool ir_function_naive_phi(ir_function*);
|
||||||
bool ir_function_enumerate(ir_function*);
|
bool ir_function_enumerate(ir_function*);
|
||||||
|
|
Loading…
Reference in a new issue