mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2025-04-05 08:51:28 +00:00
[qfcc] Rename body_first to do_while
Since loops are always while or do-while (for loops are just while loops with an init block), it made more sense in the end.
This commit is contained in:
parent
2ef72f745d
commit
93d116cf16
4 changed files with 7 additions and 7 deletions
|
@ -354,7 +354,7 @@ typedef struct {
|
|||
const expr_t *body;
|
||||
const expr_t *break_label;
|
||||
const expr_t *continue_label;
|
||||
bool body_first; ///< true for do-while loops
|
||||
bool do_while;
|
||||
bool not;
|
||||
} ex_loop_t;
|
||||
|
||||
|
@ -947,7 +947,7 @@ expr_t *new_decl_expr (specifier_t spec, symtab_t *symtab);
|
|||
expr_t *append_decl (expr_t *decl, symbol_t *sym, const expr_t *init);
|
||||
expr_t *append_decl_list (expr_t *decl, const expr_t *list);
|
||||
|
||||
expr_t *new_loop_expr (bool not, bool body_first,
|
||||
expr_t *new_loop_expr (bool not, bool do_while,
|
||||
const expr_t *test, const expr_t *body,
|
||||
const expr_t *break_label, const expr_t *continue_label);
|
||||
|
||||
|
|
|
@ -2220,7 +2220,7 @@ new_decl_expr (specifier_t spec, symtab_t *symtab)
|
|||
}
|
||||
|
||||
expr_t *
|
||||
new_loop_expr (bool not, bool body_first,
|
||||
new_loop_expr (bool not, bool do_while,
|
||||
const expr_t *test, const expr_t *body,
|
||||
const expr_t *break_label, const expr_t *continue_label)
|
||||
{
|
||||
|
@ -2231,7 +2231,7 @@ new_loop_expr (bool not, bool body_first,
|
|||
.body = body,
|
||||
.break_label = break_label,
|
||||
.continue_label = continue_label,
|
||||
.body_first = body_first,
|
||||
.do_while = do_while,
|
||||
.not = not,
|
||||
};
|
||||
return loop;
|
||||
|
|
|
@ -367,10 +367,10 @@ proc_loop (const expr_t *expr)
|
|||
auto body = expr_process (expr->loop.body);
|
||||
auto break_label = expr->loop.break_label;
|
||||
auto continue_label = expr->loop.continue_label;
|
||||
bool body_first = expr->loop.body_first;
|
||||
bool do_while = expr->loop.do_while;
|
||||
bool not = expr->loop.not;
|
||||
scoped_src_loc (expr);
|
||||
return new_loop_expr (not, body_first, test, body,
|
||||
return new_loop_expr (not, do_while, test, body,
|
||||
break_label, continue_label);
|
||||
}
|
||||
|
||||
|
|
|
@ -1327,9 +1327,9 @@ spirv_loop (const expr_t *e, spirvctx_t *ctx)
|
|||
unsigned loop = spirv_id (ctx);
|
||||
unsigned merge = spirv_id (ctx);
|
||||
unsigned cont = spirv_id (ctx);
|
||||
if (e->loop.body_first) {
|
||||
spirv_Branch (loop, ctx);
|
||||
spirv_LabelId (loop, ctx);
|
||||
if (e->loop.do_while) {
|
||||
spirv_LoopMerge (merge, cont, ctx);
|
||||
spirv_SplitBlock (ctx);
|
||||
spirv_emit_expr (e->loop.body, ctx);
|
||||
|
|
Loading…
Reference in a new issue