diff options
author | Marek Olšák <[email protected]> | 2016-10-07 17:37:04 +0200 |
---|---|---|
committer | Marek Olšák <[email protected]> | 2016-10-31 11:53:38 +0100 |
commit | 2296bb09675e2031d75e11a96bf1ab0d0cc4bd38 (patch) | |
tree | 837cdc66b7dc15174e962822e5bbabc9f86fce0e /src/compiler/glsl/glsl_lexer.ll | |
parent | 47e17586924f6858a29b1bf81cbcba0dd0b21617 (diff) |
glsl/lexer: use the linear allocator
Tested-by: Edmondo Tommasina <[email protected]>
Reviewed-by: Nicolai Hähnle <[email protected]>
Diffstat (limited to 'src/compiler/glsl/glsl_lexer.ll')
-rw-r--r-- | src/compiler/glsl/glsl_lexer.ll | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/compiler/glsl/glsl_lexer.ll b/src/compiler/glsl/glsl_lexer.ll index d5e5d4cb73b..b473af7845c 100644 --- a/src/compiler/glsl/glsl_lexer.ll +++ b/src/compiler/glsl/glsl_lexer.ll @@ -80,8 +80,8 @@ static int classify_identifier(struct _mesa_glsl_parse_state *, const char *); "illegal use of reserved word `%s'", yytext); \ return ERROR_TOK; \ } else { \ - void *mem_ctx = yyextra; \ - yylval->identifier = ralloc_strdup(mem_ctx, yytext); \ + void *mem_ctx = yyextra->linalloc; \ + yylval->identifier = linear_strdup(mem_ctx, yytext); \ return classify_identifier(yyextra, yytext); \ } \ } while (0) @@ -245,8 +245,8 @@ HASH ^{SPC}#{SPC} <PP>[ \t\r]* { } <PP>: return COLON; <PP>[_a-zA-Z][_a-zA-Z0-9]* { - void *mem_ctx = yyextra; - yylval->identifier = ralloc_strdup(mem_ctx, yytext); + void *mem_ctx = yyextra->linalloc; + yylval->identifier = linear_strdup(mem_ctx, yytext); return IDENTIFIER; } <PP>[1-9][0-9]* { @@ -429,8 +429,8 @@ layout { || yyextra->ARB_tessellation_shader_enable) { return LAYOUT_TOK; } else { - void *mem_ctx = yyextra; - yylval->identifier = ralloc_strdup(mem_ctx, yytext); + void *mem_ctx = yyextra->linalloc; + yylval->identifier = linear_strdup(mem_ctx, yytext); return classify_identifier(yyextra, yytext); } } @@ -590,13 +590,13 @@ subroutine KEYWORD_WITH_ALT(400, 300, 400, 0, yyextra->ARB_shader_subroutine_ena [_a-zA-Z][_a-zA-Z0-9]* { struct _mesa_glsl_parse_state *state = yyextra; - void *ctx = state; + void *ctx = state->linalloc; if (state->es_shader && strlen(yytext) > 1024) { _mesa_glsl_error(yylloc, state, "Identifier `%s' exceeds 1024 characters", yytext); } else { - yylval->identifier = ralloc_strdup(ctx, yytext); + yylval->identifier = linear_strdup(ctx, yytext); } return classify_identifier(state, yytext); } |