diff --git a/src/compiler/glsl/glcpp/glcpp-parse.y b/src/compiler/glsl/glcpp/glcpp-parse.y index 7456c8ab872..e94971e5e91 100644 --- a/src/compiler/glsl/glcpp/glcpp-parse.y +++ b/src/compiler/glsl/glcpp/glcpp-parse.y @@ -99,6 +99,9 @@ _token_create_ival(glcpp_parser_t *parser, int type, int ival); static token_list_t * _token_list_create(glcpp_parser_t *parser); +static void +_token_list_prepend(glcpp_parser_t *parser, token_list_t *list, token_t *token); + static void _token_list_append(glcpp_parser_t *parser, token_list_t *list, token_t *token); @@ -1090,6 +1093,18 @@ _token_list_create(glcpp_parser_t *parser) return list; } +void +_token_list_prepend(glcpp_parser_t *parser, token_list_t *list, token_t *token) +{ + token_node_t *node; + + node = linear_alloc_child(parser->linalloc, sizeof(token_node_t)); + node->token = token; + node->next = list->head; + + list->head = node; +} + void _token_list_append(glcpp_parser_t *parser, token_list_t *list, token_t *token) {