summaryrefslogtreecommitdiffstats
path: root/src/compiler/nir/nir_validate.c
diff options
context:
space:
mode:
authorCaio Marcelo de Oliveira Filho <[email protected]>2019-01-11 11:50:53 -0800
committerCaio Marcelo de Oliveira Filho <[email protected]>2019-01-14 10:49:28 -0800
commit9fdded0cc34b4bdb87923707c05b8ceffb2f174c (patch)
treeb742e0cd4e33cd4766ed9f0b03c5c3eda2470556 /src/compiler/nir/nir_validate.c
parentee23e8b17c77fa94320168427fb8a10a84b50e94 (diff)
src/compiler: use new hash table and set creation helpers
Replace calls to create hash tables and sets that use _mesa_hash_pointer/_mesa_key_pointer_equal with the helpers _mesa_pointer_hash_table_create() and _mesa_pointer_set_create(). Reviewed-by: Jason Ekstrand <[email protected]> Acked-by: Eric Engestrom <[email protected]>
Diffstat (limited to 'src/compiler/nir/nir_validate.c')
-rw-r--r--src/compiler/nir/nir_validate.c27
1 files changed, 9 insertions, 18 deletions
diff --git a/src/compiler/nir/nir_validate.c b/src/compiler/nir/nir_validate.c
index f506b54d3b5..c9732edda14 100644
--- a/src/compiler/nir/nir_validate.c
+++ b/src/compiler/nir/nir_validate.c
@@ -300,10 +300,8 @@ validate_ssa_def(nir_ssa_def *def, validate_state *state)
ssa_def_validate_state *def_state = ralloc(state->ssa_defs,
ssa_def_validate_state);
def_state->where_defined = state->impl;
- def_state->uses = _mesa_set_create(def_state, _mesa_hash_pointer,
- _mesa_key_pointer_equal);
- def_state->if_uses = _mesa_set_create(def_state, _mesa_hash_pointer,
- _mesa_key_pointer_equal);
+ def_state->uses = _mesa_pointer_set_create(def_state);
+ def_state->if_uses = _mesa_pointer_set_create(def_state);
_mesa_hash_table_insert(state->ssa_defs, def, def_state);
}
@@ -927,12 +925,9 @@ prevalidate_reg_decl(nir_register *reg, bool is_global, validate_state *state)
list_validate(&reg->if_uses);
reg_validate_state *reg_state = ralloc(state->regs, reg_validate_state);
- reg_state->uses = _mesa_set_create(reg_state, _mesa_hash_pointer,
- _mesa_key_pointer_equal);
- reg_state->if_uses = _mesa_set_create(reg_state, _mesa_hash_pointer,
- _mesa_key_pointer_equal);
- reg_state->defs = _mesa_set_create(reg_state, _mesa_hash_pointer,
- _mesa_key_pointer_equal);
+ reg_state->uses = _mesa_pointer_set_create(reg_state);
+ reg_state->if_uses = _mesa_pointer_set_create(reg_state);
+ reg_state->defs = _mesa_pointer_set_create(reg_state);
reg_state->where_defined = is_global ? NULL : state->impl;
@@ -1132,16 +1127,12 @@ validate_function(nir_function *func, validate_state *state)
static void
init_validate_state(validate_state *state)
{
- state->regs = _mesa_hash_table_create(NULL, _mesa_hash_pointer,
- _mesa_key_pointer_equal);
- state->ssa_defs = _mesa_hash_table_create(NULL, _mesa_hash_pointer,
- _mesa_key_pointer_equal);
+ state->regs = _mesa_pointer_hash_table_create(NULL);
+ state->ssa_defs = _mesa_pointer_hash_table_create(NULL);
state->ssa_defs_found = NULL;
state->regs_found = NULL;
- state->var_defs = _mesa_hash_table_create(NULL, _mesa_hash_pointer,
- _mesa_key_pointer_equal);
- state->errors = _mesa_hash_table_create(NULL, _mesa_hash_pointer,
- _mesa_key_pointer_equal);
+ state->var_defs = _mesa_pointer_hash_table_create(NULL);
+ state->errors = _mesa_pointer_hash_table_create(NULL);
state->loop = NULL;
state->instr = NULL;