summaryrefslogtreecommitdiffstats
path: root/src/mesa/program/program_parse.y
diff options
context:
space:
mode:
authorTimothy Arceri <[email protected]>2016-10-21 16:50:52 +1100
committerTimothy Arceri <[email protected]>2016-10-24 21:40:39 +1100
commit6dbe8a1b9fd750b4c1bb600a0bb43129d95e6eca (patch)
treee94d879f69543871534f59c3ffbfb6adf49efdce /src/mesa/program/program_parse.y
parent907ace57986733add2aebfa9dd7c83c67efed70e (diff)
glsl/mesa: remove unused namespace support from the symbol table
Namespace support seems to have been unused for a very long time. Previously the hash table entry was never removed and the symbol name wasn't freed until the symbol table was destroyed. In theory this could reduced the number of times we need to copy a string as duplicate names are reused. However in practice there is likely only a limited number of symbols that are the same and this is likely to cause other less than optimal behaviour such as the hash_table continuously growing. Along with dropping namespace support this change removes entries from the hash table as they become unused. Reviewed-by: Samuel Iglesias Gonsálvez <[email protected]>
Diffstat (limited to 'src/mesa/program/program_parse.y')
-rw-r--r--src/mesa/program/program_parse.y18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/mesa/program/program_parse.y b/src/mesa/program/program_parse.y
index fc8eed75593..5294d58477a 100644
--- a/src/mesa/program/program_parse.y
+++ b/src/mesa/program/program_parse.y
@@ -724,7 +724,7 @@ extSwizSel: INTEGER
srcReg: USED_IDENTIFIER /* temporaryReg | progParamSingle */
{
struct asm_symbol *const s = (struct asm_symbol *)
- _mesa_symbol_table_find_symbol(state->st, 0, $1);
+ _mesa_symbol_table_find_symbol(state->st, $1);
free($1);
@@ -812,7 +812,7 @@ dstReg: resultBinding
| USED_IDENTIFIER /* temporaryReg | vertexResultReg */
{
struct asm_symbol *const s = (struct asm_symbol *)
- _mesa_symbol_table_find_symbol(state->st, 0, $1);
+ _mesa_symbol_table_find_symbol(state->st, $1);
free($1);
@@ -841,7 +841,7 @@ dstReg: resultBinding
progParamArray: USED_IDENTIFIER
{
struct asm_symbol *const s = (struct asm_symbol *)
- _mesa_symbol_table_find_symbol(state->st, 0, $1);
+ _mesa_symbol_table_find_symbol(state->st, $1);
free($1);
@@ -914,7 +914,7 @@ addrRegNegOffset: INTEGER
addrReg: USED_IDENTIFIER
{
struct asm_symbol *const s = (struct asm_symbol *)
- _mesa_symbol_table_find_symbol(state->st, 0, $1);
+ _mesa_symbol_table_find_symbol(state->st, $1);
free($1);
@@ -2028,9 +2028,9 @@ legacyTexUnitNum: INTEGER
ALIAS_statement: ALIAS IDENTIFIER '=' USED_IDENTIFIER
{
struct asm_symbol *exist = (struct asm_symbol *)
- _mesa_symbol_table_find_symbol(state->st, 0, $2);
+ _mesa_symbol_table_find_symbol(state->st, $2);
struct asm_symbol *target = (struct asm_symbol *)
- _mesa_symbol_table_find_symbol(state->st, 0, $4);
+ _mesa_symbol_table_find_symbol(state->st, $4);
free($4);
@@ -2046,7 +2046,7 @@ ALIAS_statement: ALIAS IDENTIFIER '=' USED_IDENTIFIER
"undefined variable binding in ALIAS statement");
YYERROR;
} else {
- _mesa_symbol_table_add_symbol(state->st, 0, $2, target);
+ _mesa_symbol_table_add_symbol(state->st, $2, target);
}
}
;
@@ -2235,7 +2235,7 @@ declare_variable(struct asm_parser_state *state, char *name, enum asm_type t,
{
struct asm_symbol *s = NULL;
struct asm_symbol *exist = (struct asm_symbol *)
- _mesa_symbol_table_find_symbol(state->st, 0, name);
+ _mesa_symbol_table_find_symbol(state->st, name);
if (exist != NULL) {
@@ -2273,7 +2273,7 @@ declare_variable(struct asm_parser_state *state, char *name, enum asm_type t,
break;
}
- _mesa_symbol_table_add_symbol(state->st, 0, s->name, s);
+ _mesa_symbol_table_add_symbol(state->st, s->name, s);
s->next = state->sym;
state->sym = s;
}