From e86ba7844fb1acd5f2d48558d0b8bb449e785ff8 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Bernhard=20Rosenkr=C3=A4nzer?= Date: Wed, 10 Feb 2016 17:19:46 +0100 Subject: [PATCH] freedreno/ir3: Get rid of nested functions MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit This allows building Freedreno with clang Signed-off-by: Bernhard Rosenkränzer Signed-off-by: Rob Clark --- src/gallium/drivers/freedreno/ir3/ir3_ra.c | 30 +++++++++++----------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/src/gallium/drivers/freedreno/ir3/ir3_ra.c b/src/gallium/drivers/freedreno/ir3/ir3_ra.c index 2ed78818e61..bcad96e8a30 100644 --- a/src/gallium/drivers/freedreno/ir3/ir3_ra.c +++ b/src/gallium/drivers/freedreno/ir3/ir3_ra.c @@ -605,21 +605,21 @@ ra_block_compute_live_ranges(struct ir3_ra_ctx *ctx, struct ir3_block *block) struct ir3_ra_block_data *bd; unsigned bitset_words = BITSET_WORDS(ctx->alloc_count); - void def(unsigned name, struct ir3_instruction *instr) - { - /* defined on first write: */ - if (!ctx->def[name]) - ctx->def[name] = instr->ip; - ctx->use[name] = instr->ip; - BITSET_SET(bd->def, name); - } - - void use(unsigned name, struct ir3_instruction *instr) - { - ctx->use[name] = MAX2(ctx->use[name], instr->ip); - if (!BITSET_TEST(bd->def, name)) - BITSET_SET(bd->use, name); - } +#define def(name, instr) \ + do { \ + /* defined on first write: */ \ + if (!ctx->def[name]) \ + ctx->def[name] = instr->ip; \ + ctx->use[name] = instr->ip; \ + BITSET_SET(bd->def, name); \ + } while(0); + +#define use(name, instr) \ + do { \ + ctx->use[name] = MAX2(ctx->use[name], instr->ip); \ + if (!BITSET_TEST(bd->def, name)) \ + BITSET_SET(bd->use, name); \ + } while(0); bd = rzalloc(ctx->g, struct ir3_ra_block_data); -- 2.30.2