summaryrefslogtreecommitdiff
path: root/dist/Mesa/src/glsl
diff options
context:
space:
mode:
authorJonathan Gray <jsg@cvs.openbsd.org>2015-02-20 23:10:01 +0000
committerJonathan Gray <jsg@cvs.openbsd.org>2015-02-20 23:10:01 +0000
commit2d618162fc369f33505da5d6040c1ece411be94e (patch)
treee3ea082bcb69a41f517e8f88926bb4c9d7250145 /dist/Mesa/src/glsl
parente6e3394a78b6d19474b3aea1458d8718d19d8325 (diff)
Merge Mesa 10.2.9
Diffstat (limited to 'dist/Mesa/src/glsl')
-rw-r--r--dist/Mesa/src/glsl/SConscript7
-rw-r--r--dist/Mesa/src/glsl/ast.h16
-rw-r--r--dist/Mesa/src/glsl/ast_function.cpp127
-rw-r--r--dist/Mesa/src/glsl/ast_to_hir.cpp718
-rw-r--r--dist/Mesa/src/glsl/ast_type.cpp65
-rw-r--r--dist/Mesa/src/glsl/glcpp/glcpp-lex.c971
-rw-r--r--dist/Mesa/src/glsl/glcpp/glcpp-lex.l468
-rw-r--r--dist/Mesa/src/glsl/glcpp/glcpp-parse.c1783
-rw-r--r--dist/Mesa/src/glsl/glcpp/glcpp-parse.h76
-rw-r--r--dist/Mesa/src/glsl/glcpp/glcpp-parse.y617
-rw-r--r--dist/Mesa/src/glsl/glcpp/glcpp.c6
-rw-r--r--dist/Mesa/src/glsl/glcpp/tests/063-comments.c.expected1
-rw-r--r--dist/Mesa/src/glsl/glcpp/tests/086-reserved-macro-names.c.expected3
-rw-r--r--dist/Mesa/src/glsl/glcpp/tests/092-redefine-macro-error-2.c.expected1
-rw-r--r--dist/Mesa/src/glsl/glcpp/tests/093-divide-by-zero.c.expected3
-rw-r--r--dist/Mesa/src/glsl/glcpp/tests/094-divide-by-zero-short-circuit.c.expected1
-rw-r--r--dist/Mesa/src/glsl/glcpp/tests/095-recursive-define.c.expected1
-rw-r--r--dist/Mesa/src/glsl/glcpp/tests/097-paste-with-non-function-macro.c.expected1
-rw-r--r--dist/Mesa/src/glsl/glcpp/tests/098-elif-undefined.c.expected1
-rw-r--r--dist/Mesa/src/glsl/glcpp/tests/103-garbage-after-else.c (renamed from dist/Mesa/src/glsl/glcpp/tests/103-garbage-after-else-0.c)0
-rw-r--r--dist/Mesa/src/glsl/glcpp/tests/103-garbage-after-else.c.expected (renamed from dist/Mesa/src/glsl/glcpp/tests/103-garbage-after-else-0.c.expected)2
-rw-r--r--dist/Mesa/src/glsl/glcpp/tests/118-multiple-else.c (renamed from dist/Mesa/src/glsl/glcpp/tests/143-multiple-else.c)0
-rw-r--r--dist/Mesa/src/glsl/glcpp/tests/118-multiple-else.c.expected (renamed from dist/Mesa/src/glsl/glcpp/tests/143-multiple-else.c.expected)1
-rw-r--r--dist/Mesa/src/glsl/glcpp/tests/120-undef-builtin.c3
-rw-r--r--dist/Mesa/src/glsl/glcpp/tests/120-undef-builtin.c.expected6
-rw-r--r--dist/Mesa/src/glsl/glcpp/tests/122-redefine-whitespace.c16
-rw-r--r--dist/Mesa/src/glsl/glcpp/tests/122-redefine-whitespace.c.expected22
-rw-r--r--dist/Mesa/src/glsl/glcpp/tests/123-garbage-after-else-1.c3
-rw-r--r--dist/Mesa/src/glsl/glcpp/tests/123-garbage-after-else-1.c.expected4
-rw-r--r--dist/Mesa/src/glsl/glcpp/tests/124-preprocessing-numbers.c37
-rw-r--r--dist/Mesa/src/glsl/glcpp/tests/124-preprocessing-numbers.c.expected37
-rw-r--r--dist/Mesa/src/glsl/glcpp/tests/125-es-short-circuit-undefined.c27
-rw-r--r--dist/Mesa/src/glsl/glcpp/tests/125-es-short-circuit-undefined.c.expected29
-rw-r--r--dist/Mesa/src/glsl/glcpp/tests/126-garbage-after-directive.c5
-rw-r--r--dist/Mesa/src/glsl/glcpp/tests/126-garbage-after-directive.c.expected7
-rw-r--r--dist/Mesa/src/glsl/glcpp/tests/127-pragma-empty.c3
-rw-r--r--dist/Mesa/src/glsl/glcpp/tests/127-pragma-empty.c.expected3
-rw-r--r--dist/Mesa/src/glsl/glcpp/tests/128-space-before-hash.c21
-rw-r--r--dist/Mesa/src/glsl/glcpp/tests/128-space-before-hash.c.expected21
-rw-r--r--dist/Mesa/src/glsl/glcpp/tests/129-define-non-identifier.c1
-rw-r--r--dist/Mesa/src/glsl/glcpp/tests/129-define-non-identifier.c.expected2
-rw-r--r--dist/Mesa/src/glsl/glcpp/tests/130-define-comment.c2
-rw-r--r--dist/Mesa/src/glsl/glcpp/tests/130-define-comment.c.expected2
-rw-r--r--dist/Mesa/src/glsl/glcpp/tests/131-eof-without-newline.c1
-rw-r--r--dist/Mesa/src/glsl/glcpp/tests/131-eof-without-newline.c.expected1
-rw-r--r--dist/Mesa/src/glsl/glcpp/tests/132-eof-without-newline-define.c1
-rw-r--r--dist/Mesa/src/glsl/glcpp/tests/132-eof-without-newline-define.c.expected1
-rw-r--r--dist/Mesa/src/glsl/glcpp/tests/133-eof-without-newline-comment.c1
-rw-r--r--dist/Mesa/src/glsl/glcpp/tests/133-eof-without-newline-comment.c.expected2
-rw-r--r--dist/Mesa/src/glsl/glcpp/tests/134-hash-comment-directive.c22
-rw-r--r--dist/Mesa/src/glsl/glcpp/tests/134-hash-comment-directive.c.expected22
-rw-r--r--dist/Mesa/src/glsl/glcpp/tests/135-duplicate-parameter.c2
-rw-r--r--dist/Mesa/src/glsl/glcpp/tests/135-duplicate-parameter.c.expected4
-rw-r--r--dist/Mesa/src/glsl/glcpp/tests/136-plus-plus-and-minus-minus.c8
-rw-r--r--dist/Mesa/src/glsl/glcpp/tests/136-plus-plus-and-minus-minus.c.expected8
-rw-r--r--dist/Mesa/src/glsl/glcpp/tests/137-expand-macro-after-period.c4
-rw-r--r--dist/Mesa/src/glsl/glcpp/tests/137-expand-macro-after-period.c.expected4
-rw-r--r--dist/Mesa/src/glsl/glcpp/tests/138-multi-line-comment-in-if-0.c7
-rw-r--r--dist/Mesa/src/glsl/glcpp/tests/138-multi-line-comment-in-if-0.c.expected7
-rw-r--r--dist/Mesa/src/glsl/glcpp/tests/139-define-without-macro-name.c5
-rw-r--r--dist/Mesa/src/glsl/glcpp/tests/139-define-without-macro-name.c.expected5
-rw-r--r--dist/Mesa/src/glsl/glcpp/tests/140-null-directive.c9
-rw-r--r--dist/Mesa/src/glsl/glcpp/tests/140-null-directive.c.expected9
-rw-r--r--dist/Mesa/src/glsl/glcpp/tests/141-pragma-and-__LINE__.c6
-rw-r--r--dist/Mesa/src/glsl/glcpp/tests/141-pragma-and-__LINE__.c.expected6
-rw-r--r--dist/Mesa/src/glsl/glcpp/tests/142-defined-within-macro.c94
-rw-r--r--dist/Mesa/src/glsl/glcpp/tests/142-defined-within-macro.c.expected94
-rw-r--r--dist/Mesa/src/glsl/glcpp/tests/glcpp-test36
-rwxr-xr-xdist/Mesa/src/glsl/glcpp/tests/glcpp-test-cr-lf141
-rw-r--r--dist/Mesa/src/glsl/glsl_lexer.cpp2144
-rw-r--r--dist/Mesa/src/glsl/glsl_lexer.ll30
-rw-r--r--dist/Mesa/src/glsl/glsl_parser.cpp4640
-rw-r--r--dist/Mesa/src/glsl/glsl_parser.h376
-rw-r--r--dist/Mesa/src/glsl/glsl_parser.yy161
-rw-r--r--dist/Mesa/src/glsl/glsl_parser_extras.cpp126
-rw-r--r--dist/Mesa/src/glsl/glsl_parser_extras.h55
-rw-r--r--dist/Mesa/src/glsl/glsl_symbol_table.cpp2
-rw-r--r--dist/Mesa/src/glsl/glsl_types.cpp170
-rw-r--r--dist/Mesa/src/glsl/glsl_types.h100
-rw-r--r--dist/Mesa/src/glsl/ir.cpp229
-rw-r--r--dist/Mesa/src/glsl/ir.h593
-rw-r--r--dist/Mesa/src/glsl/ir_clone.cpp47
-rw-r--r--dist/Mesa/src/glsl/ir_constant_expression.cpp20
-rw-r--r--dist/Mesa/src/glsl/ir_function.cpp224
-rw-r--r--dist/Mesa/src/glsl/ir_function_detect_recursion.cpp8
-rw-r--r--dist/Mesa/src/glsl/ir_hierarchical_visitor.h35
-rw-r--r--dist/Mesa/src/glsl/ir_hv_accept.cpp23
-rw-r--r--dist/Mesa/src/glsl/ir_optimization.h11
-rw-r--r--dist/Mesa/src/glsl/ir_print_visitor.cpp61
-rw-r--r--dist/Mesa/src/glsl/ir_reader.cpp65
-rw-r--r--dist/Mesa/src/glsl/ir_rvalue_visitor.cpp40
-rw-r--r--dist/Mesa/src/glsl/ir_set_program_inouts.cpp4
-rw-r--r--dist/Mesa/src/glsl/ir_validate.cpp65
-rw-r--r--dist/Mesa/src/glsl/link_functions.cpp25
-rw-r--r--dist/Mesa/src/glsl/linker.cpp416
-rw-r--r--dist/Mesa/src/glsl/linker.h24
-rw-r--r--dist/Mesa/src/glsl/loop_analysis.cpp32
-rw-r--r--dist/Mesa/src/glsl/loop_analysis.h26
-rw-r--r--dist/Mesa/src/glsl/lower_const_arrays_to_uniforms.cpp111
-rw-r--r--dist/Mesa/src/glsl/lower_if_to_cond_assign.cpp10
-rw-r--r--dist/Mesa/src/glsl/lower_instructions.cpp29
-rw-r--r--dist/Mesa/src/glsl/lower_jumps.cpp8
-rw-r--r--dist/Mesa/src/glsl/lower_variable_index_to_cond_assign.cpp2
-rw-r--r--dist/Mesa/src/glsl/lower_vec_index_to_cond_assign.cpp3
-rw-r--r--dist/Mesa/src/glsl/lower_vec_index_to_swizzle.cpp3
-rw-r--r--dist/Mesa/src/glsl/lower_vertex_id.cpp144
-rw-r--r--dist/Mesa/src/glsl/main.cpp3
-rw-r--r--dist/Mesa/src/glsl/opt_constant_folding.cpp5
-rw-r--r--dist/Mesa/src/glsl/opt_constant_propagation.cpp20
-rw-r--r--dist/Mesa/src/glsl/opt_constant_variable.cpp6
-rw-r--r--dist/Mesa/src/glsl/opt_copy_propagation.cpp17
-rw-r--r--dist/Mesa/src/glsl/opt_copy_propagation_elements.cpp30
-rw-r--r--dist/Mesa/src/glsl/opt_dead_builtin_variables.cpp81
-rw-r--r--dist/Mesa/src/glsl/opt_dead_code_local.cpp21
-rw-r--r--dist/Mesa/src/glsl/opt_dead_functions.cpp10
-rw-r--r--dist/Mesa/src/glsl/opt_function_inlining.cpp13
-rw-r--r--dist/Mesa/src/glsl/opt_minmax.cpp475
-rw-r--r--dist/Mesa/src/glsl/opt_rebalance_tree.cpp321
-rw-r--r--dist/Mesa/src/glsl/opt_structure_splitting.cpp13
-rw-r--r--dist/Mesa/src/glsl/ralloc.c492
-rw-r--r--dist/Mesa/src/glsl/ralloc.h445
-rw-r--r--dist/Mesa/src/glsl/s_expression.cpp8
-rw-r--r--dist/Mesa/src/glsl/s_expression.h2
-rw-r--r--dist/Mesa/src/glsl/strtod.c79
-rw-r--r--dist/Mesa/src/glsl/strtod.h46
-rwxr-xr-xdist/Mesa/src/glsl/tests/lower_jumps/lower_breaks_1.opt_test13
-rw-r--r--dist/Mesa/src/glsl/tests/lower_jumps/lower_breaks_1.opt_test.expected5
-rwxr-xr-xdist/Mesa/src/glsl/tests/lower_jumps/lower_breaks_2.opt_test15
-rw-r--r--dist/Mesa/src/glsl/tests/lower_jumps/lower_breaks_2.opt_test.expected7
-rwxr-xr-xdist/Mesa/src/glsl/tests/lower_jumps/lower_breaks_3.opt_test17
-rw-r--r--dist/Mesa/src/glsl/tests/lower_jumps/lower_breaks_3.opt_test.expected8
-rwxr-xr-xdist/Mesa/src/glsl/tests/lower_jumps/lower_breaks_4.opt_test15
-rw-r--r--dist/Mesa/src/glsl/tests/lower_jumps/lower_breaks_4.opt_test.expected7
-rwxr-xr-xdist/Mesa/src/glsl/tests/lower_jumps/lower_breaks_5.opt_test16
-rw-r--r--dist/Mesa/src/glsl/tests/lower_jumps/lower_breaks_5.opt_test.expected7
-rwxr-xr-xdist/Mesa/src/glsl/tests/lower_jumps/lower_breaks_6.opt_test29
-rw-r--r--dist/Mesa/src/glsl/tests/lower_jumps/lower_breaks_6.opt_test.expected29
-rwxr-xr-xdist/Mesa/src/glsl/tests/lower_jumps/lower_guarded_conditional_break.opt_test21
-rw-r--r--dist/Mesa/src/glsl/tests/lower_jumps/lower_guarded_conditional_break.opt_test.expected20
-rwxr-xr-xdist/Mesa/src/glsl/tests/lower_jumps/lower_pulled_out_jump.opt_test28
-rw-r--r--dist/Mesa/src/glsl/tests/lower_jumps/lower_pulled_out_jump.opt_test.expected25
-rwxr-xr-xdist/Mesa/src/glsl/tests/lower_jumps/lower_returns_1.opt_test12
-rw-r--r--dist/Mesa/src/glsl/tests/lower_jumps/lower_returns_1.opt_test.expected4
-rwxr-xr-xdist/Mesa/src/glsl/tests/lower_jumps/lower_returns_2.opt_test13
-rw-r--r--dist/Mesa/src/glsl/tests/lower_jumps/lower_returns_2.opt_test.expected5
-rwxr-xr-xdist/Mesa/src/glsl/tests/lower_jumps/lower_returns_3.opt_test20
-rw-r--r--dist/Mesa/src/glsl/tests/lower_jumps/lower_returns_3.opt_test.expected21
-rwxr-xr-xdist/Mesa/src/glsl/tests/lower_jumps/lower_returns_4.opt_test14
-rw-r--r--dist/Mesa/src/glsl/tests/lower_jumps/lower_returns_4.opt_test.expected16
-rwxr-xr-xdist/Mesa/src/glsl/tests/lower_jumps/lower_returns_main_false.opt_test17
-rw-r--r--dist/Mesa/src/glsl/tests/lower_jumps/lower_returns_main_false.opt_test.expected8
-rwxr-xr-xdist/Mesa/src/glsl/tests/lower_jumps/lower_returns_main_true.opt_test17
-rw-r--r--dist/Mesa/src/glsl/tests/lower_jumps/lower_returns_main_true.opt_test.expected13
-rwxr-xr-xdist/Mesa/src/glsl/tests/lower_jumps/lower_returns_sub_false.opt_test16
-rw-r--r--dist/Mesa/src/glsl/tests/lower_jumps/lower_returns_sub_false.opt_test.expected8
-rwxr-xr-xdist/Mesa/src/glsl/tests/lower_jumps/lower_returns_sub_true.opt_test16
-rw-r--r--dist/Mesa/src/glsl/tests/lower_jumps/lower_returns_sub_true.opt_test.expected13
-rwxr-xr-xdist/Mesa/src/glsl/tests/lower_jumps/lower_unified_returns.opt_test26
-rw-r--r--dist/Mesa/src/glsl/tests/lower_jumps/lower_unified_returns.opt_test.expected21
-rwxr-xr-xdist/Mesa/src/glsl/tests/lower_jumps/remove_continue_at_end_of_loop.opt_test13
-rw-r--r--dist/Mesa/src/glsl/tests/lower_jumps/remove_continue_at_end_of_loop.opt_test.expected5
-rwxr-xr-xdist/Mesa/src/glsl/tests/lower_jumps/return_non_void_at_end_of_loop_lower_nothing.opt_test16
-rw-r--r--dist/Mesa/src/glsl/tests/lower_jumps/return_non_void_at_end_of_loop_lower_nothing.opt_test.expected8
-rwxr-xr-xdist/Mesa/src/glsl/tests/lower_jumps/return_non_void_at_end_of_loop_lower_return.opt_test16
-rw-r--r--dist/Mesa/src/glsl/tests/lower_jumps/return_non_void_at_end_of_loop_lower_return.opt_test.expected19
-rwxr-xr-xdist/Mesa/src/glsl/tests/lower_jumps/return_non_void_at_end_of_loop_lower_return_and_break.opt_test16
-rw-r--r--dist/Mesa/src/glsl/tests/lower_jumps/return_non_void_at_end_of_loop_lower_return_and_break.opt_test.expected19
-rwxr-xr-xdist/Mesa/src/glsl/tests/lower_jumps/return_void_at_end_of_loop_lower_nothing.opt_test14
-rw-r--r--dist/Mesa/src/glsl/tests/lower_jumps/return_void_at_end_of_loop_lower_nothing.opt_test.expected6
-rwxr-xr-xdist/Mesa/src/glsl/tests/lower_jumps/return_void_at_end_of_loop_lower_return.opt_test14
-rw-r--r--dist/Mesa/src/glsl/tests/lower_jumps/return_void_at_end_of_loop_lower_return.opt_test.expected11
-rwxr-xr-xdist/Mesa/src/glsl/tests/lower_jumps/return_void_at_end_of_loop_lower_return_and_break.opt_test14
-rw-r--r--dist/Mesa/src/glsl/tests/lower_jumps/return_void_at_end_of_loop_lower_return_and_break.opt_test.expected11
-rw-r--r--dist/Mesa/src/glsl/tests/ralloc_test.cpp38
174 files changed, 7885 insertions, 10626 deletions
diff --git a/dist/Mesa/src/glsl/SConscript b/dist/Mesa/src/glsl/SConscript
index 847e96246..fe9d50732 100644
--- a/dist/Mesa/src/glsl/SConscript
+++ b/dist/Mesa/src/glsl/SConscript
@@ -8,15 +8,12 @@ env = env.Clone()
env.Prepend(CPPPATH = [
'#include',
- '#src',
'#src/mapi',
'#src/mesa',
'#src/glsl',
'#src/glsl/glcpp',
])
-env.Prepend(LIBS = [mesautil])
-
# Make glcpp-parse.h and glsl_parser.h reachable from the include path.
env.Append(CPPPATH = [Dir('.').abspath, Dir('glcpp').abspath])
@@ -58,6 +55,7 @@ if env['msvc']:
# Copy these files to avoid generation object files into src/mesa/program
env.Prepend(CPPPATH = ['#src/mesa/main'])
+env.Command('hash_table.c', '#src/mesa/main/hash_table.c', Copy('$TARGET', '$SOURCE'))
env.Command('imports.c', '#src/mesa/main/imports.c', Copy('$TARGET', '$SOURCE'))
# Copy these files to avoid generation object files into src/mesa/program
env.Prepend(CPPPATH = ['#src/mesa/program'])
@@ -67,6 +65,7 @@ env.Command('symbol_table.c', '#src/mesa/program/symbol_table.c', Copy('$TARGET'
compiler_objs = env.StaticObject(source_lists['GLSL_COMPILER_CXX_FILES'])
mesa_objs = env.StaticObject([
+ 'hash_table.c',
'imports.c',
'prog_hash_table.c',
'symbol_table.c',
@@ -107,6 +106,6 @@ env.Alias('glsl_compiler', glsl_compiler)
glcpp = env.Program(
target = 'glcpp/glcpp',
- source = ['glcpp/glcpp.c', 'tests/common.c'] + mesa_objs,
+ source = ['glcpp/glcpp.c'] + mesa_objs,
)
env.Alias('glcpp', glcpp)
diff --git a/dist/Mesa/src/glsl/ast.h b/dist/Mesa/src/glsl/ast.h
index 15bf086a1..6b136f518 100644
--- a/dist/Mesa/src/glsl/ast.h
+++ b/dist/Mesa/src/glsl/ast.h
@@ -424,7 +424,6 @@ struct ast_type_qualifier {
union {
struct {
unsigned invariant:1;
- unsigned precise:1;
unsigned constant:1;
unsigned attribute:1;
unsigned varying:1;
@@ -509,8 +508,6 @@ struct ast_type_qualifier {
/** \name Layout qualifiers for GL_ARB_gpu_shader5 */
/** \{ */
unsigned invocations:1;
- unsigned stream:1; /**< Has stream value assigned */
- unsigned explicit_stream:1; /**< stream value assigned explicitly by shader code */
/** \} */
}
/** \brief Set of flags, accessed by name. */
@@ -544,9 +541,6 @@ struct ast_type_qualifier {
/** Maximum output vertices in GLSL 1.50 geometry shaders. */
int max_vertices;
- /** Stream in GLSL 1.50 geometry shaders. */
- unsigned stream;
-
/** Input or output primitive type in GLSL 1.50 geometry shaders */
GLenum prim_type;
@@ -751,11 +745,13 @@ public:
exec_list declarations;
/**
- * Flags for redeclarations. In these cases, no type is specified, to
- * `type` is allowed to be NULL. In all other cases, this would be an error.
+ * Special flag for vertex shader "invariant" declarations.
+ *
+ * Vertex shaders can contain "invariant" variable redeclarations that do
+ * not include a type. For example, "invariant gl_Position;". This flag
+ * is used to note these cases when no type is specified.
*/
- int invariant; /** < `invariant` redeclaration */
- int precise; /** < `precise` redeclaration */
+ int invariant;
};
diff --git a/dist/Mesa/src/glsl/ast_function.cpp b/dist/Mesa/src/glsl/ast_function.cpp
index cbff9d8b4..4b8447067 100644
--- a/dist/Mesa/src/glsl/ast_function.cpp
+++ b/dist/Mesa/src/glsl/ast_function.cpp
@@ -41,7 +41,8 @@ process_parameters(exec_list *instructions, exec_list *actual_parameters,
{
unsigned count = 0;
- foreach_list_typed(ast_node, ast, link, parameters) {
+ foreach_list (n, parameters) {
+ ast_node *const ast = exec_node_data(ast_node, n, link);
ir_rvalue *result = ast->hir(instructions, state);
ir_constant *const constant = result->constant_expression_value();
@@ -81,7 +82,9 @@ prototype_string(const glsl_type *return_type, const char *name,
ralloc_asprintf_append(&str, "%s(", name);
const char *comma = "";
- foreach_in_list(const ir_variable, param, parameters) {
+ foreach_list(node, parameters) {
+ const ir_variable *const param = (ir_variable *) node;
+
ralloc_asprintf_append(&str, "%s%s", comma, param->type->name);
comma = ", ";
}
@@ -103,35 +106,35 @@ verify_image_parameter(YYLTYPE *loc, _mesa_glsl_parse_state *state,
* qualifiers. [...] It is legal to have additional qualifiers
* on a formal parameter, but not to have fewer."
*/
- if (actual->data.image_coherent && !formal->data.image_coherent) {
+ if (actual->data.image.coherent && !formal->data.image.coherent) {
_mesa_glsl_error(loc, state,
"function call parameter `%s' drops "
"`coherent' qualifier", formal->name);
return false;
}
- if (actual->data.image_volatile && !formal->data.image_volatile) {
+ if (actual->data.image._volatile && !formal->data.image._volatile) {
_mesa_glsl_error(loc, state,
"function call parameter `%s' drops "
"`volatile' qualifier", formal->name);
return false;
}
- if (actual->data.image_restrict && !formal->data.image_restrict) {
+ if (actual->data.image.restrict_flag && !formal->data.image.restrict_flag) {
_mesa_glsl_error(loc, state,
"function call parameter `%s' drops "
"`restrict' qualifier", formal->name);
return false;
}
- if (actual->data.image_read_only && !formal->data.image_read_only) {
+ if (actual->data.image.read_only && !formal->data.image.read_only) {
_mesa_glsl_error(loc, state,
"function call parameter `%s' drops "
"`readonly' qualifier", formal->name);
return false;
}
- if (actual->data.image_write_only && !formal->data.image_write_only) {
+ if (actual->data.image.write_only && !formal->data.image.write_only) {
_mesa_glsl_error(loc, state,
"function call parameter `%s' drops "
"`writeonly' qualifier", formal->name);
@@ -155,11 +158,12 @@ verify_parameter_modes(_mesa_glsl_parse_state *state,
exec_node *actual_ir_node = actual_ir_parameters.head;
exec_node *actual_ast_node = actual_ast_parameters.head;
- foreach_in_list(const ir_variable, formal, &sig->parameters) {
+ foreach_list(formal_node, &sig->parameters) {
/* The lists must be the same length. */
assert(!actual_ir_node->is_tail_sentinel());
assert(!actual_ast_node->is_tail_sentinel());
+ const ir_variable *const formal = (ir_variable *) formal_node;
const ir_rvalue *const actual = (ir_rvalue *) actual_ir_node;
const ast_expression *const actual_ast =
exec_node_data(ast_expression, actual_ast_node, link);
@@ -178,24 +182,6 @@ verify_parameter_modes(_mesa_glsl_parse_state *state,
return false;
}
- /* Verify that shader_in parameters are shader inputs */
- if (formal->data.must_be_shader_input) {
- ir_variable *var = actual->variable_referenced();
- if (var && var->data.mode != ir_var_shader_in) {
- _mesa_glsl_error(&loc, state,
- "parameter `%s` must be a shader input",
- formal->name);
- return false;
- }
-
- if (actual->ir_type == ir_type_swizzle) {
- _mesa_glsl_error(&loc, state,
- "parameter `%s` must not be swizzled",
- formal->name);
- return false;
- }
- }
-
/* Verify that 'out' and 'inout' actual parameters are lvalues. */
if (formal->data.mode == ir_var_function_out
|| formal->data.mode == ir_var_function_inout) {
@@ -408,17 +394,14 @@ generate_call(exec_list *instructions, ir_function_signature *sig,
ir_dereference_variable *deref = NULL;
if (!sig->return_type->is_void()) {
/* Create a new temporary to hold the return value. */
- char *const name = ir_variable::temporaries_allocate_names
- ? ralloc_asprintf(ctx, "%s_retval", sig->function_name())
- : NULL;
-
ir_variable *var;
- var = new(ctx) ir_variable(sig->return_type, name, ir_var_temporary);
+ var = new(ctx) ir_variable(sig->return_type,
+ ralloc_asprintf(ctx, "%s_retval",
+ sig->function_name()),
+ ir_var_temporary);
instructions->push_tail(var);
- ralloc_free(name);
-
deref = new(ctx) ir_dereference_variable(var);
}
ir_call *call = new(ctx) ir_call(sig, deref, actual_parameters);
@@ -453,21 +436,20 @@ match_function_by_name(const char *name,
goto done; /* no match */
if (f != NULL) {
- /* In desktop GL, the presence of a user-defined signature hides any
- * built-in signatures, so we must ignore them. In contrast, in ES2
- * user-defined signatures add new overloads, so we must consider them.
- */
- bool allow_builtins = state->es_shader || !f->has_user_signature();
-
/* Look for a match in the local shader. If exact, we're done. */
bool is_exact = false;
sig = local_sig = f->matching_signature(state, actual_parameters,
- allow_builtins, &is_exact);
+ &is_exact);
if (is_exact)
goto done;
- if (!allow_builtins)
+ if (!state->es_shader && f->has_user_signature()) {
+ /* In desktop GL, the presence of a user-defined signature hides any
+ * built-in signatures, so we must ignore them. In contrast, in ES2
+ * user-defined signatures add new overloads, so we must proceed.
+ */
goto done;
+ }
}
/* Local shader has no exact candidates; check the built-ins. */
@@ -496,7 +478,9 @@ print_function_prototypes(_mesa_glsl_parse_state *state, YYLTYPE *loc,
if (f == NULL)
return;
- foreach_in_list(ir_function_signature, sig, &f->signatures) {
+ foreach_list (node, &f->signatures) {
+ ir_function_signature *sig = (ir_function_signature *) node;
+
if (sig->is_builtin() && !sig->is_builtin_available(state))
continue;
@@ -706,7 +690,8 @@ process_vec_mat_constructor(exec_list *instructions,
bool all_parameters_are_constant = true;
/* Type cast each parameter and, if possible, fold constants. */
- foreach_in_list_safe(ir_rvalue, ir, &actual_parameters) {
+ foreach_list_safe(n, &actual_parameters) {
+ ir_rvalue *ir = (ir_rvalue *) n;
ir_rvalue *result = ir;
/* Apply implicit conversions (not the scalar constructor rules!). See
@@ -716,7 +701,7 @@ process_vec_mat_constructor(exec_list *instructions,
glsl_type::get_instance(GLSL_TYPE_FLOAT,
ir->type->vector_elements,
ir->type->matrix_columns);
- if (result->type->can_implicitly_convert_to(desired_type, state)) {
+ if (result->type->can_implicitly_convert_to(desired_type)) {
/* Even though convert_component() implements the constructor
* conversion rules (not the implicit conversion rules), its safe
* to use it here because we already checked that the implicit
@@ -764,22 +749,12 @@ process_vec_mat_constructor(exec_list *instructions,
instructions->push_tail(var);
int i = 0;
+ foreach_list(node, &actual_parameters) {
+ ir_rvalue *rhs = (ir_rvalue *) node;
+ ir_rvalue *lhs = new(ctx) ir_dereference_array(var,
+ new(ctx) ir_constant(i));
- foreach_in_list(ir_rvalue, rhs, &actual_parameters) {
- ir_instruction *assignment = NULL;
-
- if (var->type->is_matrix()) {
- ir_rvalue *lhs = new(ctx) ir_dereference_array(var,
- new(ctx) ir_constant(i));
- assignment = new(ctx) ir_assignment(lhs, rhs, NULL);
- } else {
- /* use writemask rather than index for vector */
- assert(var->type->is_vector());
- assert(i < 4);
- ir_dereference *lhs = new(ctx) ir_dereference_variable(var);
- assignment = new(ctx) ir_assignment(lhs, rhs, NULL, (unsigned)(1 << i));
- }
-
+ ir_instruction *assignment = new(ctx) ir_assignment(lhs, rhs, NULL);
instructions->push_tail(assignment);
i++;
@@ -844,7 +819,8 @@ process_array_constructor(exec_list *instructions,
bool all_parameters_are_constant = true;
/* Type cast each parameter and, if possible, fold constants. */
- foreach_in_list_safe(ir_rvalue, ir, &actual_parameters) {
+ foreach_list_safe(n, &actual_parameters) {
+ ir_rvalue *ir = (ir_rvalue *) n;
ir_rvalue *result = ir;
/* Apply implicit conversions (not the scalar constructor rules!). See
@@ -854,7 +830,7 @@ process_array_constructor(exec_list *instructions,
glsl_type::get_instance(GLSL_TYPE_FLOAT,
ir->type->vector_elements,
ir->type->matrix_columns);
- if (result->type->can_implicitly_convert_to(desired_type, state)) {
+ if (result->type->can_implicitly_convert_to(desired_type)) {
/* Even though convert_component() implements the constructor
* conversion rules (not the implicit conversion rules), its safe
* to use it here because we already checked that the implicit
@@ -894,7 +870,8 @@ process_array_constructor(exec_list *instructions,
instructions->push_tail(var);
int i = 0;
- foreach_in_list(ir_rvalue, rhs, &actual_parameters) {
+ foreach_list(node, &actual_parameters) {
+ ir_rvalue *rhs = (ir_rvalue *) node;
ir_rvalue *lhs = new(ctx) ir_dereference_array(var,
new(ctx) ir_constant(i));
@@ -915,8 +892,8 @@ static ir_constant *
constant_record_constructor(const glsl_type *constructor_type,
exec_list *parameters, void *mem_ctx)
{
- foreach_in_list(ir_instruction, node, parameters) {
- ir_constant *constant = node->as_constant();
+ foreach_list(node, parameters) {
+ ir_constant *constant = ((ir_instruction *) node)->as_constant();
if (constant == NULL)
return NULL;
node->replace_with(constant);
@@ -990,7 +967,8 @@ emit_inline_vector_constructor(const glsl_type *type,
memset(&data, 0, sizeof(data));
- foreach_in_list(ir_rvalue, param, parameters) {
+ foreach_list(node, parameters) {
+ ir_rvalue *param = (ir_rvalue *) node;
unsigned rhs_components = param->type->components();
/* Do not try to assign more components to the vector than it has!
@@ -1047,7 +1025,8 @@ emit_inline_vector_constructor(const glsl_type *type,
}
base_component = 0;
- foreach_in_list(ir_rvalue, param, parameters) {
+ foreach_list(node, parameters) {
+ ir_rvalue *param = (ir_rvalue *) node;
unsigned rhs_components = param->type->components();
/* Do not try to assign more components to the vector than it has!
@@ -1333,7 +1312,8 @@ emit_inline_matrix_constructor(const glsl_type *type,
unsigned col_idx = 0;
unsigned row_idx = 0;
- foreach_in_list(ir_rvalue, rhs, parameters) {
+ foreach_list (node, parameters) {
+ ir_rvalue *const rhs = (ir_rvalue *) node;
const unsigned components_remaining_this_column = rows - row_idx;
unsigned rhs_components = rhs->type->components();
unsigned rhs_base = 0;
@@ -1578,8 +1558,9 @@ ast_function_expression::hir(exec_list *instructions,
unsigned nonmatrix_parameters = 0;
exec_list actual_parameters;
- foreach_list_typed(ast_node, ast, link, &this->expressions) {
- ir_rvalue *result = ast->hir(instructions, state);
+ foreach_list (n, &this->expressions) {
+ ast_node *ast = exec_node_data(ast_node, n, link);
+ ir_rvalue *result = ast->hir(instructions, state)->as_rvalue();
/* From page 50 (page 56 of the PDF) of the GLSL 1.50 spec:
*
@@ -1658,7 +1639,9 @@ ast_function_expression::hir(exec_list *instructions,
* need to break them up into a series of column vectors.
*/
if (constructor_type->base_type != GLSL_TYPE_FLOAT) {
- foreach_in_list_safe(ir_rvalue, matrix, &actual_parameters) {
+ foreach_list_safe(n, &actual_parameters) {
+ ir_rvalue *matrix = (ir_rvalue *) n;
+
if (!matrix->type->is_matrix())
continue;
@@ -1682,7 +1665,9 @@ ast_function_expression::hir(exec_list *instructions,
bool all_parameters_are_constant = true;
/* Type cast each parameter and, if possible, fold constants.*/
- foreach_in_list_safe(ir_rvalue, ir, &actual_parameters) {
+ foreach_list_safe(n, &actual_parameters) {
+ ir_rvalue *ir = (ir_rvalue *) n;
+
const glsl_type *desired_type =
glsl_type::get_instance(constructor_type->base_type,
ir->type->vector_elements,
diff --git a/dist/Mesa/src/glsl/ast_to_hir.cpp b/dist/Mesa/src/glsl/ast_to_hir.cpp
index fe1e1291e..332f934ff 100644
--- a/dist/Mesa/src/glsl/ast_to_hir.cpp
+++ b/dist/Mesa/src/glsl/ast_to_hir.cpp
@@ -49,6 +49,7 @@
* parser (and lexer) sources.
*/
+#include "main/core.h" /* for struct gl_extensions */
#include "glsl_symbol_table.h"
#include "glsl_parser_extras.h"
#include "ast.h"
@@ -112,8 +113,8 @@ _mesa_ast_to_hir(exec_list *instructions, struct _mesa_glsl_parse_state *state)
* applications depend on this behavior, and it matches what nearly all
* other drivers do.
*/
- foreach_in_list_safe(ir_instruction, node, instructions) {
- ir_variable *const var = node->as_variable();
+ foreach_list_safe(node, instructions) {
+ ir_variable *const var = ((ir_instruction *) node)->as_variable();
if (var == NULL)
continue;
@@ -163,31 +164,6 @@ _mesa_ast_to_hir(exec_list *instructions, struct _mesa_glsl_parse_state *state)
}
-static ir_expression_operation
-get_conversion_operation(const glsl_type *to, const glsl_type *from,
- struct _mesa_glsl_parse_state *state)
-{
- switch (to->base_type) {
- case GLSL_TYPE_FLOAT:
- switch (from->base_type) {
- case GLSL_TYPE_INT: return ir_unop_i2f;
- case GLSL_TYPE_UINT: return ir_unop_u2f;
- default: return (ir_expression_operation)0;
- }
-
- case GLSL_TYPE_UINT:
- if (!state->is_version(400, 0) && !state->ARB_gpu_shader5_enable)
- return (ir_expression_operation)0;
- switch (from->base_type) {
- case GLSL_TYPE_INT: return ir_unop_i2u;
- default: return (ir_expression_operation)0;
- }
-
- default: return (ir_expression_operation)0;
- }
-}
-
-
/**
* If a conversion is available, convert one operand to a different type
*
@@ -209,7 +185,9 @@ apply_implicit_conversion(const glsl_type *to, ir_rvalue * &from,
if (to->base_type == from->type->base_type)
return true;
- /* Prior to GLSL 1.20, there are no implicit conversions */
+ /* This conversion was added in GLSL 1.20. If the compilation mode is
+ * GLSL 1.10, the conversion is skipped.
+ */
if (!state->is_version(120, 0))
return false;
@@ -217,25 +195,36 @@ apply_implicit_conversion(const glsl_type *to, ir_rvalue * &from,
*
* "There are no implicit array or structure conversions. For
* example, an array of int cannot be implicitly converted to an
- * array of float.
+ * array of float. There are no implicit conversions between
+ * signed and unsigned integers."
+ */
+ /* FINISHME: The above comment is partially a lie. There is int/uint
+ * FINISHME: conversion for immediate constants.
*/
- if (!to->is_numeric() || !from->type->is_numeric())
+ if (!to->is_float() || !from->type->is_numeric())
return false;
- /* We don't actually want the specific type `to`, we want a type
- * with the same base type as `to`, but the same vector width as
- * `from`.
+ /* Convert to a floating point type with the same number of components
+ * as the original type - i.e. int to float, not int to vec4.
*/
- to = glsl_type::get_instance(to->base_type, from->type->vector_elements,
- from->type->matrix_columns);
+ to = glsl_type::get_instance(GLSL_TYPE_FLOAT, from->type->vector_elements,
+ from->type->matrix_columns);
- ir_expression_operation op = get_conversion_operation(to, from->type, state);
- if (op) {
- from = new(ctx) ir_expression(op, to, from, NULL);
- return true;
- } else {
- return false;
+ switch (from->type->base_type) {
+ case GLSL_TYPE_INT:
+ from = new(ctx) ir_expression(ir_unop_i2f, to, from, NULL);
+ break;
+ case GLSL_TYPE_UINT:
+ from = new(ctx) ir_expression(ir_unop_u2f, to, from, NULL);
+ break;
+ case GLSL_TYPE_BOOL:
+ from = new(ctx) ir_expression(ir_unop_b2f, to, from, NULL);
+ break;
+ default:
+ assert(0);
}
+
+ return true;
}
@@ -810,10 +799,11 @@ do_assignment(exec_list *instructions, struct _mesa_glsl_parse_state *state,
"assignment to %s",
non_lvalue_description);
error_emitted = true;
- } else if (lhs_var != NULL && lhs_var->data.read_only) {
+ } else if (lhs->variable_referenced() != NULL
+ && lhs->variable_referenced()->data.read_only) {
_mesa_glsl_error(&lhs_loc, state,
"assignment to read-only variable '%s'",
- lhs_var->name);
+ lhs->variable_referenced()->name);
error_emitted = true;
} else if (lhs->type->is_array() &&
!state->check_version(120, 300, &lhs_loc,
@@ -912,6 +902,7 @@ get_lvalue_copy(exec_list *instructions, ir_rvalue *lvalue)
var = new(ctx) ir_variable(lvalue->type, "_post_incdec_tmp",
ir_var_temporary);
instructions->push_tail(var);
+ var->data.mode = ir_var_auto;
instructions->push_tail(new(ctx) ir_assignment(new(ctx) ir_dereference_variable(var),
lvalue));
@@ -2180,41 +2171,6 @@ validate_explicit_location(const struct ast_type_qualifier *qual,
{
bool fail = false;
- /* Checks for GL_ARB_explicit_uniform_location. */
- if (qual->flags.q.uniform) {
- if (!state->check_explicit_uniform_location_allowed(loc, var))
- return;
-
- const struct gl_context *const ctx = state->ctx;
- unsigned max_loc = qual->location + var->type->uniform_locations() - 1;
-
- /* ARB_explicit_uniform_location specification states:
- *
- * "The explicitly defined locations and the generated locations
- * must be in the range of 0 to MAX_UNIFORM_LOCATIONS minus one."
- *
- * "Valid locations for default-block uniform variable locations
- * are in the range of 0 to the implementation-defined maximum
- * number of uniform locations."
- */
- if (qual->location < 0) {
- _mesa_glsl_error(loc, state,
- "explicit location < 0 for uniform %s", var->name);
- return;
- }
-
- if (max_loc >= ctx->Const.MaxUserAssignableUniformLocations) {
- _mesa_glsl_error(loc, state, "location(s) consumed by uniform %s "
- ">= MAX_UNIFORM_LOCATIONS (%u)", var->name,
- ctx->Const.MaxUserAssignableUniformLocations);
- return;
- }
-
- var->data.explicit_location = true;
- var->data.location = qual->location;
- return;
- }
-
/* Between GL_ARB_explicit_attrib_location an
* GL_ARB_separate_shader_objects, the inputs and outputs of any shader
* stage can be assigned explicit locations. The checking here associates
@@ -2359,11 +2315,11 @@ apply_image_qualifier_to_variable(const struct ast_type_qualifier *qual,
"global variables");
}
- var->data.image_read_only |= qual->flags.q.read_only;
- var->data.image_write_only |= qual->flags.q.write_only;
- var->data.image_coherent |= qual->flags.q.coherent;
- var->data.image_volatile |= qual->flags.q._volatile;
- var->data.image_restrict |= qual->flags.q.restrict_flag;
+ var->data.image.read_only |= qual->flags.q.read_only;
+ var->data.image.write_only |= qual->flags.q.write_only;
+ var->data.image.coherent |= qual->flags.q.coherent;
+ var->data.image._volatile |= qual->flags.q._volatile;
+ var->data.image.restrict_flag |= qual->flags.q.restrict_flag;
var->data.read_only = true;
if (qual->flags.q.explicit_image_format) {
@@ -2377,7 +2333,7 @@ apply_image_qualifier_to_variable(const struct ast_type_qualifier *qual,
"base data type of the image");
}
- var->data.image_format = qual->image_format;
+ var->data.image.format = qual->image_format;
} else {
if (var->data.mode == ir_var_uniform && !qual->flags.q.write_only) {
_mesa_glsl_error(loc, state, "uniforms not qualified with "
@@ -2385,7 +2341,7 @@ apply_image_qualifier_to_variable(const struct ast_type_qualifier *qual,
"qualifier");
}
- var->data.image_format = GL_NONE;
+ var->data.image.format = GL_NONE;
}
}
}
@@ -2438,17 +2394,6 @@ apply_type_qualifier_to_variable(const struct ast_type_qualifier *qual,
}
}
- if (qual->flags.q.precise) {
- if (var->data.used) {
- _mesa_glsl_error(loc, state,
- "variable `%s' may not be redeclared "
- "`precise' after being used",
- var->name);
- } else {
- var->data.precise = 1;
- }
- }
-
if (qual->flags.q.constant || qual->flags.q.attribute
|| qual->flags.q.uniform
|| (qual->flags.q.varying && (state->stage == MESA_SHADER_FRAGMENT)))
@@ -2460,11 +2405,6 @@ apply_type_qualifier_to_variable(const struct ast_type_qualifier *qual,
if (qual->flags.q.sample)
var->data.sample = 1;
- if (state->stage == MESA_SHADER_GEOMETRY &&
- qual->flags.q.out && qual->flags.q.stream) {
- var->data.stream = qual->stream;
- }
-
if (qual->flags.q.attribute && state->stage != MESA_SHADER_VERTEX) {
var->type = glsl_type::error_type;
_mesa_glsl_error(loc, state,
@@ -2473,13 +2413,6 @@ apply_type_qualifier_to_variable(const struct ast_type_qualifier *qual,
_mesa_shader_stage_to_string(state->stage));
}
- /* Disallow layout qualifiers which may only appear on layout declarations. */
- if (qual->flags.q.prim_type) {
- _mesa_glsl_error(loc, state,
- "Primitive type may only be specified on GS input or output "
- "layout declaration, not on variables.");
- }
-
/* Section 6.1.1 (Function Calling Conventions) of the GLSL 1.10 spec says:
*
* "However, the const qualifier cannot be used with out or inout."
@@ -2498,7 +2431,6 @@ apply_type_qualifier_to_variable(const struct ast_type_qualifier *qual,
/* If there is no qualifier that changes the mode of the variable, leave
* the setting alone.
*/
- assert(var->data.mode != ir_var_temporary);
if (qual->flags.q.in && qual->flags.q.out)
var->data.mode = ir_var_function_inout;
else if (qual->flags.q.in)
@@ -2695,36 +2627,6 @@ apply_type_qualifier_to_variable(const struct ast_type_qualifier *qual,
const bool uses_deprecated_qualifier = qual->flags.q.attribute
|| qual->flags.q.varying;
-
- /* Validate auxiliary storage qualifiers */
-
- /* From section 4.3.4 of the GLSL 1.30 spec:
- * "It is an error to use centroid in in a vertex shader."
- *
- * From section 4.3.4 of the GLSL ES 3.00 spec:
- * "It is an error to use centroid in or interpolation qualifiers in
- * a vertex shader input."
- */
-
- /* Section 4.3.6 of the GLSL 1.30 specification states:
- * "It is an error to use centroid out in a fragment shader."
- *
- * The GL_ARB_shading_language_420pack extension specification states:
- * "It is an error to use auxiliary storage qualifiers or interpolation
- * qualifiers on an output in a fragment shader."
- */
- if (qual->flags.q.sample && (!is_varying_var(var, state->stage) || uses_deprecated_qualifier)) {
- _mesa_glsl_error(loc, state,
- "sample qualifier may only be used on `in` or `out` "
- "variables between shader stages");
- }
- if (qual->flags.q.centroid && !is_varying_var(var, state->stage)) {
- _mesa_glsl_error(loc, state,
- "centroid qualifier may only be used with `in', "
- "`out' or `varying' variables between shader stages");
- }
-
-
/* Is the 'layout' keyword used with parameters that allow relaxed checking.
* Many implementations of GL_ARB_fragment_coord_conventions_enable and some
* implementations (only Mesa?) GL_ARB_explicit_attrib_location_enable
@@ -3177,7 +3079,7 @@ validate_identifier(const char *identifier, YYLTYPE loc,
* OpenGL, and may not be declared in a shader as either a
* variable or a function."
*/
- if (is_gl_identifier(identifier)) {
+ if (strncmp(identifier, "gl_", 3) == 0) {
_mesa_glsl_error(&loc, state,
"identifier `%s' uses reserved `gl_' prefix",
identifier);
@@ -3202,41 +3104,6 @@ validate_identifier(const char *identifier, YYLTYPE loc,
}
}
-static bool
-precision_qualifier_allowed(const glsl_type *type)
-{
- /* Precision qualifiers apply to floating point, integer and sampler
- * types.
- *
- * Section 4.5.2 (Precision Qualifiers) of the GLSL 1.30 spec says:
- * "Any floating point or any integer declaration can have the type
- * preceded by one of these precision qualifiers [...] Literal
- * constants do not have precision qualifiers. Neither do Boolean
- * variables.
- *
- * Section 4.5 (Precision and Precision Qualifiers) of the GLSL 1.30
- * spec also says:
- *
- * "Precision qualifiers are added for code portability with OpenGL
- * ES, not for functionality. They have the same syntax as in OpenGL
- * ES."
- *
- * Section 8 (Built-In Functions) of the GLSL ES 1.00 spec says:
- *
- * "uniform lowp sampler2D sampler;
- * highp vec2 coord;
- * ...
- * lowp vec4 col = texture2D (sampler, coord);
- * // texture2D returns lowp"
- *
- * From this, we infer that GLSL 1.30 (and later) should allow precision
- * qualifiers on sampler types just like float and integer types.
- */
- return type->is_float()
- || type->is_integer()
- || type->is_record()
- || type->is_sampler();
-}
ir_rvalue *
ast_declarator_list::hir(exec_list *instructions,
@@ -3297,45 +3164,8 @@ ast_declarator_list::hir(exec_list *instructions,
return NULL;
}
- if (this->precise) {
- assert(this->type == NULL);
-
- foreach_list_typed (ast_declaration, decl, link, &this->declarations) {
- assert(decl->array_specifier == NULL);
- assert(decl->initializer == NULL);
-
- ir_variable *const earlier =
- state->symbols->get_variable(decl->identifier);
- if (earlier == NULL) {
- _mesa_glsl_error(& loc, state,
- "undeclared variable `%s' cannot be marked "
- "precise", decl->identifier);
- } else if (state->current_function != NULL &&
- !state->symbols->name_declared_this_scope(decl->identifier)) {
- /* Note: we have to check if we're in a function, since
- * builtins are treated as having come from another scope.
- */
- _mesa_glsl_error(& loc, state,
- "variable `%s' from an outer scope may not be "
- "redeclared `precise' in this scope",
- earlier->name);
- } else if (earlier->data.used) {
- _mesa_glsl_error(& loc, state,
- "variable `%s' may not be redeclared "
- "`precise' after being used",
- earlier->name);
- } else {
- earlier->data.precise = true;
- }
- }
-
- /* Precise redeclarations do not have r-values either. */
- return NULL;
- }
-
assert(this->type != NULL);
assert(!this->invariant);
- assert(!this->precise);
/* The type specifier may contain a structure definition. Process that
* before any of the variable declarations.
@@ -3717,6 +3547,45 @@ ast_declarator_list::hir(exec_list *instructions,
}
+ /* From section 4.3.4 of the GLSL 1.30 spec:
+ * "It is an error to use centroid in in a vertex shader."
+ *
+ * From section 4.3.4 of the GLSL ES 3.00 spec:
+ * "It is an error to use centroid in or interpolation qualifiers in
+ * a vertex shader input."
+ */
+ if (state->is_version(130, 300)
+ && this->type->qualifier.flags.q.centroid
+ && this->type->qualifier.flags.q.in
+ && state->stage == MESA_SHADER_VERTEX) {
+
+ _mesa_glsl_error(&loc, state,
+ "'centroid in' cannot be used in a vertex shader");
+ }
+
+ if (state->stage == MESA_SHADER_VERTEX
+ && this->type->qualifier.flags.q.sample
+ && this->type->qualifier.flags.q.in) {
+
+ _mesa_glsl_error(&loc, state,
+ "'sample in' cannot be used in a vertex shader");
+ }
+
+ /* Section 4.3.6 of the GLSL 1.30 specification states:
+ * "It is an error to use centroid out in a fragment shader."
+ *
+ * The GL_ARB_shading_language_420pack extension specification states:
+ * "It is an error to use auxiliary storage qualifiers or interpolation
+ * qualifiers on an output in a fragment shader."
+ */
+ if (state->stage == MESA_SHADER_FRAGMENT &&
+ this->type->qualifier.flags.q.out &&
+ this->type->qualifier.has_auxiliary_storage()) {
+ _mesa_glsl_error(&loc, state,
+ "auxiliary storage qualifiers cannot be used on "
+ "fragment shader outputs");
+ }
+
/* Precision qualifiers exists only in GLSL versions 1.00 and >= 1.30.
*/
if (this->type->qualifier.precision != ast_precision_none) {
@@ -3724,13 +3593,41 @@ ast_declarator_list::hir(exec_list *instructions,
}
- /* If a precision qualifier is allowed on a type, it is allowed on
- * an array of that type.
+ /* Precision qualifiers apply to floating point, integer and sampler
+ * types.
+ *
+ * Section 4.5.2 (Precision Qualifiers) of the GLSL 1.30 spec says:
+ * "Any floating point or any integer declaration can have the type
+ * preceded by one of these precision qualifiers [...] Literal
+ * constants do not have precision qualifiers. Neither do Boolean
+ * variables.
+ *
+ * Section 4.5 (Precision and Precision Qualifiers) of the GLSL 1.30
+ * spec also says:
+ *
+ * "Precision qualifiers are added for code portability with OpenGL
+ * ES, not for functionality. They have the same syntax as in OpenGL
+ * ES."
+ *
+ * Section 8 (Built-In Functions) of the GLSL ES 1.00 spec says:
+ *
+ * "uniform lowp sampler2D sampler;
+ * highp vec2 coord;
+ * ...
+ * lowp vec4 col = texture2D (sampler, coord);
+ * // texture2D returns lowp"
+ *
+ * From this, we infer that GLSL 1.30 (and later) should allow precision
+ * qualifiers on sampler types just like float and integer types.
*/
- if (!(this->type->qualifier.precision == ast_precision_none
- || precision_qualifier_allowed(var->type)
- || (var->type->is_array()
- && precision_qualifier_allowed(var->type->fields.array)))) {
+ if (this->type->qualifier.precision != ast_precision_none
+ && !var->type->is_float()
+ && !var->type->is_integer()
+ && !var->type->is_record()
+ && !var->type->is_sampler()
+ && !(var->type->is_array()
+ && (var->type->fields.array->is_float()
+ || var->type->fields.array->is_integer()))) {
_mesa_glsl_error(&loc, state,
"precision qualifiers apply only to floating point"
@@ -3757,7 +3654,7 @@ ast_declarator_list::hir(exec_list *instructions,
exec_list initializer_instructions;
/* Examine var name here since var may get deleted in the next call */
- bool var_is_gl_id = is_gl_identifier(var->name);
+ bool var_is_gl_id = (strncmp(var->name, "gl_", 3) == 0);
ir_variable *earlier =
get_variable_being_redeclared(var, decl->get_location(), state,
@@ -3767,7 +3664,7 @@ ast_declarator_list::hir(exec_list *instructions,
earlier->data.how_declared == ir_var_declared_in_block) {
_mesa_glsl_error(&loc, state,
"`%s' has already been redeclared using "
- "gl_PerVertex", earlier->name);
+ "gl_PerVertex", var->name);
}
earlier->data.how_declared = ir_var_declared_normally;
}
@@ -4117,27 +4014,12 @@ ast_function::hir(exec_list *instructions,
name);
}
- /* Create an ir_function if one doesn't already exist. */
- f = state->symbols->get_function(name);
- if (f == NULL) {
- f = new(ctx) ir_function(name);
- if (!state->symbols->add_function(f)) {
- /* This function name shadows a non-function use of the same name. */
- YYLTYPE loc = this->get_location();
-
- _mesa_glsl_error(&loc, state, "function name `%s' conflicts with "
- "non-function", name);
- return NULL;
- }
-
- emit_function(state, f);
- }
-
/* Verify that this function's signature either doesn't match a previously
* seen signature for a function with the same name, or, if a match is found,
* that the previously seen signature does not have an associated definition.
*/
- if (state->es_shader || f->has_user_signature()) {
+ f = state->symbols->get_function(name);
+ if (f != NULL && (state->es_shader || f->has_user_signature())) {
sig = f->exact_matching_signature(state, &hir_parameters);
if (sig != NULL) {
const char *badvar = sig->qualifiers_match(&hir_parameters);
@@ -4168,6 +4050,18 @@ ast_function::hir(exec_list *instructions,
}
}
}
+ } else {
+ f = new(ctx) ir_function(name);
+ if (!state->symbols->add_function(f)) {
+ /* This function name shadows a non-function use of the same name. */
+ YYLTYPE loc = this->get_location();
+
+ _mesa_glsl_error(&loc, state, "function name `%s' conflicts with "
+ "non-function", name);
+ return NULL;
+ }
+
+ emit_function(state, f);
}
/* Verify the return type of main() */
@@ -4220,8 +4114,10 @@ ast_function_definition::hir(exec_list *instructions,
* Add these to the symbol table.
*/
state->symbols->push_scope();
- foreach_in_list(ir_variable, var, &signature->parameters) {
- assert(var->as_variable() != NULL);
+ foreach_list(n, &signature->parameters) {
+ ir_variable *const var = ((ir_instruction *) n)->as_variable();
+
+ assert(var != NULL);
/* The only way a parameter would "exist" is if two parameters have
* the same name.
@@ -4373,7 +4269,7 @@ ast_jump_statement::hir(exec_list *instructions,
* loop.
*/
if (state->loop_nesting_ast != NULL &&
- mode == ast_continue && !state->switch_state.is_switch_innermost) {
+ mode == ast_continue) {
if (state->loop_nesting_ast->rest_expression) {
state->loop_nesting_ast->rest_expression->hir(instructions,
state);
@@ -4385,27 +4281,19 @@ ast_jump_statement::hir(exec_list *instructions,
}
if (state->switch_state.is_switch_innermost &&
- mode == ast_continue) {
- /* Set 'continue_inside' to true. */
- ir_rvalue *const true_val = new (ctx) ir_constant(true);
- ir_dereference_variable *deref_continue_inside_var =
- new(ctx) ir_dereference_variable(state->switch_state.continue_inside);
- instructions->push_tail(new(ctx) ir_assignment(deref_continue_inside_var,
- true_val));
-
- /* Break out from the switch, continue for the loop will
- * be called right after switch. */
- ir_loop_jump *const jump =
- new(ctx) ir_loop_jump(ir_loop_jump::jump_break);
- instructions->push_tail(jump);
-
- } else if (state->switch_state.is_switch_innermost &&
mode == ast_break) {
- /* Force break out of switch by inserting a break. */
- ir_loop_jump *const jump =
- new(ctx) ir_loop_jump(ir_loop_jump::jump_break);
- instructions->push_tail(jump);
- } else {
+ /* Force break out of switch by setting is_break switch state.
+ */
+ ir_variable *const is_break_var = state->switch_state.is_break_var;
+ ir_dereference_variable *const deref_is_break_var =
+ new(ctx) ir_dereference_variable(is_break_var);
+ ir_constant *const true_val = new(ctx) ir_constant(true);
+ ir_assignment *const set_break_var =
+ new(ctx) ir_assignment(deref_is_break_var, true_val);
+
+ instructions->push_tail(set_break_var);
+ }
+ else {
ir_loop_jump *const jump =
new(ctx) ir_loop_jump((mode == ast_break)
? ir_loop_jump::jump_break
@@ -4517,62 +4405,27 @@ ast_switch_statement::hir(exec_list *instructions,
instructions->push_tail(new(ctx) ir_assignment(deref_is_fallthru_var,
is_fallthru_val));
- /* Initialize continue_inside state to false.
+ /* Initalize is_break state to false.
*/
- state->switch_state.continue_inside =
+ ir_rvalue *const is_break_val = new (ctx) ir_constant(false);
+ state->switch_state.is_break_var =
new(ctx) ir_variable(glsl_type::bool_type,
- "continue_inside_tmp",
+ "switch_is_break_tmp",
ir_var_temporary);
- instructions->push_tail(state->switch_state.continue_inside);
-
- ir_rvalue *const false_val = new (ctx) ir_constant(false);
- ir_dereference_variable *deref_continue_inside_var =
- new(ctx) ir_dereference_variable(state->switch_state.continue_inside);
- instructions->push_tail(new(ctx) ir_assignment(deref_continue_inside_var,
- false_val));
+ instructions->push_tail(state->switch_state.is_break_var);
- state->switch_state.run_default =
- new(ctx) ir_variable(glsl_type::bool_type,
- "run_default_tmp",
- ir_var_temporary);
- instructions->push_tail(state->switch_state.run_default);
-
- /* Loop around the switch is used for flow control. */
- ir_loop * loop = new(ctx) ir_loop();
- instructions->push_tail(loop);
+ ir_dereference_variable *deref_is_break_var =
+ new(ctx) ir_dereference_variable(state->switch_state.is_break_var);
+ instructions->push_tail(new(ctx) ir_assignment(deref_is_break_var,
+ is_break_val));
/* Cache test expression.
*/
- test_to_hir(&loop->body_instructions, state);
+ test_to_hir(instructions, state);
/* Emit code for body of switch stmt.
*/
- body->hir(&loop->body_instructions, state);
-
- /* Insert a break at the end to exit loop. */
- ir_loop_jump *jump = new(ctx) ir_loop_jump(ir_loop_jump::jump_break);
- loop->body_instructions.push_tail(jump);
-
- /* If we are inside loop, check if continue got called inside switch. */
- if (state->loop_nesting_ast != NULL) {
- ir_dereference_variable *deref_continue_inside =
- new(ctx) ir_dereference_variable(state->switch_state.continue_inside);
- ir_if *irif = new(ctx) ir_if(deref_continue_inside);
- ir_loop_jump *jump = new(ctx) ir_loop_jump(ir_loop_jump::jump_continue);
-
- if (state->loop_nesting_ast != NULL) {
- if (state->loop_nesting_ast->rest_expression) {
- state->loop_nesting_ast->rest_expression->hir(&irif->then_instructions,
- state);
- }
- if (state->loop_nesting_ast->mode ==
- ast_iteration_statement::ast_do_while) {
- state->loop_nesting_ast->condition_to_hir(&irif->then_instructions, state);
- }
- }
- irif->then_instructions.push_tail(jump);
- instructions->push_tail(irif);
- }
+ body->hir(instructions, state);
hash_table_dtor(state->switch_state.labels_ht);
@@ -4620,71 +4473,8 @@ ir_rvalue *
ast_case_statement_list::hir(exec_list *instructions,
struct _mesa_glsl_parse_state *state)
{
- exec_list default_case, after_default, tmp;
-
- foreach_list_typed (ast_case_statement, case_stmt, link, & this->cases) {
- case_stmt->hir(&tmp, state);
-
- /* Default case. */
- if (state->switch_state.previous_default && default_case.is_empty()) {
- default_case.append_list(&tmp);
- continue;
- }
-
- /* If default case found, append 'after_default' list. */
- if (!default_case.is_empty())
- after_default.append_list(&tmp);
- else
- instructions->append_list(&tmp);
- }
-
- /* Handle the default case. This is done here because default might not be
- * the last case. We need to add checks against following cases first to see
- * if default should be chosen or not.
- */
- if (!default_case.is_empty()) {
-
- ir_rvalue *const true_val = new (state) ir_constant(true);
- ir_dereference_variable *deref_run_default_var =
- new(state) ir_dereference_variable(state->switch_state.run_default);
-
- /* Choose to run default case initially, following conditional
- * assignments might change this.
- */
- ir_assignment *const init_var =
- new(state) ir_assignment(deref_run_default_var, true_val);
- instructions->push_tail(init_var);
-
- /* Default case was the last one, no checks required. */
- if (after_default.is_empty()) {
- instructions->append_list(&default_case);
- return NULL;
- }
-
- foreach_in_list(ir_instruction, ir, &after_default) {
- ir_assignment *assign = ir->as_assignment();
-
- if (!assign)
- continue;
-
- /* Clone the check between case label and init expression. */
- ir_expression *exp = (ir_expression*) assign->condition;
- ir_expression *clone = exp->clone(state, NULL);
-
- ir_dereference_variable *deref_var =
- new(state) ir_dereference_variable(state->switch_state.run_default);
- ir_rvalue *const false_val = new (state) ir_constant(false);
-
- ir_assignment *const set_false =
- new(state) ir_assignment(deref_var, false_val, clone);
-
- instructions->push_tail(set_false);
- }
-
- /* Append default case and all cases after it. */
- instructions->append_list(&default_case);
- instructions->append_list(&after_default);
- }
+ foreach_list_typed (ast_case_statement, case_stmt, link, & this->cases)
+ case_stmt->hir(instructions, state);
/* Case statements do not have r-values. */
return NULL;
@@ -4696,6 +4486,18 @@ ast_case_statement::hir(exec_list *instructions,
{
labels->hir(instructions, state);
+ /* Conditionally set fallthru state based on break state. */
+ ir_constant *const false_val = new(state) ir_constant(false);
+ ir_dereference_variable *const deref_is_fallthru_var =
+ new(state) ir_dereference_variable(state->switch_state.is_fallthru_var);
+ ir_dereference_variable *const deref_is_break_var =
+ new(state) ir_dereference_variable(state->switch_state.is_break_var);
+ ir_assignment *const reset_fallthru_on_break =
+ new(state) ir_assignment(deref_is_fallthru_var,
+ false_val,
+ deref_is_break_var);
+ instructions->push_tail(reset_fallthru_on_break);
+
/* Guard case statements depending on fallthru state. */
ir_dereference_variable *const deref_fallthru_guard =
new(state) ir_dereference_variable(state->switch_state.is_fallthru_var);
@@ -4771,51 +4573,9 @@ ast_case_label::hir(exec_list *instructions,
ir_dereference_variable *deref_test_var =
new(ctx) ir_dereference_variable(state->switch_state.test_var);
- ir_expression *test_cond = new(ctx) ir_expression(ir_binop_all_equal,
- label_const,
- deref_test_var);
-
- /*
- * From GLSL 4.40 specification section 6.2 ("Selection"):
- *
- * "The type of the init-expression value in a switch statement must
- * be a scalar int or uint. The type of the constant-expression value
- * in a case label also must be a scalar int or uint. When any pair
- * of these values is tested for "equal value" and the types do not
- * match, an implicit conversion will be done to convert the int to a
- * uint (see section 4.1.10 “Implicit Conversions”) before the compare
- * is done."
- */
- if (label_const->type != state->switch_state.test_var->type) {
- YYLTYPE loc = this->test_value->get_location();
-
- const glsl_type *type_a = label_const->type;
- const glsl_type *type_b = state->switch_state.test_var->type;
-
- /* Check if int->uint implicit conversion is supported. */
- bool integer_conversion_supported =
- glsl_type::int_type->can_implicitly_convert_to(glsl_type::uint_type,
- state);
-
- if ((!type_a->is_integer() || !type_b->is_integer()) ||
- !integer_conversion_supported) {
- _mesa_glsl_error(&loc, state, "type mismatch with switch "
- "init-expression and case label (%s != %s)",
- type_a->name, type_b->name);
- } else {
- /* Conversion of the case label. */
- if (type_a->base_type == GLSL_TYPE_INT) {
- if (!apply_implicit_conversion(glsl_type::uint_type,
- test_cond->operands[0], state))
- _mesa_glsl_error(&loc, state, "implicit type conversion error");
- } else {
- /* Conversion of the init-expression value. */
- if (!apply_implicit_conversion(glsl_type::uint_type,
- test_cond->operands[1], state))
- _mesa_glsl_error(&loc, state, "implicit type conversion error");
- }
- }
- }
+ ir_rvalue *const test_cond = new(ctx) ir_expression(ir_binop_all_equal,
+ label_const,
+ deref_test_var);
ir_assignment *set_fallthru_on_test =
new(ctx) ir_assignment(deref_fallthru_var, true_val, test_cond);
@@ -4832,17 +4592,9 @@ ast_case_label::hir(exec_list *instructions,
}
state->switch_state.previous_default = this;
- /* Set fallthru condition on 'run_default' bool. */
- ir_dereference_variable *deref_run_default =
- new(ctx) ir_dereference_variable(state->switch_state.run_default);
- ir_rvalue *const cond_true = new(ctx) ir_constant(true);
- ir_expression *test_cond = new(ctx) ir_expression(ir_binop_all_equal,
- cond_true,
- deref_run_default);
-
/* Set falltrhu state. */
ir_assignment *set_fallthru =
- new(ctx) ir_assignment(deref_fallthru_var, true_val, test_cond);
+ new(ctx) ir_assignment(deref_fallthru_var, true_val);
instructions->push_tail(set_fallthru);
}
@@ -5056,7 +4808,7 @@ ast_type_specifier::hir(exec_list *instructions,
*/
ir_variable *const junk =
new(state) ir_variable(type, "#default precision",
- ir_var_auto);
+ ir_var_temporary);
state->symbols->add_variable(junk);
}
@@ -5107,7 +4859,7 @@ ast_process_structure_or_interface_block(exec_list *instructions,
YYLTYPE &loc,
glsl_struct_field **fields_ret,
bool is_interface,
- enum glsl_matrix_layout matrix_layout,
+ bool block_row_major,
bool allow_reserved_names,
ir_variable_mode var_mode)
{
@@ -5119,7 +4871,9 @@ ast_process_structure_or_interface_block(exec_list *instructions,
* 'declarations' list in each of the elements.
*/
foreach_list_typed (ast_declarator_list, decl_list, link, declarations) {
- decl_count += decl_list->declarations.length();
+ foreach_list_const (decl_ptr, & decl_list->declarations) {
+ decl_count++;
+ }
}
/* Allocate storage for the fields and process the field
@@ -5213,9 +4967,6 @@ ast_process_structure_or_interface_block(exec_list *instructions,
fields[i].centroid = qual->flags.q.centroid ? 1 : 0;
fields[i].sample = qual->flags.q.sample ? 1 : 0;
- /* Only save explicitly defined streams in block's field */
- fields[i].stream = qual->flags.q.explicit_stream ? qual->stream : -1;
-
if (qual->flags.q.row_major || qual->flags.q.column_major) {
if (!qual->flags.q.uniform) {
_mesa_glsl_error(&loc, state,
@@ -5231,39 +4982,16 @@ ast_process_structure_or_interface_block(exec_list *instructions,
"with uniform interface blocks");
}
- if ((qual->flags.q.uniform || !is_interface) &&
- qual->has_auxiliary_storage()) {
- _mesa_glsl_error(&loc, state,
- "auxiliary storage qualifiers cannot be used "
- "in uniform blocks or structures.");
- }
-
- /* Propogate row- / column-major information down the fields of the
- * structure or interface block. Structures need this data because
- * the structure may contain a structure that contains ... a matrix
- * that need the proper layout.
- */
- if (field_type->without_array()->is_matrix()
- || field_type->without_array()->is_record()) {
- /* If no layout is specified for the field, inherit the layout
- * from the block.
- */
- fields[i].matrix_layout = matrix_layout;
-
+ if (field_type->is_matrix() ||
+ (field_type->is_array() && field_type->fields.array->is_matrix())) {
+ fields[i].row_major = block_row_major;
if (qual->flags.q.row_major)
- fields[i].matrix_layout = GLSL_MATRIX_LAYOUT_ROW_MAJOR;
+ fields[i].row_major = true;
else if (qual->flags.q.column_major)
- fields[i].matrix_layout = GLSL_MATRIX_LAYOUT_COLUMN_MAJOR;
-
- /* If we're processing an interface block, the matrix layout must
- * be decided by this point.
- */
- assert(!is_interface
- || fields[i].matrix_layout == GLSL_MATRIX_LAYOUT_ROW_MAJOR
- || fields[i].matrix_layout == GLSL_MATRIX_LAYOUT_COLUMN_MAJOR);
+ fields[i].row_major = false;
}
- i++;
+ i++;
}
}
@@ -5303,7 +5031,7 @@ ast_struct_specifier::hir(exec_list *instructions,
*/
if (state->language_version != 110 && state->struct_specifier_depth != 0)
_mesa_glsl_error(&loc, state,
- "embedded structure declarations are not allowed");
+ "embedded structure declartions are not allowed");
state->struct_specifier_depth++;
@@ -5315,7 +5043,7 @@ ast_struct_specifier::hir(exec_list *instructions,
loc,
&fields,
false,
- GLSL_MATRIX_LAYOUT_INHERITED,
+ false,
false /* allow_reserved_names */,
ir_var_auto);
@@ -5415,21 +5143,10 @@ ast_interface_block::hir(exec_list *instructions,
assert(!"interface block layout qualifier not found!");
}
- enum glsl_matrix_layout matrix_layout = GLSL_MATRIX_LAYOUT_INHERITED;
- if (this->layout.flags.q.row_major)
- matrix_layout = GLSL_MATRIX_LAYOUT_ROW_MAJOR;
- else if (this->layout.flags.q.column_major)
- matrix_layout = GLSL_MATRIX_LAYOUT_COLUMN_MAJOR;
-
bool redeclaring_per_vertex = strcmp(this->block_name, "gl_PerVertex") == 0;
+ bool block_row_major = this->layout.flags.q.row_major;
exec_list declared_variables;
glsl_struct_field *fields;
-
- /* Treat an interface block as one level of nesting, so that embedded struct
- * specifiers will be disallowed.
- */
- state->struct_specifier_depth++;
-
unsigned int num_variables =
ast_process_structure_or_interface_block(&declared_variables,
state,
@@ -5437,12 +5154,10 @@ ast_interface_block::hir(exec_list *instructions,
loc,
&fields,
true,
- matrix_layout,
+ block_row_major,
redeclaring_per_vertex,
var_mode);
- state->struct_specifier_depth--;
-
if (!redeclaring_per_vertex)
validate_identifier(this->block_name, loc, state);
@@ -5487,7 +5202,7 @@ ast_interface_block::hir(exec_list *instructions,
}
if (this->instance_name != NULL) {
_mesa_glsl_error(&loc, state,
- "gl_PerVertex output may not be redeclared with "
+ "gl_PerVertex input may not be redeclared with "
"an instance name");
}
break;
@@ -5645,9 +5360,6 @@ ast_interface_block::hir(exec_list *instructions,
var_mode);
}
- var->data.matrix_layout = matrix_layout == GLSL_MATRIX_LAYOUT_INHERITED
- ? GLSL_MATRIX_LAYOUT_COLUMN_MAJOR : matrix_layout;
-
if (state->stage == MESA_SHADER_GEOMETRY && var_mode == ir_var_shader_in)
handle_geometry_shader_input_decl(state, loc, var);
@@ -5688,39 +5400,17 @@ ast_interface_block::hir(exec_list *instructions,
var->data.sample = fields[i].sample;
var->init_interface_type(block_type);
- if (fields[i].matrix_layout == GLSL_MATRIX_LAYOUT_INHERITED) {
- var->data.matrix_layout = matrix_layout == GLSL_MATRIX_LAYOUT_INHERITED
- ? GLSL_MATRIX_LAYOUT_COLUMN_MAJOR : matrix_layout;
- } else {
- var->data.matrix_layout = fields[i].matrix_layout;
- }
-
- if (fields[i].stream != -1 &&
- ((unsigned)fields[i].stream) != this->layout.stream) {
- _mesa_glsl_error(&loc, state,
- "stream layout qualifier on "
- "interface block member `%s' does not match "
- "the interface block (%d vs %d)",
- var->name, fields[i].stream, this->layout.stream);
- }
-
- var->data.stream = this->layout.stream;
-
- /* Examine var name here since var may get deleted in the next call */
- bool var_is_gl_id = is_gl_identifier(var->name);
-
if (redeclaring_per_vertex) {
ir_variable *earlier =
get_variable_being_redeclared(var, loc, state,
true /* allow_all_redeclarations */);
- if (!var_is_gl_id || earlier == NULL) {
+ if (strncmp(var->name, "gl_", 3) != 0 || earlier == NULL) {
_mesa_glsl_error(&loc, state,
"redeclaration of gl_PerVertex can only "
"include built-in variables");
} else if (earlier->data.how_declared == ir_var_declared_normally) {
_mesa_glsl_error(&loc, state,
- "`%s' has already been redeclared",
- earlier->name);
+ "`%s' has already been redeclared", var->name);
} else {
earlier->data.how_declared = ir_var_declared_in_block;
earlier->reinit_interface_type(block_type);
@@ -5764,8 +5454,8 @@ ast_interface_block::hir(exec_list *instructions,
* thinking there are conflicting definitions of gl_PerVertex in the
* shader.
*/
- foreach_in_list_safe(ir_instruction, node, instructions) {
- ir_variable *const var = node->as_variable();
+ foreach_list_safe(node, instructions) {
+ ir_variable *const var = ((ir_instruction *) node)->as_variable();
if (var != NULL &&
var->get_interface_type() == earlier_per_vertex &&
var->data.mode == var_mode) {
@@ -5821,8 +5511,8 @@ ast_gs_input_layout::hir(exec_list *instructions,
/* If any shader inputs occurred before this declaration and did not
* specify an array size, their size is determined now.
*/
- foreach_in_list(ir_instruction, node, instructions) {
- ir_variable *var = node->as_variable();
+ foreach_list (node, instructions) {
+ ir_variable *var = ((ir_instruction *) node)->as_variable();
if (var == NULL || var->data.mode != ir_var_shader_in)
continue;
@@ -5939,8 +5629,8 @@ detect_conflicting_assignments(struct _mesa_glsl_parse_state *state,
YYLTYPE loc;
memset(&loc, 0, sizeof(loc));
- foreach_in_list(ir_instruction, node, instructions) {
- ir_variable *var = node->as_variable();
+ foreach_list(node, instructions) {
+ ir_variable *var = ((ir_instruction *)node)->as_variable();
if (!var || !var->data.assigned)
continue;
@@ -5949,7 +5639,7 @@ detect_conflicting_assignments(struct _mesa_glsl_parse_state *state,
gl_FragColor_assigned = true;
else if (strcmp(var->name, "gl_FragData") == 0)
gl_FragData_assigned = true;
- else if (!is_gl_identifier(var->name)) {
+ else if (strncmp(var->name, "gl_", 3) != 0) {
if (state->stage == MESA_SHADER_FRAGMENT &&
var->data.mode == ir_var_shader_out) {
user_defined_fs_output_assigned = true;
@@ -6029,8 +5719,8 @@ remove_per_vertex_blocks(exec_list *instructions,
/* Remove any ir_variable declarations that refer to the interface block
* we're removing.
*/
- foreach_in_list_safe(ir_instruction, node, instructions) {
- ir_variable *const var = node->as_variable();
+ foreach_list_safe(node, instructions) {
+ ir_variable *const var = ((ir_instruction *) node)->as_variable();
if (var != NULL && var->get_interface_type() == per_vertex &&
var->data.mode == mode) {
state->symbols->disable_variable(var->name);
diff --git a/dist/Mesa/src/glsl/ast_type.cpp b/dist/Mesa/src/glsl/ast_type.cpp
index b596cd59e..0ee2c495a 100644
--- a/dist/Mesa/src/glsl/ast_type.cpp
+++ b/dist/Mesa/src/glsl/ast_type.cpp
@@ -122,28 +122,14 @@ ast_type_qualifier::merge_qualifier(YYLTYPE *loc,
ubo_binding_mask.flags.q.explicit_binding = 1;
ubo_binding_mask.flags.q.explicit_offset = 1;
- ast_type_qualifier stream_layout_mask;
- stream_layout_mask.flags.i = 0;
- stream_layout_mask.flags.q.stream = 1;
-
/* Uniform block layout qualifiers get to overwrite each
* other (rightmost having priority), while all other
* qualifiers currently don't allow duplicates.
*/
- ast_type_qualifier allowed_duplicates_mask;
- allowed_duplicates_mask.flags.i =
- ubo_mat_mask.flags.i |
- ubo_layout_mask.flags.i |
- ubo_binding_mask.flags.i;
-
- /* Geometry shaders can have several layout qualifiers
- * assigning different stream values.
- */
- if (state->stage == MESA_SHADER_GEOMETRY)
- allowed_duplicates_mask.flags.i |=
- stream_layout_mask.flags.i;
- if ((this->flags.i & q.flags.i & ~allowed_duplicates_mask.flags.i) != 0) {
+ if ((this->flags.i & q.flags.i & ~(ubo_mat_mask.flags.i |
+ ubo_layout_mask.flags.i |
+ ubo_binding_mask.flags.i)) != 0) {
_mesa_glsl_error(loc, state,
"duplicate layout qualifiers used");
return false;
@@ -168,49 +154,6 @@ ast_type_qualifier::merge_qualifier(YYLTYPE *loc,
this->max_vertices = q.max_vertices;
}
- if (q.flags.q.invocations) {
- if (this->flags.q.invocations && this->invocations != q.invocations) {
- _mesa_glsl_error(loc, state,
- "geometry shader set conflicting invocations "
- "(%d and %d)", this->invocations, q.invocations);
- return false;
- }
- this->invocations = q.invocations;
- }
-
- if (state->stage == MESA_SHADER_GEOMETRY &&
- state->has_explicit_attrib_stream()) {
- if (q.flags.q.stream && q.stream >= state->ctx->Const.MaxVertexStreams) {
- _mesa_glsl_error(loc, state,
- "`stream' value is larger than MAX_VERTEX_STREAMS - 1 "
- "(%d > %d)",
- q.stream, state->ctx->Const.MaxVertexStreams - 1);
- }
- if (this->flags.q.explicit_stream &&
- this->stream >= state->ctx->Const.MaxVertexStreams) {
- _mesa_glsl_error(loc, state,
- "`stream' value is larger than MAX_VERTEX_STREAMS - 1 "
- "(%d > %d)",
- this->stream, state->ctx->Const.MaxVertexStreams - 1);
- }
-
- if (!this->flags.q.explicit_stream) {
- if (q.flags.q.stream) {
- this->flags.q.stream = 1;
- this->stream = q.stream;
- } else if (!this->flags.q.stream && this->flags.q.out) {
- /* Assign default global stream value */
- this->flags.q.stream = 1;
- this->stream = state->out_qualifier->stream;
- }
- } else {
- if (q.flags.q.explicit_stream) {
- _mesa_glsl_error(loc, state,
- "duplicate layout `stream' qualifier");
- }
- }
- }
-
if ((q.flags.i & ubo_mat_mask.flags.i) != 0)
this->flags.i &= ~ubo_mat_mask.flags.i;
if ((q.flags.i & ubo_layout_mask.flags.i) != 0)
@@ -304,7 +247,7 @@ ast_type_qualifier::merge_in_qualifier(YYLTYPE *loc,
q.flags.q.local_size != 0 &&
state->in_qualifier->flags.q.local_size == 0;
- valid_in_mask.flags.q.local_size = 7;
+ valid_in_mask.flags.q.local_size = 1;
break;
default:
_mesa_glsl_error(loc, state,
diff --git a/dist/Mesa/src/glsl/glcpp/glcpp-lex.c b/dist/Mesa/src/glsl/glcpp/glcpp-lex.c
index b2e982ef4..e0468f517 100644
--- a/dist/Mesa/src/glsl/glcpp/glcpp-lex.c
+++ b/dist/Mesa/src/glsl/glcpp/glcpp-lex.c
@@ -351,8 +351,8 @@ static void yy_fatal_error (yyconst char msg[] ,yyscan_t yyscanner );
*yy_cp = '\0'; \
yyg->yy_c_buf_p = yy_cp;
-#define YY_NUM_RULES 52
-#define YY_END_OF_BUFFER 53
+#define YY_NUM_RULES 43
+#define YY_END_OF_BUFFER 44
/* This struct is not used in this scanner,
but its presence is necessary. */
struct yy_trans_info
@@ -360,45 +360,42 @@ struct yy_trans_info
flex_int32_t yy_verify;
flex_int32_t yy_nxt;
};
-static yyconst flex_int16_t yy_accept[174] =
+static yyconst flex_int16_t yy_accept[151] =
{ 0,
- 0, 0, 3, 3, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 53, 48, 49, 50, 51, 50,
- 47, 8, 47, 47, 47, 47, 47, 47, 31, 30,
- 47, 47, 47, 45, 45, 47, 3, 4, 4, 5,
- 29, 27, 51, 26, 24, 23, 13, 13, 24, 24,
- 24, 24, 24, 24, 24, 24, 48, 50, 38, 43,
- 39, 41, 42, 46, 2, 1, 46, 31, 46, 31,
- 46, 30, 30, 33, 35, 37, 36, 34, 45, 45,
- 40, 3, 4, 4, 4, 5, 6, 6, 5, 7,
- 29, 27, 28, 1, 25, 26, 23, 13, 0, 0,
-
- 0, 0, 0, 0, 0, 0, 0, 0, 1, 32,
- 32, 45, 4, 6, 28, 1, 0, 0, 0, 0,
- 0, 0, 16, 0, 0, 0, 0, 0, 0, 32,
- 45, 0, 0, 18, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 45, 0, 17, 19, 20, 0, 14,
- 0, 12, 0, 22, 0, 45, 21, 20, 0, 15,
- 11, 0, 44, 21, 0, 11, 11, 10, 0, 0,
- 9, 11, 0
+ 0, 0, 0, 0, 3, 3, 0, 0, 0, 0,
+ 0, 0, 0, 0, 44, 39, 40, 41, 43, 38,
+ 43, 38, 38, 38, 25, 24, 38, 38, 38, 37,
+ 37, 38, 40, 23, 3, 4, 5, 42, 17, 17,
+ 17, 21, 39, 32, 35, 33, 2, 1, 25, 25,
+ 0, 24, 24, 27, 29, 31, 30, 28, 37, 37,
+ 34, 0, 23, 23, 0, 0, 0, 0, 0, 0,
+ 0, 3, 4, 5, 6, 5, 7, 0, 0, 0,
+ 0, 20, 21, 1, 26, 37, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 26, 37, 0, 0,
+
+ 0, 0, 0, 0, 13, 0, 0, 0, 0, 0,
+ 0, 37, 0, 0, 15, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 37, 0, 14, 16, 18, 0,
+ 11, 0, 10, 0, 22, 0, 36, 0, 18, 0,
+ 12, 0, 0, 19, 0, 9, 0, 0, 8, 0
} ;
static yyconst flex_int32_t yy_ec[256] =
{ 0,
1, 1, 1, 1, 1, 1, 1, 1, 2, 3,
- 4, 4, 5, 1, 1, 1, 1, 1, 1, 1,
+ 4, 4, 4, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 2, 6, 1, 7, 1, 8, 9, 1, 10,
- 8, 11, 12, 8, 13, 14, 15, 16, 17, 17,
- 17, 17, 17, 17, 17, 18, 18, 1, 8, 19,
- 20, 21, 1, 1, 22, 22, 22, 22, 23, 22,
- 24, 24, 24, 24, 24, 24, 24, 24, 24, 25,
- 24, 24, 24, 24, 26, 24, 24, 27, 24, 24,
- 8, 1, 8, 8, 24, 1, 28, 22, 22, 29,
-
- 30, 31, 32, 24, 33, 24, 24, 34, 35, 36,
- 37, 38, 24, 39, 40, 41, 42, 43, 24, 44,
- 24, 24, 8, 45, 8, 8, 1, 1, 1, 1,
+ 1, 2, 5, 1, 6, 1, 7, 8, 1, 9,
+ 7, 10, 7, 7, 7, 7, 11, 12, 13, 13,
+ 13, 13, 13, 13, 13, 14, 14, 1, 7, 15,
+ 16, 17, 1, 1, 18, 18, 18, 18, 18, 18,
+ 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
+ 19, 19, 19, 19, 20, 19, 19, 21, 19, 19,
+ 7, 1, 7, 7, 19, 1, 22, 18, 18, 23,
+
+ 24, 25, 26, 19, 27, 19, 19, 28, 29, 30,
+ 31, 32, 19, 33, 34, 35, 36, 37, 19, 38,
+ 19, 19, 7, 39, 7, 7, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
@@ -415,175 +412,144 @@ static yyconst flex_int32_t yy_ec[256] =
1, 1, 1, 1, 1
} ;
-static yyconst flex_int32_t yy_meta[46] =
+static yyconst flex_int32_t yy_meta[40] =
{ 0,
- 1, 2, 3, 2, 3, 1, 1, 1, 1, 4,
- 5, 1, 1, 6, 1, 7, 7, 7, 1, 1,
- 1, 7, 7, 7, 7, 7, 7, 7, 8, 7,
- 7, 7, 7, 7, 7, 8, 7, 7, 7, 7,
- 7, 7, 7, 7, 1
+ 1, 1, 2, 1, 1, 1, 1, 1, 3, 4,
+ 1, 5, 5, 5, 1, 1, 1, 5, 6, 6,
+ 6, 5, 7, 5, 5, 6, 6, 6, 6, 8,
+ 6, 6, 6, 6, 6, 6, 6, 6, 1
} ;
-static yyconst flex_int16_t yy_base[191] =
+static yyconst flex_int16_t yy_base[165] =
{ 0,
- 0, 0, 43, 44, 55, 0, 47, 48, 99, 141,
- 102, 103, 106, 107, 435, 433, 436, 428, 436, 429,
- 411, 423, 436, 420, 416, 414, 99, 107, 169, 198,
- 100, 406, 103, 0, 395, 379, 122, 418, 419, 144,
- 0, 419, 115, 410, 436, 417, 413, 414, 120, 386,
- 114, 384, 381, 374, 376, 381, 409, 436, 436, 436,
- 436, 436, 436, 138, 436, 0, 139, 164, 197, 126,
- 229, 0, 139, 436, 436, 436, 436, 436, 0, 378,
- 436, 131, 403, 404, 436, 186, 401, 402, 197, 436,
- 0, 402, 0, 163, 436, 393, 400, 436, 370, 133,
-
- 371, 360, 357, 169, 361, 368, 366, 355, 0, 146,
- 191, 360, 436, 436, 0, 227, 359, 360, 360, 356,
- 351, 357, 436, 356, 356, 341, 329, 319, 301, 206,
- 304, 297, 0, 436, 297, 288, 276, 280, 268, 261,
- 220, 219, 216, 218, 214, 436, 436, 0, 203, 436,
- 207, 232, 198, 436, 188, 164, 185, 0, 145, 436,
- 251, 124, 0, 155, 117, 227, 259, 436, 138, 85,
- 111, 234, 436, 264, 272, 280, 283, 285, 293, 301,
- 309, 317, 322, 330, 338, 346, 354, 362, 368, 376
+ 0, 38, 0, 0, 38, 39, 319, 318, 317, 44,
+ 50, 0, 0, 0, 319, 317, 323, 323, 323, 301,
+ 310, 323, 307, 80, 80, 83, 83, 298, 88, 0,
+ 289, 273, 100, 118, 308, 323, 104, 323, 323, 106,
+ 107, 301, 308, 323, 323, 323, 323, 0, 113, 323,
+ 0, 115, 323, 323, 323, 323, 323, 323, 0, 283,
+ 323, 111, 301, 300, 281, 110, 279, 276, 269, 271,
+ 276, 296, 323, 149, 323, 153, 323, 130, 120, 151,
+ 15, 323, 289, 0, 74, 270, 271, 96, 272, 261,
+ 258, 135, 262, 269, 267, 256, 323, 258, 260, 261,
+
+ 261, 257, 252, 258, 323, 257, 257, 255, 252, 253,
+ 242, 245, 231, 0, 323, 228, 219, 216, 213, 208,
+ 216, 148, 151, 147, 150, 148, 323, 323, 0, 137,
+ 323, 145, 167, 146, 323, 136, 0, 164, 0, 135,
+ 323, 0, 131, 155, 108, 0, 135, 91, 109, 323,
+ 178, 186, 194, 202, 206, 214, 222, 228, 236, 240,
+ 247, 255, 259, 267
} ;
-static yyconst flex_int16_t yy_def[191] =
+static yyconst flex_int16_t yy_def[165] =
{ 0,
- 173, 1, 174, 174, 173, 5, 175, 175, 176, 176,
- 175, 175, 175, 175, 173, 173, 173, 173, 173, 173,
- 173, 173, 173, 173, 173, 173, 173, 173, 177, 177,
- 173, 173, 173, 178, 178, 173, 179, 173, 173, 180,
- 181, 173, 182, 183, 173, 173, 173, 173, 173, 173,
- 173, 173, 173, 173, 173, 173, 173, 173, 173, 173,
- 173, 173, 173, 177, 173, 184, 177, 30, 177, 69,
- 69, 30, 69, 173, 173, 173, 173, 173, 178, 178,
- 173, 179, 173, 173, 173, 180, 173, 173, 180, 173,
- 181, 173, 185, 186, 173, 183, 173, 173, 173, 173,
-
- 173, 173, 173, 187, 173, 173, 173, 173, 184, 71,
- 71, 178, 173, 173, 185, 186, 173, 173, 173, 173,
- 173, 173, 173, 173, 173, 173, 173, 173, 173, 69,
- 178, 173, 188, 173, 173, 173, 173, 173, 173, 173,
- 173, 173, 173, 178, 173, 173, 173, 189, 173, 173,
- 173, 173, 173, 173, 173, 178, 173, 189, 173, 173,
- 190, 173, 178, 173, 173, 190, 190, 173, 173, 173,
- 173, 190, 0, 173, 173, 173, 173, 173, 173, 173,
- 173, 173, 173, 173, 173, 173, 173, 173, 173, 173
+ 150, 1, 151, 151, 152, 152, 153, 153, 154, 154,
+ 150, 11, 151, 151, 150, 150, 150, 150, 150, 150,
+ 150, 150, 150, 150, 150, 150, 150, 150, 150, 155,
+ 155, 150, 150, 150, 156, 150, 157, 150, 150, 150,
+ 150, 158, 150, 150, 150, 150, 150, 159, 150, 150,
+ 160, 150, 150, 150, 150, 150, 150, 150, 155, 155,
+ 150, 150, 34, 34, 150, 150, 150, 150, 150, 150,
+ 150, 156, 150, 157, 150, 157, 150, 150, 150, 150,
+ 150, 150, 158, 159, 160, 155, 150, 150, 150, 150,
+ 150, 161, 150, 150, 150, 150, 150, 155, 150, 150,
+
+ 150, 150, 150, 150, 150, 150, 150, 150, 150, 150,
+ 150, 155, 150, 162, 150, 150, 150, 150, 150, 150,
+ 150, 150, 150, 150, 155, 150, 150, 150, 163, 150,
+ 150, 150, 150, 150, 150, 150, 155, 150, 163, 150,
+ 150, 164, 150, 150, 150, 164, 150, 150, 150, 0,
+ 150, 150, 150, 150, 150, 150, 150, 150, 150, 150,
+ 150, 150, 150, 150
} ;
-static yyconst flex_int16_t yy_nxt[482] =
+static yyconst flex_int16_t yy_nxt[363] =
{ 0,
- 16, 17, 18, 19, 20, 21, 22, 23, 24, 23,
- 23, 25, 26, 27, 28, 29, 30, 30, 31, 32,
- 33, 34, 34, 34, 34, 34, 34, 34, 35, 34,
- 34, 34, 34, 34, 34, 34, 34, 34, 34, 34,
- 34, 34, 34, 34, 36, 38, 38, 39, 39, 18,
- 18, 20, 20, 40, 40, 41, 42, 18, 19, 20,
- 41, 41, 41, 41, 41, 41, 41, 41, 41, 43,
- 41, 41, 41, 41, 41, 41, 44, 44, 44, 44,
- 44, 44, 44, 44, 44, 44, 44, 44, 44, 44,
- 44, 44, 44, 44, 44, 44, 44, 44, 44, 41,
-
- 46, 47, 19, 48, 18, 18, 20, 20, 18, 18,
- 20, 20, 171, 49, 64, 64, 64, 65, 74, 75,
- 172, 66, 77, 78, 83, 65, 84, 50, 51, 94,
- 65, 52, 53, 83, 66, 84, 54, 173, 173, 171,
- 55, 56, 46, 47, 19, 48, 87, 100, 88, 101,
- 173, 173, 102, 170, 89, 49, 164, 103, 90, 169,
- 69, 69, 69, 69, 109, 118, 109, 69, 69, 50,
- 51, 130, 119, 52, 53, 69, 69, 165, 54, 68,
- 68, 67, 55, 56, 68, 68, 164, 130, 87, 70,
- 88, 69, 163, 69, 70, 71, 173, 124, 69, 87,
-
- 173, 88, 67, 67, 125, 70, 69, 89, 67, 67,
- 70, 90, 71, 72, 72, 72, 130, 173, 173, 69,
- 69, 69, 69, 73, 162, 161, 69, 69, 109, 173,
- 109, 173, 130, 152, 69, 69, 173, 160, 173, 73,
- 173, 173, 159, 157, 110, 110, 110, 156, 155, 154,
- 110, 111, 167, 168, 153, 168, 110, 110, 111, 110,
- 167, 168, 152, 168, 37, 37, 37, 37, 37, 37,
- 37, 37, 19, 19, 19, 19, 19, 19, 19, 19,
- 45, 45, 45, 45, 45, 45, 45, 45, 67, 67,
- 67, 79, 79, 82, 82, 82, 82, 151, 82, 82,
-
- 82, 86, 86, 86, 86, 86, 86, 86, 86, 91,
- 150, 149, 91, 91, 91, 91, 91, 93, 93, 93,
- 93, 93, 93, 93, 93, 96, 148, 147, 96, 96,
- 109, 109, 145, 109, 109, 109, 109, 109, 115, 144,
- 143, 115, 115, 115, 115, 115, 116, 116, 142, 116,
- 116, 116, 116, 116, 123, 123, 123, 123, 123, 123,
- 141, 123, 146, 146, 146, 146, 146, 146, 158, 158,
- 140, 158, 158, 158, 158, 158, 166, 166, 166, 166,
- 166, 166, 166, 166, 139, 138, 137, 136, 135, 134,
- 133, 132, 131, 129, 128, 127, 126, 122, 121, 120,
-
- 117, 97, 95, 92, 114, 114, 113, 113, 112, 57,
- 108, 107, 106, 105, 104, 99, 98, 98, 97, 95,
- 92, 85, 85, 81, 80, 76, 63, 62, 61, 60,
- 59, 58, 58, 57, 173, 15, 173, 173, 173, 173,
- 173, 173, 173, 173, 173, 173, 173, 173, 173, 173,
- 173, 173, 173, 173, 173, 173, 173, 173, 173, 173,
- 173, 173, 173, 173, 173, 173, 173, 173, 173, 173,
- 173, 173, 173, 173, 173, 173, 173, 173, 173, 173,
- 173
+ 16, 17, 18, 19, 20, 21, 22, 23, 22, 22,
+ 24, 25, 26, 26, 27, 28, 29, 30, 30, 30,
+ 30, 30, 31, 30, 30, 30, 30, 30, 30, 30,
+ 30, 30, 30, 30, 30, 30, 30, 30, 32, 33,
+ 36, 36, 88, 34, 89, 40, 18, 37, 37, 41,
+ 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
+ 19, 19, 19, 19, 19, 19, 19, 42, 42, 42,
+ 42, 42, 42, 42, 42, 42, 42, 42, 42, 42,
+ 42, 42, 42, 42, 42, 42, 42, 42, 19, 47,
+ 48, 49, 49, 97, 52, 52, 52, 54, 55, 50,
+
+ 51, 62, 53, 57, 58, 63, 75, 78, 80, 97,
+ 149, 79, 62, 76, 77, 50, 63, 51, 53, 64,
+ 142, 80, 100, 45, 49, 49, 52, 52, 52, 101,
+ 81, 78, 50, 67, 53, 79, 149, 88, 148, 89,
+ 65, 66, 90, 81, 67, 68, 67, 91, 50, 69,
+ 53, 75, 80, 70, 71, 75, 144, 106, 150, 150,
+ 147, 145, 76, 77, 107, 144, 143, 142, 133, 141,
+ 140, 138, 137, 136, 81, 135, 134, 67, 19, 19,
+ 19, 19, 19, 19, 19, 19, 35, 35, 35, 35,
+ 35, 35, 35, 35, 38, 38, 38, 38, 38, 38,
+
+ 38, 38, 39, 39, 39, 39, 39, 39, 39, 39,
+ 59, 59, 59, 59, 72, 72, 72, 133, 72, 72,
+ 72, 72, 74, 74, 74, 74, 74, 74, 74, 74,
+ 83, 132, 83, 83, 83, 83, 84, 131, 84, 84,
+ 84, 84, 84, 84, 85, 130, 85, 105, 105, 105,
+ 105, 129, 128, 105, 105, 127, 127, 127, 127, 139,
+ 126, 139, 139, 139, 139, 139, 139, 146, 125, 146,
+ 146, 146, 146, 146, 146, 124, 123, 122, 121, 120,
+ 119, 118, 117, 116, 115, 114, 113, 112, 111, 110,
+ 109, 108, 104, 103, 102, 99, 98, 82, 73, 96,
+
+ 95, 94, 93, 92, 87, 150, 150, 86, 43, 82,
+ 73, 61, 60, 56, 46, 45, 44, 43, 150, 18,
+ 19, 19, 15, 150, 150, 150, 150, 150, 150, 150,
+ 150, 150, 150, 150, 150, 150, 150, 150, 150, 150,
+ 150, 150, 150, 150, 150, 150, 150, 150, 150, 150,
+ 150, 150, 150, 150, 150, 150, 150, 150, 150, 150,
+ 150, 150
} ;
-static yyconst flex_int16_t yy_chk[482] =
+static yyconst flex_int16_t yy_chk[363] =
{ 0,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 3, 4, 3, 4, 7,
- 8, 7, 8, 3, 4, 5, 5, 5, 5, 5,
- 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
- 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
- 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
- 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
-
- 9, 9, 9, 9, 11, 12, 11, 12, 13, 14,
- 13, 14, 171, 9, 27, 27, 27, 28, 31, 31,
- 170, 28, 33, 33, 37, 43, 37, 9, 9, 43,
- 49, 9, 9, 82, 49, 82, 9, 70, 70, 169,
- 9, 9, 10, 10, 10, 10, 40, 51, 40, 51,
- 73, 73, 51, 165, 40, 10, 164, 51, 40, 162,
- 64, 67, 64, 67, 94, 100, 94, 64, 67, 10,
- 10, 110, 100, 10, 10, 64, 67, 159, 10, 68,
- 68, 68, 10, 10, 29, 29, 157, 110, 86, 68,
- 86, 29, 156, 29, 29, 29, 86, 104, 29, 89,
-
- 86, 89, 111, 111, 104, 68, 29, 89, 69, 69,
- 29, 89, 29, 30, 30, 30, 111, 130, 130, 69,
- 30, 69, 30, 30, 155, 153, 69, 30, 116, 166,
- 116, 166, 111, 152, 69, 30, 172, 151, 172, 30,
- 71, 71, 149, 145, 71, 71, 71, 144, 143, 142,
- 71, 71, 161, 161, 141, 161, 71, 71, 71, 71,
- 167, 167, 140, 167, 174, 174, 174, 174, 174, 174,
- 174, 174, 175, 175, 175, 175, 175, 175, 175, 175,
- 176, 176, 176, 176, 176, 176, 176, 176, 177, 177,
- 177, 178, 178, 179, 179, 179, 179, 139, 179, 179,
-
- 179, 180, 180, 180, 180, 180, 180, 180, 180, 181,
- 138, 137, 181, 181, 181, 181, 181, 182, 182, 182,
- 182, 182, 182, 182, 182, 183, 136, 135, 183, 183,
- 184, 184, 132, 184, 184, 184, 184, 184, 185, 131,
- 129, 185, 185, 185, 185, 185, 186, 186, 128, 186,
- 186, 186, 186, 186, 187, 187, 187, 187, 187, 187,
- 127, 187, 188, 188, 188, 188, 188, 188, 189, 189,
- 126, 189, 189, 189, 189, 189, 190, 190, 190, 190,
- 190, 190, 190, 190, 125, 124, 122, 121, 120, 119,
- 118, 117, 112, 108, 107, 106, 105, 103, 102, 101,
-
- 99, 97, 96, 92, 88, 87, 84, 83, 80, 57,
- 56, 55, 54, 53, 52, 50, 48, 47, 46, 44,
- 42, 39, 38, 36, 35, 32, 26, 25, 24, 22,
- 21, 20, 18, 16, 15, 173, 173, 173, 173, 173,
- 173, 173, 173, 173, 173, 173, 173, 173, 173, 173,
- 173, 173, 173, 173, 173, 173, 173, 173, 173, 173,
- 173, 173, 173, 173, 173, 173, 173, 173, 173, 173,
- 173, 173, 173, 173, 173, 173, 173, 173, 173, 173,
- 173
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 2,
+ 5, 6, 81, 2, 81, 10, 10, 5, 6, 10,
+ 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,
+ 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,
+ 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,
+ 11, 11, 11, 11, 11, 11, 11, 11, 11, 24,
+ 24, 25, 25, 85, 26, 26, 26, 27, 27, 25,
+
+ 25, 33, 26, 29, 29, 33, 37, 40, 41, 85,
+ 149, 40, 62, 37, 37, 25, 62, 25, 26, 34,
+ 148, 79, 88, 34, 49, 49, 52, 52, 52, 88,
+ 41, 78, 49, 41, 52, 78, 147, 66, 145, 66,
+ 34, 34, 66, 79, 34, 34, 79, 66, 49, 34,
+ 52, 74, 80, 34, 34, 76, 144, 92, 74, 74,
+ 143, 140, 76, 76, 92, 138, 136, 134, 133, 132,
+ 130, 126, 125, 124, 80, 123, 122, 80, 151, 151,
+ 151, 151, 151, 151, 151, 151, 152, 152, 152, 152,
+ 152, 152, 152, 152, 153, 153, 153, 153, 153, 153,
+
+ 153, 153, 154, 154, 154, 154, 154, 154, 154, 154,
+ 155, 155, 155, 155, 156, 156, 156, 121, 156, 156,
+ 156, 156, 157, 157, 157, 157, 157, 157, 157, 157,
+ 158, 120, 158, 158, 158, 158, 159, 119, 159, 159,
+ 159, 159, 159, 159, 160, 118, 160, 161, 161, 161,
+ 161, 117, 116, 161, 161, 162, 162, 162, 162, 163,
+ 113, 163, 163, 163, 163, 163, 163, 164, 112, 164,
+ 164, 164, 164, 164, 164, 111, 110, 109, 108, 107,
+ 106, 104, 103, 102, 101, 100, 99, 98, 96, 95,
+ 94, 93, 91, 90, 89, 87, 86, 83, 72, 71,
+
+ 70, 69, 68, 67, 65, 64, 63, 60, 43, 42,
+ 35, 32, 31, 28, 23, 21, 20, 16, 15, 9,
+ 8, 7, 150, 150, 150, 150, 150, 150, 150, 150,
+ 150, 150, 150, 150, 150, 150, 150, 150, 150, 150,
+ 150, 150, 150, 150, 150, 150, 150, 150, 150, 150,
+ 150, 150, 150, 150, 150, 150, 150, 150, 150, 150,
+ 150, 150
} ;
/* The intent behind this definition is that it'll catch
@@ -648,126 +614,30 @@ void glcpp_set_column (int column_no , yyscan_t yyscanner);
yylloc->last_column = yycolumn + 1; \
parser->has_new_line_number = 0; \
parser->has_new_source_number = 0; \
- } while(0);
+ } while(0);
#define YY_USER_INIT \
do { \
yylineno = 1; \
- yycolumn = 0; \
+ yycolumn = 1; \
yylloc->source = 0; \
} while(0)
-/* It's ugly to have macros that have return statements inside of
- * them, but flex-based lexer generation is all built around the
- * return statement.
- *
- * To mitigate the ugliness, we defer as much of the logic as possible
- * to an actual function, not a macro (see
- * glcpplex_update_state_per_token) and we make the word RETURN
- * prominent in all of the macros which may return.
- *
- * The most-commonly-used macro is RETURN_TOKEN which will perform all
- * necessary state updates based on the provided token,, then
- * conditionally return the token. It will not return a token if the
- * parser is currently skipping tokens, (such as within #if
- * 0...#else).
- *
- * The RETURN_TOKEN_NEVER_SKIP macro is a lower-level variant that
- * makes the token returning unconditional. This is needed for things
- * like #if and the tokens of its condition, (since these must be
- * evaluated by the parser even when otherwise skipping).
- *
- * Finally, RETURN_STRING_TOKEN is a simple convenience wrapper on top
- * of RETURN_TOKEN that performs a string copy of yytext before the
- * return.
- */
-#define RETURN_TOKEN_NEVER_SKIP(token) \
- do { \
- if (glcpp_lex_update_state_per_token (parser, token)) \
- return token; \
- } while (0)
-
-#define RETURN_TOKEN(token) \
- do { \
- if (! parser->skipping) { \
- RETURN_TOKEN_NEVER_SKIP(token); \
- } \
- } while(0)
-
-#define RETURN_STRING_TOKEN(token) \
- do { \
- if (! parser->skipping) { \
- yylval->str = ralloc_strdup (yyextra, yytext); \
- RETURN_TOKEN_NEVER_SKIP (token); \
- } \
- } while(0)
-
-
-/* Update all state necessary for each token being returned.
- *
- * Here we'll be tracking newlines and spaces so that the lexer can
- * alter its behavior as necessary, (for example, '#' has special
- * significance if it is the first non-whitespace, non-comment token
- * in a line, but does not otherwise).
- *
- * NOTE: If this function returns FALSE, then no token should be
- * returned at all. This is used to suprress duplicate SPACE tokens.
- */
-static int
-glcpp_lex_update_state_per_token (glcpp_parser_t *parser, int token)
-{
- /* After the first non-space token in a line, we won't
- * allow any '#' to introduce a directive. */
- if (token == NEWLINE) {
- parser->first_non_space_token_this_line = 1;
- } else if (token != SPACE) {
- parser->first_non_space_token_this_line = 0;
- }
-
- /* Track newlines just to know whether a newline needs
- * to be inserted if end-of-file comes early. */
- if (token == NEWLINE) {
- parser->last_token_was_newline = 1;
- } else {
- parser->last_token_was_newline = 0;
- }
-
- /* Track spaces to avoid emitting multiple SPACE
- * tokens in a row. */
- if (token == SPACE) {
- if (! parser->last_token_was_space) {
- parser->last_token_was_space = 1;
- return 1;
- } else {
- parser->last_token_was_space = 1;
- return 0;
- }
- } else {
- parser->last_token_was_space = 0;
- return 1;
- }
-}
-
-
-/* Note: When adding any start conditions to this list, you must also
-* update the "Internal compiler error" catch-all rule near the end of
-* this file. */
-
/* The OTHER class is simply a catch-all for things that the CPP
parser just doesn't care about. Since flex regular expressions that
match longer strings take priority over those matching shorter
strings, we have to be careful to avoid OTHER matching and hiding
something that CPP does care about. So we simply exclude all
characters that appear in any other expressions. */
-#line 763 "glcpp/glcpp-lex.c"
+#line 633 "glcpp/glcpp-lex.c"
#define INITIAL 0
-#define COMMENT 1
-#define DEFINE 2
-#define DONE 3
-#define HASH 4
-#define NEWLINE_CATCHUP 5
-#define UNREACHABLE 6
+#define DONE 1
+#define COMMENT 2
+#define UNREACHABLE 3
+#define SKIP 4
+#define DEFINE 5
+#define NEWLINE_CATCHUP 6
#ifndef YY_NO_UNISTD_H
/* Special case for "unistd.h", since it is non-ANSI. We include it way
@@ -1003,6 +873,9 @@ extern int glcpp_lex \
#endif
#define YY_RULE_SETUP \
+ if ( yyleng > 0 ) \
+ YY_CURRENT_BUFFER_LVALUE->yy_at_bol = \
+ (yytext[yyleng - 1] == '\n'); \
YY_USER_ACTION
/** The main scanner function which does all the work.
@@ -1045,7 +918,7 @@ YY_DECL
}
{
-#line 194 "glcpp/glcpp-lex.l"
+#line 95 "glcpp/glcpp-lex.l"
glcpp_parser_t *parser = yyextra;
@@ -1064,49 +937,52 @@ YY_DECL
parser->commented_newlines--;
if (parser->commented_newlines == 0)
BEGIN INITIAL;
- RETURN_TOKEN_NEVER_SKIP (NEWLINE);
+ return NEWLINE;
}
- /* Set up the parser->skipping bit here before doing any lexing.
- *
- * This bit controls whether tokens are skipped, (as implemented by
- * RETURN_TOKEN), such as between "#if 0" and "#endif".
+ /* The handling of the SKIP vs INITIAL start states requires
+ * some special handling. Typically, a lexer would change
+ * start states with statements like "BEGIN SKIP" within the
+ * lexer rules. We can't get away with that here, since we
+ * need the parser to actually evaluate expressions for
+ * directives like "#if".
*
- * The parser maintains a skip_stack indicating whether we should be
- * skipping, (and nested levels of #if/#ifdef/#ifndef/#endif) will
- * push and pop items from the stack.
+ * So, here, in code that will be executed on every call to
+ * the lexer,and before any rules, we examine the skip_stack
+ * as set by the parser to know whether to change from INITIAL
+ * to SKIP or from SKIP back to INITIAL.
*
- * Here are the rules for determining whether we are skipping:
+ * Three cases cause us to switch out of the SKIP state and
+ * back to the INITIAL state:
*
- * 1. If the skip stack is NULL, we are outside of all #if blocks
- * and we are not skipping.
+ * 1. The top of the skip_stack is of type SKIP_NO_SKIP
+ * This means we're still evaluating some #if
+ * hierarchy, but we're on a branch of it where
+ * content should not be skipped (such as "#if 1" or
+ * "#else" or so).
*
- * 2. If the skip stack is non-NULL, the type of the top node in
- * the stack determines whether to skip. A type of
- * SKIP_NO_SKIP is used for blocks wheere we are emitting
- * tokens, (such as between #if 1 and #endif, or after the
- * #else of an #if 0, etc.).
+ * 2. The skip_stack is NULL meaning that we've reached
+ * the last #endif.
*
- * 3. The lexing_directive bit overrides the skip stack. This bit
- * is set when we are actively lexing the expression for a
- * pre-processor condition, (such as #if, #elif, or #else). In
- * this case, even if otherwise skipping, we need to emit the
- * tokens for this condition so that the parser can evaluate
- * the expression. (For, #else, there's no expression, but we
- * emit tokens so the parser can generate a nice error message
- * if there are any tokens here).
+ * 3. The lexing_if bit is set. This indicates that we
+ * are lexing the expression following an "#if" of
+ * "#elif". Even inside an "#if 0" we need to lex this
+ * expression so the parser can correctly update the
+ * skip_stack state.
*/
- if (parser->skip_stack &&
- parser->skip_stack->type != SKIP_NO_SKIP &&
- ! parser->lexing_directive)
- {
- parser->skipping = 1;
- } else {
- parser->skipping = 0;
+ if (YY_START == INITIAL || YY_START == SKIP) {
+ if (parser->lexing_if ||
+ parser->skip_stack == NULL ||
+ parser->skip_stack->type == SKIP_NO_SKIP)
+ {
+ BEGIN INITIAL;
+ } else {
+ BEGIN SKIP;
+ }
}
/* Single-line comments */
-#line 1110 "glcpp/glcpp-lex.c"
+#line 986 "glcpp/glcpp-lex.c"
while ( 1 ) /* loops until end-of-file is reached */
{
@@ -1121,6 +997,7 @@ YY_DECL
yy_bp = yy_cp;
yy_current_state = yyg->yy_start;
+ yy_current_state += YY_AT_BOL();
yy_match:
do
{
@@ -1133,13 +1010,13 @@ yy_match:
while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
{
yy_current_state = (int) yy_def[yy_current_state];
- if ( yy_current_state >= 174 )
+ if ( yy_current_state >= 151 )
yy_c = yy_meta[(unsigned int) yy_c];
}
yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
++yy_cp;
}
- while ( yy_current_state != 173 );
+ while ( yy_current_state != 150 );
yy_cp = yyg->yy_last_accepting_cpos;
yy_current_state = yyg->yy_last_accepting_state;
@@ -1161,515 +1038,380 @@ do_action: /* This label is used only to access EOF actions. */
case 1:
YY_RULE_SETUP
-#line 254 "glcpp/glcpp-lex.l"
+#line 158 "glcpp/glcpp-lex.l"
{
}
YY_BREAK
/* Multi-line comments */
case 2:
YY_RULE_SETUP
-#line 258 "glcpp/glcpp-lex.l"
+#line 162 "glcpp/glcpp-lex.l"
{ yy_push_state(COMMENT, yyscanner); }
YY_BREAK
case 3:
YY_RULE_SETUP
-#line 259 "glcpp/glcpp-lex.l"
+#line 163 "glcpp/glcpp-lex.l"
YY_BREAK
case 4:
/* rule 4 can match eol */
YY_RULE_SETUP
-#line 260 "glcpp/glcpp-lex.l"
+#line 164 "glcpp/glcpp-lex.l"
{ yylineno++; yycolumn = 0; parser->commented_newlines++; }
YY_BREAK
case 5:
YY_RULE_SETUP
-#line 261 "glcpp/glcpp-lex.l"
+#line 165 "glcpp/glcpp-lex.l"
YY_BREAK
case 6:
/* rule 6 can match eol */
YY_RULE_SETUP
-#line 262 "glcpp/glcpp-lex.l"
+#line 166 "glcpp/glcpp-lex.l"
{ yylineno++; yycolumn = 0; parser->commented_newlines++; }
YY_BREAK
case 7:
YY_RULE_SETUP
-#line 263 "glcpp/glcpp-lex.l"
+#line 167 "glcpp/glcpp-lex.l"
{
yy_pop_state(yyscanner);
- /* In the <HASH> start condition, we don't want any SPACE token. */
- if (yyextra->space_tokens && YY_START != HASH)
- RETURN_TOKEN (SPACE);
+ if (yyextra->space_tokens)
+ return SPACE;
}
YY_BREAK
case 8:
YY_RULE_SETUP
-#line 270 "glcpp/glcpp-lex.l"
+#line 173 "glcpp/glcpp-lex.l"
{
-
- /* If the '#' is the first non-whitespace, non-comment token on this
- * line, then it introduces a directive, switch to the <HASH> start
- * condition.
- *
- * Otherwise, this is just punctuation, so return the HASH_TOKEN
- * token. */
- if (parser->first_non_space_token_this_line) {
- BEGIN HASH;
- }
-
- RETURN_TOKEN_NEVER_SKIP (HASH_TOKEN);
+ yylval->str = ralloc_strdup (yyextra, yytext);
+ yyextra->space_tokens = 0;
+ return HASH_VERSION;
}
YY_BREAK
+/* glcpp doesn't handle #extension, #version, or #pragma directives.
+ * Simply pass them through to the main compiler's lexer/parser. */
case 9:
YY_RULE_SETUP
-#line 285 "glcpp/glcpp-lex.l"
+#line 181 "glcpp/glcpp-lex.l"
{
- BEGIN INITIAL;
- yyextra->space_tokens = 0;
- RETURN_STRING_TOKEN (VERSION_TOKEN);
+ if (parser->commented_newlines)
+ BEGIN NEWLINE_CATCHUP;
+ yylval->str = ralloc_strdup (yyextra, yytext);
+ yylineno++;
+ yycolumn = 0;
+ return OTHER;
}
YY_BREAK
-/* Swallow empty #pragma directives, (to avoid confusing the
- * downstream compiler).
- *
- * Note: We use a simple regular expression for the lookahead
- * here. Specifically, we cannot use the complete {NEWLINE} expression
- * since it uses alternation and we've found that there's a flex bug
- * where using alternation in the lookahead portion of a pattern
- * triggers a buffer overrun. */
case 10:
-/* rule 10 can match eol */
-*yy_cp = yyg->yy_hold_char; /* undo effects of setting up yytext */
-YY_LINENO_REWIND_TO(yy_cp - 1);
-yyg->yy_c_buf_p = yy_cp -= 1;
-YY_DO_BEFORE_ACTION; /* set up yytext again */
YY_RULE_SETUP
-#line 299 "glcpp/glcpp-lex.l"
+#line 190 "glcpp/glcpp-lex.l"
{
- BEGIN INITIAL;
+ return HASH_LINE;
}
YY_BREAK
-/* glcpp doesn't handle #extension, #version, or #pragma directives.
- * Simply pass them through to the main compiler's lexer/parser. */
+
case 11:
YY_RULE_SETUP
-#line 305 "glcpp/glcpp-lex.l"
+#line 195 "glcpp/glcpp-lex.l"
{
- BEGIN INITIAL;
- RETURN_STRING_TOKEN (PRAGMA);
+ yyextra->lexing_if = 1;
+ yyextra->space_tokens = 0;
+ return HASH_IFDEF;
}
YY_BREAK
case 12:
YY_RULE_SETUP
-#line 310 "glcpp/glcpp-lex.l"
+#line 201 "glcpp/glcpp-lex.l"
{
- BEGIN INITIAL;
- RETURN_TOKEN (LINE);
+ yyextra->lexing_if = 1;
+ yyextra->space_tokens = 0;
+ return HASH_IFNDEF;
}
YY_BREAK
case 13:
/* rule 13 can match eol */
+*yy_cp = yyg->yy_hold_char; /* undo effects of setting up yytext */
+YY_LINENO_REWIND_TO(yy_cp - 1);
+yyg->yy_c_buf_p = yy_cp -= 1;
+YY_DO_BEFORE_ACTION; /* set up yytext again */
YY_RULE_SETUP
-#line 315 "glcpp/glcpp-lex.l"
+#line 207 "glcpp/glcpp-lex.l"
{
- BEGIN INITIAL;
- RETURN_TOKEN_NEVER_SKIP (NEWLINE);
+ yyextra->lexing_if = 1;
+ yyextra->space_tokens = 0;
+ return HASH_IF;
}
YY_BREAK
-/* For the pre-processor directives, we return these tokens
- * even when we are otherwise skipping. */
case 14:
+/* rule 14 can match eol */
+*yy_cp = yyg->yy_hold_char; /* undo effects of setting up yytext */
+YY_LINENO_REWIND_TO(yy_cp - 1);
+yyg->yy_c_buf_p = yy_cp -= 1;
+YY_DO_BEFORE_ACTION; /* set up yytext again */
YY_RULE_SETUP
-#line 322 "glcpp/glcpp-lex.l"
+#line 213 "glcpp/glcpp-lex.l"
{
- BEGIN INITIAL;
- yyextra->lexing_directive = 1;
+ yyextra->lexing_if = 1;
yyextra->space_tokens = 0;
- RETURN_TOKEN_NEVER_SKIP (IFDEF);
+ return HASH_ELIF;
}
YY_BREAK
case 15:
YY_RULE_SETUP
-#line 329 "glcpp/glcpp-lex.l"
+#line 219 "glcpp/glcpp-lex.l"
{
- BEGIN INITIAL;
- yyextra->lexing_directive = 1;
yyextra->space_tokens = 0;
- RETURN_TOKEN_NEVER_SKIP (IFNDEF);
+ return HASH_ELSE;
}
YY_BREAK
case 16:
-/* rule 16 can match eol */
-*yy_cp = yyg->yy_hold_char; /* undo effects of setting up yytext */
-YY_LINENO_REWIND_TO(yy_bp + 2);
-yyg->yy_c_buf_p = yy_cp = yy_bp + 2;
-YY_DO_BEFORE_ACTION; /* set up yytext again */
YY_RULE_SETUP
-#line 336 "glcpp/glcpp-lex.l"
+#line 224 "glcpp/glcpp-lex.l"
{
- BEGIN INITIAL;
- yyextra->lexing_directive = 1;
yyextra->space_tokens = 0;
- RETURN_TOKEN_NEVER_SKIP (IF);
+ return HASH_ENDIF;
}
YY_BREAK
+
case 17:
-/* rule 17 can match eol */
-*yy_cp = yyg->yy_hold_char; /* undo effects of setting up yytext */
-YY_LINENO_REWIND_TO(yy_bp + 4);
-yyg->yy_c_buf_p = yy_cp = yy_bp + 4;
-YY_DO_BEFORE_ACTION; /* set up yytext again */
YY_RULE_SETUP
-#line 343 "glcpp/glcpp-lex.l"
+#line 230 "glcpp/glcpp-lex.l"
{
- BEGIN INITIAL;
- yyextra->lexing_directive = 1;
- yyextra->space_tokens = 0;
- RETURN_TOKEN_NEVER_SKIP (ELIF);
+ if (parser->commented_newlines)
+ BEGIN NEWLINE_CATCHUP;
}
YY_BREAK
case 18:
YY_RULE_SETUP
-#line 350 "glcpp/glcpp-lex.l"
+#line 235 "glcpp/glcpp-lex.l"
{
- BEGIN INITIAL;
- yyextra->space_tokens = 0;
- RETURN_TOKEN_NEVER_SKIP (ELSE);
+ char *p;
+ for (p = yytext; !isalpha(p[0]); p++); /* skip " # " */
+ p += 5; /* skip "error" */
+ glcpp_error(yylloc, yyextra, "#error%s", p);
}
YY_BREAK
case 19:
YY_RULE_SETUP
-#line 356 "glcpp/glcpp-lex.l"
+#line 242 "glcpp/glcpp-lex.l"
{
- BEGIN INITIAL;
yyextra->space_tokens = 0;
- RETURN_TOKEN_NEVER_SKIP (ENDIF);
+ yy_push_state(DEFINE, yyscanner);
+ return HASH_DEFINE;
}
YY_BREAK
case 20:
+*yy_cp = yyg->yy_hold_char; /* undo effects of setting up yytext */
+yyg->yy_c_buf_p = yy_cp -= 1;
+YY_DO_BEFORE_ACTION; /* set up yytext again */
YY_RULE_SETUP
-#line 362 "glcpp/glcpp-lex.l"
+#line 248 "glcpp/glcpp-lex.l"
{
- BEGIN INITIAL;
- RETURN_STRING_TOKEN (ERROR_TOKEN);
+ yy_pop_state(yyscanner);
+ yylval->str = ralloc_strdup (yyextra, yytext);
+ return FUNC_IDENTIFIER;
}
YY_BREAK
-/* After we see a "#define" we enter the <DEFINE> start state
- * for the lexer. Within <DEFINE> we are looking for the first
- * identifier and specifically checking whether the identifier
- * is followed by a '(' or not, (to lex either a
- * FUNC_IDENTIFIER or an OBJ_IDENITIFIER token).
- *
- * While in the <DEFINE> state we also need to explicitly
- * handle a few other things that may appear before the
- * identifier:
- *
- * * Comments, (handled above with the main support for
- * comments).
- *
- * * Whitespace (simply ignored)
- *
- * * Anything else, (not an identifier, not a comment,
- * and not whitespace). This will generate an error.
- */
case 21:
YY_RULE_SETUP
-#line 385 "glcpp/glcpp-lex.l"
+#line 254 "glcpp/glcpp-lex.l"
{
- if (! parser->skipping) {
- BEGIN DEFINE;
- yyextra->space_tokens = 0;
- RETURN_TOKEN (DEFINE_TOKEN);
- }
+ yy_pop_state(yyscanner);
+ yylval->str = ralloc_strdup (yyextra, yytext);
+ return OBJ_IDENTIFIER;
}
YY_BREAK
case 22:
YY_RULE_SETUP
-#line 393 "glcpp/glcpp-lex.l"
+#line 260 "glcpp/glcpp-lex.l"
{
- BEGIN INITIAL;
yyextra->space_tokens = 0;
- RETURN_TOKEN (UNDEF);
+ return HASH_UNDEF;
}
YY_BREAK
case 23:
YY_RULE_SETUP
-#line 399 "glcpp/glcpp-lex.l"
+#line 265 "glcpp/glcpp-lex.l"
{
- /* Nothing to do here. Importantly, don't leave the <HASH>
- * start condition, since it's legal to have space between the
- * '#' and the directive.. */
+ yyextra->space_tokens = 0;
+ return HASH;
}
YY_BREAK
-/* This will catch any non-directive garbage after a HASH */
case 24:
YY_RULE_SETUP
-#line 406 "glcpp/glcpp-lex.l"
+#line 270 "glcpp/glcpp-lex.l"
{
- BEGIN INITIAL;
- RETURN_TOKEN (GARBAGE);
+ yylval->str = ralloc_strdup (yyextra, yytext);
+ return INTEGER_STRING;
}
YY_BREAK
-/* An identifier immediately followed by '(' */
case 25:
-*yy_cp = yyg->yy_hold_char; /* undo effects of setting up yytext */
-yyg->yy_c_buf_p = yy_cp -= 1;
-YY_DO_BEFORE_ACTION; /* set up yytext again */
YY_RULE_SETUP
-#line 412 "glcpp/glcpp-lex.l"
+#line 275 "glcpp/glcpp-lex.l"
{
- BEGIN INITIAL;
- RETURN_STRING_TOKEN (FUNC_IDENTIFIER);
+ yylval->str = ralloc_strdup (yyextra, yytext);
+ return INTEGER_STRING;
}
YY_BREAK
-/* An identifier not immediately followed by '(' */
case 26:
YY_RULE_SETUP
-#line 418 "glcpp/glcpp-lex.l"
+#line 280 "glcpp/glcpp-lex.l"
{
- BEGIN INITIAL;
- RETURN_STRING_TOKEN (OBJ_IDENTIFIER);
+ yylval->str = ralloc_strdup (yyextra, yytext);
+ return INTEGER_STRING;
}
YY_BREAK
-/* Whitespace */
case 27:
YY_RULE_SETUP
-#line 424 "glcpp/glcpp-lex.l"
+#line 285 "glcpp/glcpp-lex.l"
{
- /* Just ignore it. Nothing to do here. */
+ return LEFT_SHIFT;
}
YY_BREAK
-/* '/' not followed by '*', so not a comment. This is an error. */
case 28:
-/* rule 28 can match eol */
YY_RULE_SETUP
-#line 429 "glcpp/glcpp-lex.l"
+#line 289 "glcpp/glcpp-lex.l"
{
- BEGIN INITIAL;
- glcpp_error(yylloc, yyextra, "#define followed by a non-identifier: %s", yytext);
- RETURN_STRING_TOKEN (INTEGER_STRING);
+ return RIGHT_SHIFT;
}
YY_BREAK
-/* A character that can't start an identifier, comment, or
- * space. This is an error. */
case 29:
YY_RULE_SETUP
-#line 437 "glcpp/glcpp-lex.l"
+#line 293 "glcpp/glcpp-lex.l"
{
- BEGIN INITIAL;
- glcpp_error(yylloc, yyextra, "#define followed by a non-identifier: %s", yytext);
- RETURN_STRING_TOKEN (INTEGER_STRING);
+ return LESS_OR_EQUAL;
}
YY_BREAK
case 30:
YY_RULE_SETUP
-#line 443 "glcpp/glcpp-lex.l"
+#line 297 "glcpp/glcpp-lex.l"
{
- RETURN_STRING_TOKEN (INTEGER_STRING);
+ return GREATER_OR_EQUAL;
}
YY_BREAK
case 31:
YY_RULE_SETUP
-#line 447 "glcpp/glcpp-lex.l"
+#line 301 "glcpp/glcpp-lex.l"
{
- RETURN_STRING_TOKEN (INTEGER_STRING);
+ return EQUAL;
}
YY_BREAK
case 32:
YY_RULE_SETUP
-#line 451 "glcpp/glcpp-lex.l"
+#line 305 "glcpp/glcpp-lex.l"
{
- RETURN_STRING_TOKEN (INTEGER_STRING);
+ return NOT_EQUAL;
}
YY_BREAK
case 33:
YY_RULE_SETUP
-#line 455 "glcpp/glcpp-lex.l"
+#line 309 "glcpp/glcpp-lex.l"
{
- RETURN_TOKEN (LEFT_SHIFT);
+ return AND;
}
YY_BREAK
case 34:
YY_RULE_SETUP
-#line 459 "glcpp/glcpp-lex.l"
+#line 313 "glcpp/glcpp-lex.l"
{
- RETURN_TOKEN (RIGHT_SHIFT);
+ return OR;
}
YY_BREAK
case 35:
YY_RULE_SETUP
-#line 463 "glcpp/glcpp-lex.l"
+#line 317 "glcpp/glcpp-lex.l"
{
- RETURN_TOKEN (LESS_OR_EQUAL);
+ if (parser->is_gles)
+ glcpp_error(yylloc, yyextra, "Token pasting (##) is illegal in GLES");
+ return PASTE;
}
YY_BREAK
case 36:
YY_RULE_SETUP
-#line 467 "glcpp/glcpp-lex.l"
+#line 323 "glcpp/glcpp-lex.l"
{
- RETURN_TOKEN (GREATER_OR_EQUAL);
+ return DEFINED;
}
YY_BREAK
case 37:
YY_RULE_SETUP
-#line 471 "glcpp/glcpp-lex.l"
+#line 327 "glcpp/glcpp-lex.l"
{
- RETURN_TOKEN (EQUAL);
+ yylval->str = ralloc_strdup (yyextra, yytext);
+ return IDENTIFIER;
}
YY_BREAK
case 38:
YY_RULE_SETUP
-#line 475 "glcpp/glcpp-lex.l"
+#line 332 "glcpp/glcpp-lex.l"
{
- RETURN_TOKEN (NOT_EQUAL);
+ return yytext[0];
}
YY_BREAK
case 39:
YY_RULE_SETUP
-#line 479 "glcpp/glcpp-lex.l"
+#line 336 "glcpp/glcpp-lex.l"
{
- RETURN_TOKEN (AND);
+ yylval->str = ralloc_strdup (yyextra, yytext);
+ return OTHER;
}
YY_BREAK
case 40:
YY_RULE_SETUP
-#line 483 "glcpp/glcpp-lex.l"
-{
- RETURN_TOKEN (OR);
-}
- YY_BREAK
-case 41:
-YY_RULE_SETUP
-#line 487 "glcpp/glcpp-lex.l"
-{
- RETURN_TOKEN (PLUS_PLUS);
-}
- YY_BREAK
-case 42:
-YY_RULE_SETUP
-#line 491 "glcpp/glcpp-lex.l"
-{
- RETURN_TOKEN (MINUS_MINUS);
-}
- YY_BREAK
-case 43:
-YY_RULE_SETUP
-#line 495 "glcpp/glcpp-lex.l"
-{
- if (! parser->skipping) {
- if (parser->is_gles)
- glcpp_error(yylloc, yyextra, "Token pasting (##) is illegal in GLES");
- RETURN_TOKEN (PASTE);
- }
-}
- YY_BREAK
-case 44:
-YY_RULE_SETUP
-#line 503 "glcpp/glcpp-lex.l"
-{
- RETURN_TOKEN (DEFINED);
-}
- YY_BREAK
-case 45:
-YY_RULE_SETUP
-#line 507 "glcpp/glcpp-lex.l"
-{
- RETURN_STRING_TOKEN (IDENTIFIER);
-}
- YY_BREAK
-case 46:
-YY_RULE_SETUP
-#line 511 "glcpp/glcpp-lex.l"
-{
- RETURN_STRING_TOKEN (OTHER);
-}
- YY_BREAK
-case 47:
-YY_RULE_SETUP
-#line 515 "glcpp/glcpp-lex.l"
-{
- RETURN_TOKEN (yytext[0]);
-}
- YY_BREAK
-case 48:
-YY_RULE_SETUP
-#line 519 "glcpp/glcpp-lex.l"
-{
- RETURN_STRING_TOKEN (OTHER);
-}
- YY_BREAK
-case 49:
-YY_RULE_SETUP
-#line 523 "glcpp/glcpp-lex.l"
+#line 341 "glcpp/glcpp-lex.l"
{
if (yyextra->space_tokens) {
- RETURN_TOKEN (SPACE);
+ return SPACE;
}
}
YY_BREAK
-/* We preserve all newlines, even between #if 0..#endif, so no
- skipping.. */
-case 50:
-/* rule 50 can match eol */
+case 41:
+/* rule 41 can match eol */
YY_RULE_SETUP
-#line 531 "glcpp/glcpp-lex.l"
+#line 347 "glcpp/glcpp-lex.l"
{
if (parser->commented_newlines) {
BEGIN NEWLINE_CATCHUP;
- } else {
- BEGIN INITIAL;
}
- yyextra->space_tokens = 1;
- yyextra->lexing_directive = 0;
+ yyextra->lexing_if = 0;
yylineno++;
yycolumn = 0;
- RETURN_TOKEN_NEVER_SKIP (NEWLINE);
+ return NEWLINE;
}
YY_BREAK
+/* Handle missing newline at EOF. */
case YY_STATE_EOF(INITIAL):
-case YY_STATE_EOF(COMMENT):
-case YY_STATE_EOF(DEFINE):
-case YY_STATE_EOF(HASH):
-#line 544 "glcpp/glcpp-lex.l"
+#line 358 "glcpp/glcpp-lex.l"
{
- if (YY_START == COMMENT)
- glcpp_error(yylloc, yyextra, "Unterminated comment");
BEGIN DONE; /* Don't keep matching this rule forever. */
- yyextra->lexing_directive = 0;
- if (! parser->last_token_was_newline)
- RETURN_TOKEN (NEWLINE);
+ yyextra->lexing_if = 0;
+ return NEWLINE;
}
YY_BREAK
-/* This is a catch-all to avoid the annoying default flex action which
- * matches any character and prints it. If any input ever matches this
- * rule, then we have made a mistake above and need to fix one or more
- * of the preceding patterns to match that input. */
-case 51:
-YY_RULE_SETUP
-#line 558 "glcpp/glcpp-lex.l"
-{
- glcpp_error(yylloc, yyextra, "Internal compiler error: Unexpected character: %s", yytext);
-
- /* We don't actually use the UNREACHABLE start condition. We
- only have this block here so that we can pretend to call some
+/* We don't actually use the UNREACHABLE start condition. We
+ only have this action here so that we can pretend to call some
generated functions, (to avoid "defined but not used"
warnings. */
- if (YY_START == UNREACHABLE) {
- unput('.');
- yy_top_state(yyextra);
- }
+case 42:
+YY_RULE_SETUP
+#line 368 "glcpp/glcpp-lex.l"
+{
+ unput('.');
+ yy_top_state(yyextra);
}
YY_BREAK
-case 52:
+case 43:
YY_RULE_SETUP
-#line 571 "glcpp/glcpp-lex.l"
-YY_FATAL_ERROR( "flex scanner jammed" );
+#line 373 "glcpp/glcpp-lex.l"
+ECHO;
YY_BREAK
-#line 1670 "glcpp/glcpp-lex.c"
+#line 1409 "glcpp/glcpp-lex.c"
case YY_STATE_EOF(DONE):
-case YY_STATE_EOF(NEWLINE_CATCHUP):
+case YY_STATE_EOF(COMMENT):
case YY_STATE_EOF(UNREACHABLE):
+case YY_STATE_EOF(SKIP):
+case YY_STATE_EOF(DEFINE):
+case YY_STATE_EOF(NEWLINE_CATCHUP):
yyterminate();
case YY_END_OF_BUFFER:
@@ -1952,6 +1694,7 @@ static int yy_get_next_buffer (yyscan_t yyscanner)
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
yy_current_state = yyg->yy_start;
+ yy_current_state += YY_AT_BOL();
for ( yy_cp = yyg->yytext_ptr + YY_MORE_ADJ; yy_cp < yyg->yy_c_buf_p; ++yy_cp )
{
@@ -1964,7 +1707,7 @@ static int yy_get_next_buffer (yyscan_t yyscanner)
while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
{
yy_current_state = (int) yy_def[yy_current_state];
- if ( yy_current_state >= 174 )
+ if ( yy_current_state >= 151 )
yy_c = yy_meta[(unsigned int) yy_c];
}
yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
@@ -1993,11 +1736,11 @@ static int yy_get_next_buffer (yyscan_t yyscanner)
while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
{
yy_current_state = (int) yy_def[yy_current_state];
- if ( yy_current_state >= 174 )
+ if ( yy_current_state >= 151 )
yy_c = yy_meta[(unsigned int) yy_c];
}
yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
- yy_is_jam = (yy_current_state == 173);
+ yy_is_jam = (yy_current_state == 150);
(void)yyg;
return yy_is_jam ? 0 : yy_current_state;
@@ -2112,6 +1855,8 @@ static int yy_get_next_buffer (yyscan_t yyscanner)
*yyg->yy_c_buf_p = '\0'; /* preserve yytext */
yyg->yy_hold_char = *++yyg->yy_c_buf_p;
+ YY_CURRENT_BUFFER_LVALUE->yy_at_bol = (c == '\n');
+
return c;
}
#endif /* ifndef YY_NO_INPUT */
@@ -2886,7 +2631,7 @@ void glcpp_free (void * ptr , yyscan_t yyscanner)
#define YYTABLES_NAME "yytables"
-#line 571 "glcpp/glcpp-lex.l"
+#line 373 "glcpp/glcpp-lex.l"
diff --git a/dist/Mesa/src/glsl/glcpp/glcpp-lex.l b/dist/Mesa/src/glsl/glcpp/glcpp-lex.l
index fa9aa5069..188e45466 100644
--- a/dist/Mesa/src/glsl/glcpp/glcpp-lex.l
+++ b/dist/Mesa/src/glsl/glcpp/glcpp-lex.l
@@ -52,107 +52,14 @@ void glcpp_set_column (int column_no , yyscan_t yyscanner);
yylloc->last_column = yycolumn + 1; \
parser->has_new_line_number = 0; \
parser->has_new_source_number = 0; \
- } while(0);
+ } while(0);
#define YY_USER_INIT \
do { \
yylineno = 1; \
- yycolumn = 0; \
+ yycolumn = 1; \
yylloc->source = 0; \
} while(0)
-
-/* It's ugly to have macros that have return statements inside of
- * them, but flex-based lexer generation is all built around the
- * return statement.
- *
- * To mitigate the ugliness, we defer as much of the logic as possible
- * to an actual function, not a macro (see
- * glcpplex_update_state_per_token) and we make the word RETURN
- * prominent in all of the macros which may return.
- *
- * The most-commonly-used macro is RETURN_TOKEN which will perform all
- * necessary state updates based on the provided token,, then
- * conditionally return the token. It will not return a token if the
- * parser is currently skipping tokens, (such as within #if
- * 0...#else).
- *
- * The RETURN_TOKEN_NEVER_SKIP macro is a lower-level variant that
- * makes the token returning unconditional. This is needed for things
- * like #if and the tokens of its condition, (since these must be
- * evaluated by the parser even when otherwise skipping).
- *
- * Finally, RETURN_STRING_TOKEN is a simple convenience wrapper on top
- * of RETURN_TOKEN that performs a string copy of yytext before the
- * return.
- */
-#define RETURN_TOKEN_NEVER_SKIP(token) \
- do { \
- if (glcpp_lex_update_state_per_token (parser, token)) \
- return token; \
- } while (0)
-
-#define RETURN_TOKEN(token) \
- do { \
- if (! parser->skipping) { \
- RETURN_TOKEN_NEVER_SKIP(token); \
- } \
- } while(0)
-
-#define RETURN_STRING_TOKEN(token) \
- do { \
- if (! parser->skipping) { \
- yylval->str = ralloc_strdup (yyextra, yytext); \
- RETURN_TOKEN_NEVER_SKIP (token); \
- } \
- } while(0)
-
-
-/* Update all state necessary for each token being returned.
- *
- * Here we'll be tracking newlines and spaces so that the lexer can
- * alter its behavior as necessary, (for example, '#' has special
- * significance if it is the first non-whitespace, non-comment token
- * in a line, but does not otherwise).
- *
- * NOTE: If this function returns FALSE, then no token should be
- * returned at all. This is used to suprress duplicate SPACE tokens.
- */
-static int
-glcpp_lex_update_state_per_token (glcpp_parser_t *parser, int token)
-{
- /* After the first non-space token in a line, we won't
- * allow any '#' to introduce a directive. */
- if (token == NEWLINE) {
- parser->first_non_space_token_this_line = 1;
- } else if (token != SPACE) {
- parser->first_non_space_token_this_line = 0;
- }
-
- /* Track newlines just to know whether a newline needs
- * to be inserted if end-of-file comes early. */
- if (token == NEWLINE) {
- parser->last_token_was_newline = 1;
- } else {
- parser->last_token_was_newline = 0;
- }
-
- /* Track spaces to avoid emitting multiple SPACE
- * tokens in a row. */
- if (token == SPACE) {
- if (! parser->last_token_was_space) {
- parser->last_token_was_space = 1;
- return 1;
- } else {
- parser->last_token_was_space = 1;
- return 0;
- }
- } else {
- parser->last_token_was_space = 0;
- return 1;
- }
-}
-
-
%}
%option bison-bridge bison-locations reentrant noyywrap
@@ -160,21 +67,15 @@ glcpp_lex_update_state_per_token (glcpp_parser_t *parser, int token)
%option prefix="glcpp_"
%option stack
%option never-interactive
-%option warn nodefault
-
- /* Note: When adding any start conditions to this list, you must also
- * update the "Internal compiler error" catch-all rule near the end of
- * this file. */
-%x COMMENT DEFINE DONE HASH NEWLINE_CATCHUP UNREACHABLE
+%x DONE COMMENT UNREACHABLE SKIP DEFINE NEWLINE_CATCHUP
SPACE [[:space:]]
NONSPACE [^[:space:]]
+NEWLINE [\n]
HSPACE [ \t]
-HASH #
-NEWLINE (\r\n|\n\r|\r|\n)
+HASH ^{HSPACE}*#{HSPACE}*
IDENTIFIER [_a-zA-Z][_a-zA-Z0-9]*
-PP_NUMBER [.]?[0-9]([._a-zA-Z0-9]|[eEpP][-+])*
PUNCTUATION [][(){}.&*~!/%<>^|;,=+-]
/* The OTHER class is simply a catch-all for things that the CPP
@@ -209,363 +110,264 @@ HEXADECIMAL_INTEGER 0[xX][0-9a-fA-F]+[uU]?
parser->commented_newlines--;
if (parser->commented_newlines == 0)
BEGIN INITIAL;
- RETURN_TOKEN_NEVER_SKIP (NEWLINE);
+ return NEWLINE;
}
- /* Set up the parser->skipping bit here before doing any lexing.
+ /* The handling of the SKIP vs INITIAL start states requires
+ * some special handling. Typically, a lexer would change
+ * start states with statements like "BEGIN SKIP" within the
+ * lexer rules. We can't get away with that here, since we
+ * need the parser to actually evaluate expressions for
+ * directives like "#if".
*
- * This bit controls whether tokens are skipped, (as implemented by
- * RETURN_TOKEN), such as between "#if 0" and "#endif".
+ * So, here, in code that will be executed on every call to
+ * the lexer,and before any rules, we examine the skip_stack
+ * as set by the parser to know whether to change from INITIAL
+ * to SKIP or from SKIP back to INITIAL.
*
- * The parser maintains a skip_stack indicating whether we should be
- * skipping, (and nested levels of #if/#ifdef/#ifndef/#endif) will
- * push and pop items from the stack.
+ * Three cases cause us to switch out of the SKIP state and
+ * back to the INITIAL state:
*
- * Here are the rules for determining whether we are skipping:
+ * 1. The top of the skip_stack is of type SKIP_NO_SKIP
+ * This means we're still evaluating some #if
+ * hierarchy, but we're on a branch of it where
+ * content should not be skipped (such as "#if 1" or
+ * "#else" or so).
*
- * 1. If the skip stack is NULL, we are outside of all #if blocks
- * and we are not skipping.
+ * 2. The skip_stack is NULL meaning that we've reached
+ * the last #endif.
*
- * 2. If the skip stack is non-NULL, the type of the top node in
- * the stack determines whether to skip. A type of
- * SKIP_NO_SKIP is used for blocks wheere we are emitting
- * tokens, (such as between #if 1 and #endif, or after the
- * #else of an #if 0, etc.).
- *
- * 3. The lexing_directive bit overrides the skip stack. This bit
- * is set when we are actively lexing the expression for a
- * pre-processor condition, (such as #if, #elif, or #else). In
- * this case, even if otherwise skipping, we need to emit the
- * tokens for this condition so that the parser can evaluate
- * the expression. (For, #else, there's no expression, but we
- * emit tokens so the parser can generate a nice error message
- * if there are any tokens here).
+ * 3. The lexing_if bit is set. This indicates that we
+ * are lexing the expression following an "#if" of
+ * "#elif". Even inside an "#if 0" we need to lex this
+ * expression so the parser can correctly update the
+ * skip_stack state.
*/
- if (parser->skip_stack &&
- parser->skip_stack->type != SKIP_NO_SKIP &&
- ! parser->lexing_directive)
- {
- parser->skipping = 1;
- } else {
- parser->skipping = 0;
+ if (YY_START == INITIAL || YY_START == SKIP) {
+ if (parser->lexing_if ||
+ parser->skip_stack == NULL ||
+ parser->skip_stack->type == SKIP_NO_SKIP)
+ {
+ BEGIN INITIAL;
+ } else {
+ BEGIN SKIP;
+ }
}
/* Single-line comments */
-<INITIAL,DEFINE,HASH>"//"[^\r\n]* {
+"//"[^\n]* {
}
/* Multi-line comments */
-<INITIAL,DEFINE,HASH>"/*" { yy_push_state(COMMENT, yyscanner); }
-<COMMENT>[^*\r\n]*
-<COMMENT>[^*\r\n]*{NEWLINE} { yylineno++; yycolumn = 0; parser->commented_newlines++; }
-<COMMENT>"*"+[^*/\r\n]*
-<COMMENT>"*"+[^*/\r\n]*{NEWLINE} { yylineno++; yycolumn = 0; parser->commented_newlines++; }
+"/*" { yy_push_state(COMMENT, yyscanner); }
+<COMMENT>[^*\n]*
+<COMMENT>[^*\n]*\n { yylineno++; yycolumn = 0; parser->commented_newlines++; }
+<COMMENT>"*"+[^*/\n]*
+<COMMENT>"*"+[^*/\n]*\n { yylineno++; yycolumn = 0; parser->commented_newlines++; }
<COMMENT>"*"+"/" {
yy_pop_state(yyscanner);
- /* In the <HASH> start condition, we don't want any SPACE token. */
- if (yyextra->space_tokens && YY_START != HASH)
- RETURN_TOKEN (SPACE);
+ if (yyextra->space_tokens)
+ return SPACE;
}
-{HASH} {
-
- /* If the '#' is the first non-whitespace, non-comment token on this
- * line, then it introduces a directive, switch to the <HASH> start
- * condition.
- *
- * Otherwise, this is just punctuation, so return the HASH_TOKEN
- * token. */
- if (parser->first_non_space_token_this_line) {
- BEGIN HASH;
- }
-
- RETURN_TOKEN_NEVER_SKIP (HASH_TOKEN);
-}
-
-<HASH>version{HSPACE}+ {
- BEGIN INITIAL;
+{HASH}version{HSPACE}+ {
+ yylval->str = ralloc_strdup (yyextra, yytext);
yyextra->space_tokens = 0;
- RETURN_STRING_TOKEN (VERSION_TOKEN);
-}
-
- /* Swallow empty #pragma directives, (to avoid confusing the
- * downstream compiler).
- *
- * Note: We use a simple regular expression for the lookahead
- * here. Specifically, we cannot use the complete {NEWLINE} expression
- * since it uses alternation and we've found that there's a flex bug
- * where using alternation in the lookahead portion of a pattern
- * triggers a buffer overrun. */
-<HASH>pragma{HSPACE}*/[\r\n] {
- BEGIN INITIAL;
+ return HASH_VERSION;
}
/* glcpp doesn't handle #extension, #version, or #pragma directives.
* Simply pass them through to the main compiler's lexer/parser. */
-<HASH>(extension|pragma)[^\r\n]* {
- BEGIN INITIAL;
- RETURN_STRING_TOKEN (PRAGMA);
-}
-
-<HASH>line{HSPACE}+ {
- BEGIN INITIAL;
- RETURN_TOKEN (LINE);
+{HASH}(extension|pragma)[^\n]+ {
+ if (parser->commented_newlines)
+ BEGIN NEWLINE_CATCHUP;
+ yylval->str = ralloc_strdup (yyextra, yytext);
+ yylineno++;
+ yycolumn = 0;
+ return OTHER;
}
-<HASH>{NEWLINE} {
- BEGIN INITIAL;
- RETURN_TOKEN_NEVER_SKIP (NEWLINE);
+{HASH}line{HSPACE}+ {
+ return HASH_LINE;
}
- /* For the pre-processor directives, we return these tokens
- * even when we are otherwise skipping. */
-<HASH>ifdef {
- BEGIN INITIAL;
- yyextra->lexing_directive = 1;
+<SKIP,INITIAL>{
+{HASH}ifdef {
+ yyextra->lexing_if = 1;
yyextra->space_tokens = 0;
- RETURN_TOKEN_NEVER_SKIP (IFDEF);
+ return HASH_IFDEF;
}
-<HASH>ifndef {
- BEGIN INITIAL;
- yyextra->lexing_directive = 1;
+{HASH}ifndef {
+ yyextra->lexing_if = 1;
yyextra->space_tokens = 0;
- RETURN_TOKEN_NEVER_SKIP (IFNDEF);
+ return HASH_IFNDEF;
}
-<HASH>if/[^_a-zA-Z0-9] {
- BEGIN INITIAL;
- yyextra->lexing_directive = 1;
+{HASH}if/[^_a-zA-Z0-9] {
+ yyextra->lexing_if = 1;
yyextra->space_tokens = 0;
- RETURN_TOKEN_NEVER_SKIP (IF);
+ return HASH_IF;
}
-<HASH>elif/[^_a-zA-Z0-9] {
- BEGIN INITIAL;
- yyextra->lexing_directive = 1;
+{HASH}elif/[^_a-zA-Z0-9] {
+ yyextra->lexing_if = 1;
yyextra->space_tokens = 0;
- RETURN_TOKEN_NEVER_SKIP (ELIF);
+ return HASH_ELIF;
}
-<HASH>else {
- BEGIN INITIAL;
+{HASH}else {
yyextra->space_tokens = 0;
- RETURN_TOKEN_NEVER_SKIP (ELSE);
+ return HASH_ELSE;
}
-<HASH>endif {
- BEGIN INITIAL;
+{HASH}endif {
yyextra->space_tokens = 0;
- RETURN_TOKEN_NEVER_SKIP (ENDIF);
+ return HASH_ENDIF;
}
-
-<HASH>error[^\r\n]* {
- BEGIN INITIAL;
- RETURN_STRING_TOKEN (ERROR_TOKEN);
}
- /* After we see a "#define" we enter the <DEFINE> start state
- * for the lexer. Within <DEFINE> we are looking for the first
- * identifier and specifically checking whether the identifier
- * is followed by a '(' or not, (to lex either a
- * FUNC_IDENTIFIER or an OBJ_IDENITIFIER token).
- *
- * While in the <DEFINE> state we also need to explicitly
- * handle a few other things that may appear before the
- * identifier:
- *
- * * Comments, (handled above with the main support for
- * comments).
- *
- * * Whitespace (simply ignored)
- *
- * * Anything else, (not an identifier, not a comment,
- * and not whitespace). This will generate an error.
- */
-<HASH>define{HSPACE}* {
- if (! parser->skipping) {
- BEGIN DEFINE;
- yyextra->space_tokens = 0;
- RETURN_TOKEN (DEFINE_TOKEN);
- }
-}
-
-<HASH>undef {
- BEGIN INITIAL;
- yyextra->space_tokens = 0;
- RETURN_TOKEN (UNDEF);
+<SKIP>[^\n] {
+ if (parser->commented_newlines)
+ BEGIN NEWLINE_CATCHUP;
}
-<HASH>{HSPACE}+ {
- /* Nothing to do here. Importantly, don't leave the <HASH>
- * start condition, since it's legal to have space between the
- * '#' and the directive.. */
+{HASH}error.* {
+ char *p;
+ for (p = yytext; !isalpha(p[0]); p++); /* skip " # " */
+ p += 5; /* skip "error" */
+ glcpp_error(yylloc, yyextra, "#error%s", p);
}
- /* This will catch any non-directive garbage after a HASH */
-<HASH>{NONSPACE} {
- BEGIN INITIAL;
- RETURN_TOKEN (GARBAGE);
+{HASH}define{HSPACE}+ {
+ yyextra->space_tokens = 0;
+ yy_push_state(DEFINE, yyscanner);
+ return HASH_DEFINE;
}
- /* An identifier immediately followed by '(' */
<DEFINE>{IDENTIFIER}/"(" {
- BEGIN INITIAL;
- RETURN_STRING_TOKEN (FUNC_IDENTIFIER);
+ yy_pop_state(yyscanner);
+ yylval->str = ralloc_strdup (yyextra, yytext);
+ return FUNC_IDENTIFIER;
}
- /* An identifier not immediately followed by '(' */
<DEFINE>{IDENTIFIER} {
- BEGIN INITIAL;
- RETURN_STRING_TOKEN (OBJ_IDENTIFIER);
-}
-
- /* Whitespace */
-<DEFINE>{HSPACE}+ {
- /* Just ignore it. Nothing to do here. */
+ yy_pop_state(yyscanner);
+ yylval->str = ralloc_strdup (yyextra, yytext);
+ return OBJ_IDENTIFIER;
}
- /* '/' not followed by '*', so not a comment. This is an error. */
-<DEFINE>[/][^*]{NONSPACE}* {
- BEGIN INITIAL;
- glcpp_error(yylloc, yyextra, "#define followed by a non-identifier: %s", yytext);
- RETURN_STRING_TOKEN (INTEGER_STRING);
+{HASH}undef {
+ yyextra->space_tokens = 0;
+ return HASH_UNDEF;
}
- /* A character that can't start an identifier, comment, or
- * space. This is an error. */
-<DEFINE>[^_a-zA-Z/[:space:]]{NONSPACE}* {
- BEGIN INITIAL;
- glcpp_error(yylloc, yyextra, "#define followed by a non-identifier: %s", yytext);
- RETURN_STRING_TOKEN (INTEGER_STRING);
+{HASH} {
+ yyextra->space_tokens = 0;
+ return HASH;
}
{DECIMAL_INTEGER} {
- RETURN_STRING_TOKEN (INTEGER_STRING);
+ yylval->str = ralloc_strdup (yyextra, yytext);
+ return INTEGER_STRING;
}
{OCTAL_INTEGER} {
- RETURN_STRING_TOKEN (INTEGER_STRING);
+ yylval->str = ralloc_strdup (yyextra, yytext);
+ return INTEGER_STRING;
}
{HEXADECIMAL_INTEGER} {
- RETURN_STRING_TOKEN (INTEGER_STRING);
+ yylval->str = ralloc_strdup (yyextra, yytext);
+ return INTEGER_STRING;
}
"<<" {
- RETURN_TOKEN (LEFT_SHIFT);
+ return LEFT_SHIFT;
}
">>" {
- RETURN_TOKEN (RIGHT_SHIFT);
+ return RIGHT_SHIFT;
}
"<=" {
- RETURN_TOKEN (LESS_OR_EQUAL);
+ return LESS_OR_EQUAL;
}
">=" {
- RETURN_TOKEN (GREATER_OR_EQUAL);
+ return GREATER_OR_EQUAL;
}
"==" {
- RETURN_TOKEN (EQUAL);
+ return EQUAL;
}
"!=" {
- RETURN_TOKEN (NOT_EQUAL);
+ return NOT_EQUAL;
}
"&&" {
- RETURN_TOKEN (AND);
+ return AND;
}
"||" {
- RETURN_TOKEN (OR);
-}
-
-"++" {
- RETURN_TOKEN (PLUS_PLUS);
-}
-
-"--" {
- RETURN_TOKEN (MINUS_MINUS);
+ return OR;
}
"##" {
- if (! parser->skipping) {
- if (parser->is_gles)
- glcpp_error(yylloc, yyextra, "Token pasting (##) is illegal in GLES");
- RETURN_TOKEN (PASTE);
- }
+ if (parser->is_gles)
+ glcpp_error(yylloc, yyextra, "Token pasting (##) is illegal in GLES");
+ return PASTE;
}
"defined" {
- RETURN_TOKEN (DEFINED);
+ return DEFINED;
}
{IDENTIFIER} {
- RETURN_STRING_TOKEN (IDENTIFIER);
-}
-
-{PP_NUMBER} {
- RETURN_STRING_TOKEN (OTHER);
+ yylval->str = ralloc_strdup (yyextra, yytext);
+ return IDENTIFIER;
}
{PUNCTUATION} {
- RETURN_TOKEN (yytext[0]);
+ return yytext[0];
}
{OTHER}+ {
- RETURN_STRING_TOKEN (OTHER);
+ yylval->str = ralloc_strdup (yyextra, yytext);
+ return OTHER;
}
{HSPACE} {
if (yyextra->space_tokens) {
- RETURN_TOKEN (SPACE);
+ return SPACE;
}
}
- /* We preserve all newlines, even between #if 0..#endif, so no
- skipping.. */
-<*>{NEWLINE} {
+<SKIP,INITIAL>\n {
if (parser->commented_newlines) {
BEGIN NEWLINE_CATCHUP;
- } else {
- BEGIN INITIAL;
}
- yyextra->space_tokens = 1;
- yyextra->lexing_directive = 0;
+ yyextra->lexing_if = 0;
yylineno++;
yycolumn = 0;
- RETURN_TOKEN_NEVER_SKIP (NEWLINE);
+ return NEWLINE;
}
-<INITIAL,COMMENT,DEFINE,HASH><<EOF>> {
- if (YY_START == COMMENT)
- glcpp_error(yylloc, yyextra, "Unterminated comment");
+ /* Handle missing newline at EOF. */
+<INITIAL><<EOF>> {
BEGIN DONE; /* Don't keep matching this rule forever. */
- yyextra->lexing_directive = 0;
- if (! parser->last_token_was_newline)
- RETURN_TOKEN (NEWLINE);
+ yyextra->lexing_if = 0;
+ return NEWLINE;
}
- /* This is a catch-all to avoid the annoying default flex action which
- * matches any character and prints it. If any input ever matches this
- * rule, then we have made a mistake above and need to fix one or more
- * of the preceding patterns to match that input. */
-
-<*>. {
- glcpp_error(yylloc, yyextra, "Internal compiler error: Unexpected character: %s", yytext);
-
/* We don't actually use the UNREACHABLE start condition. We
- only have this block here so that we can pretend to call some
+ only have this action here so that we can pretend to call some
generated functions, (to avoid "defined but not used"
warnings. */
- if (YY_START == UNREACHABLE) {
- unput('.');
- yy_top_state(yyextra);
- }
+<UNREACHABLE>. {
+ unput('.');
+ yy_top_state(yyextra);
}
%%
diff --git a/dist/Mesa/src/glsl/glcpp/glcpp-parse.c b/dist/Mesa/src/glsl/glcpp/glcpp-parse.c
index b7d51ea45..a131a824e 100644
--- a/dist/Mesa/src/glsl/glcpp/glcpp-parse.c
+++ b/dist/Mesa/src/glsl/glcpp/glcpp-parse.c
@@ -128,9 +128,6 @@ _string_list_append_item (string_list_t *list, const char *str);
static int
_string_list_contains (string_list_t *list, const char *member, int *index);
-static const char *
-_string_list_has_duplicate (string_list_t *list);
-
static int
_string_list_length (string_list_t *list);
@@ -179,25 +176,18 @@ _parser_active_list_pop (glcpp_parser_t *parser);
static int
_parser_active_list_contains (glcpp_parser_t *parser, const char *identifier);
-typedef enum {
- EXPANSION_MODE_IGNORE_DEFINED,
- EXPANSION_MODE_EVALUATE_DEFINED
-} expansion_mode_t;
-
/* Expand list, and begin lexing from the result (after first
* prefixing a token of type 'head_token_type').
*/
static void
_glcpp_parser_expand_and_lex_from (glcpp_parser_t *parser,
int head_token_type,
- token_list_t *list,
- expansion_mode_t mode);
+ token_list_t *list);
/* Perform macro expansion in-place on the given list. */
static void
_glcpp_parser_expand_token_list (glcpp_parser_t *parser,
- token_list_t *list,
- expansion_mode_t mode);
+ token_list_t *list);
static void
_glcpp_parser_print_expanded_token_list (glcpp_parser_t *parser,
@@ -228,7 +218,7 @@ static void
add_builtin_define(glcpp_parser_t *parser, const char *name, int value);
-#line 232 "glcpp/glcpp-parse.c" /* yacc.c:339 */
+#line 222 "glcpp/glcpp-parse.c" /* yacc.c:339 */
# ifndef YY_NULLPTR
# if defined __cplusplus && 201103L <= __cplusplus
@@ -252,7 +242,7 @@ add_builtin_define(glcpp_parser_t *parser, const char *name, int value);
# define YY_GLCPP_PARSER_SRC_GLSL_GLCPP_GLCPP_PARSE_H_INCLUDED
/* Debug traces. */
#ifndef YYDEBUG
-# define YYDEBUG 1
+# define YYDEBUG 0
#endif
#if YYDEBUG
extern int glcpp_parser_debug;
@@ -263,45 +253,41 @@ extern int glcpp_parser_debug;
# define YYTOKENTYPE
enum yytokentype
{
- DEFINED = 258,
- ELIF_EXPANDED = 259,
- HASH_TOKEN = 260,
- DEFINE_TOKEN = 261,
- FUNC_IDENTIFIER = 262,
- OBJ_IDENTIFIER = 263,
- ELIF = 264,
- ELSE = 265,
- ENDIF = 266,
- ERROR_TOKEN = 267,
- IF = 268,
- IFDEF = 269,
- IFNDEF = 270,
- LINE = 271,
- PRAGMA = 272,
- UNDEF = 273,
- VERSION_TOKEN = 274,
- GARBAGE = 275,
- IDENTIFIER = 276,
- IF_EXPANDED = 277,
- INTEGER = 278,
- INTEGER_STRING = 279,
- LINE_EXPANDED = 280,
- NEWLINE = 281,
- OTHER = 282,
- PLACEHOLDER = 283,
- SPACE = 284,
- PLUS_PLUS = 285,
- MINUS_MINUS = 286,
- PASTE = 287,
- OR = 288,
- AND = 289,
- EQUAL = 290,
- NOT_EQUAL = 291,
- LESS_OR_EQUAL = 292,
- GREATER_OR_EQUAL = 293,
- LEFT_SHIFT = 294,
- RIGHT_SHIFT = 295,
- UNARY = 296
+ COMMA_FINAL = 258,
+ DEFINED = 259,
+ ELIF_EXPANDED = 260,
+ HASH = 261,
+ HASH_DEFINE = 262,
+ FUNC_IDENTIFIER = 263,
+ OBJ_IDENTIFIER = 264,
+ HASH_ELIF = 265,
+ HASH_ELSE = 266,
+ HASH_ENDIF = 267,
+ HASH_IF = 268,
+ HASH_IFDEF = 269,
+ HASH_IFNDEF = 270,
+ HASH_LINE = 271,
+ HASH_UNDEF = 272,
+ HASH_VERSION = 273,
+ IDENTIFIER = 274,
+ IF_EXPANDED = 275,
+ INTEGER = 276,
+ INTEGER_STRING = 277,
+ LINE_EXPANDED = 278,
+ NEWLINE = 279,
+ OTHER = 280,
+ PLACEHOLDER = 281,
+ SPACE = 282,
+ PASTE = 283,
+ OR = 284,
+ AND = 285,
+ EQUAL = 286,
+ NOT_EQUAL = 287,
+ LESS_OR_EQUAL = 288,
+ GREATER_OR_EQUAL = 289,
+ LEFT_SHIFT = 290,
+ RIGHT_SHIFT = 291,
+ UNARY = 292
};
#endif
@@ -329,7 +315,7 @@ int glcpp_parser_parse (glcpp_parser_t *parser);
/* Copy the second part of user declarations. */
-#line 333 "glcpp/glcpp-parse.c" /* yacc.c:358 */
+#line 319 "glcpp/glcpp-parse.c" /* yacc.c:358 */
#ifdef short
# undef short
@@ -573,21 +559,21 @@ union yyalloc
/* YYFINAL -- State number of the termination state. */
#define YYFINAL 2
/* YYLAST -- Last index in YYTABLE. */
-#define YYLAST 652
+#define YYLAST 695
/* YYNTOKENS -- Number of terminals. */
-#define YYNTOKENS 64
+#define YYNTOKENS 60
/* YYNNTS -- Number of nonterminals. */
-#define YYNNTS 25
+#define YYNNTS 26
/* YYNRULES -- Number of rules. */
-#define YYNRULES 118
+#define YYNRULES 115
/* YYNSTATES -- Number of states. */
-#define YYNSTATES 185
+#define YYNSTATES 181
/* YYTRANSLATE[YYX] -- Symbol number corresponding to YYX as returned
by yylex, with out-of-bounds checking. */
#define YYUNDEFTOK 2
-#define YYMAXUTOK 296
+#define YYMAXUTOK 292
#define YYTRANSLATE(YYX) \
((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
@@ -599,16 +585,16 @@ static const yytype_uint8 yytranslate[] =
0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 54, 2, 2, 2, 50, 37, 2,
- 52, 53, 48, 46, 56, 47, 61, 49, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 62,
- 40, 63, 41, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 50, 2, 2, 2, 46, 33, 2,
+ 48, 49, 44, 42, 52, 43, 57, 45, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 58,
+ 36, 59, 37, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 57, 2, 58, 36, 2, 2, 2, 2, 2,
+ 2, 53, 2, 54, 32, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 59, 35, 60, 55, 2, 2, 2,
+ 2, 2, 2, 55, 31, 56, 51, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
@@ -624,26 +610,26 @@ static const yytype_uint8 yytranslate[] =
2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
- 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
- 38, 39, 42, 43, 44, 45, 51
+ 25, 26, 27, 28, 29, 30, 34, 35, 38, 39,
+ 40, 41, 47
};
#if YYDEBUG
/* YYRLINE[YYN] -- Source line where rule number YYN was defined. */
static const yytype_uint16 yyrline[] =
{
- 0, 205, 205, 207, 211, 212, 213, 218, 222, 227,
- 232, 240, 253, 256, 259, 265, 268, 269, 269, 284,
- 284, 287, 287, 304, 304, 327, 337, 337, 344, 344,
- 351, 377, 397, 397, 410, 410, 413, 419, 425, 428,
- 434, 437, 440, 446, 455, 460, 464, 471, 482, 493,
- 500, 507, 514, 521, 528, 535, 542, 549, 556, 563,
- 570, 577, 584, 596, 608, 615, 619, 623, 627, 631,
- 637, 642, 650, 651, 655, 656, 659, 661, 667, 672,
- 679, 683, 687, 691, 695, 699, 706, 707, 708, 709,
- 710, 711, 712, 713, 714, 715, 716, 717, 718, 719,
- 720, 721, 722, 723, 724, 725, 726, 727, 728, 729,
- 730, 731, 732, 733, 734, 735, 736, 737, 738
+ 0, 188, 188, 190, 194, 197, 197, 208, 213, 214,
+ 218, 221, 224, 232, 245, 248, 251, 257, 257, 260,
+ 260, 270, 270, 292, 302, 302, 309, 309, 316, 341,
+ 361, 361, 374, 374, 377, 383, 389, 395, 404, 409,
+ 410, 415, 418, 421, 424, 427, 430, 433, 436, 439,
+ 442, 445, 448, 451, 454, 457, 460, 468, 476, 479,
+ 482, 485, 488, 491, 497, 502, 510, 511, 515, 521,
+ 522, 525, 527, 534, 538, 542, 547, 551, 558, 563,
+ 570, 574, 578, 582, 586, 593, 594, 595, 596, 597,
+ 598, 599, 600, 601, 602, 603, 604, 605, 606, 607,
+ 608, 609, 610, 611, 612, 613, 614, 615, 616, 617,
+ 618, 619, 620, 621, 622, 623
};
#endif
@@ -652,21 +638,21 @@ static const yytype_uint16 yyrline[] =
First, the terminals, then, starting at YYNTOKENS, nonterminals. */
static const char *const yytname[] =
{
- "$end", "error", "$undefined", "DEFINED", "ELIF_EXPANDED", "HASH_TOKEN",
- "DEFINE_TOKEN", "FUNC_IDENTIFIER", "OBJ_IDENTIFIER", "ELIF", "ELSE",
- "ENDIF", "ERROR_TOKEN", "IF", "IFDEF", "IFNDEF", "LINE", "PRAGMA",
- "UNDEF", "VERSION_TOKEN", "GARBAGE", "IDENTIFIER", "IF_EXPANDED",
- "INTEGER", "INTEGER_STRING", "LINE_EXPANDED", "NEWLINE", "OTHER",
- "PLACEHOLDER", "SPACE", "PLUS_PLUS", "MINUS_MINUS", "PASTE", "OR", "AND",
- "'|'", "'^'", "'&'", "EQUAL", "NOT_EQUAL", "'<'", "'>'", "LESS_OR_EQUAL",
- "GREATER_OR_EQUAL", "LEFT_SHIFT", "RIGHT_SHIFT", "'+'", "'-'", "'*'",
- "'/'", "'%'", "UNARY", "'('", "')'", "'!'", "'~'", "','", "'['", "']'",
- "'{'", "'}'", "'.'", "';'", "'='", "$accept", "input", "line",
- "expanded_line", "define", "control_line", "$@1", "control_line_success",
- "$@2", "$@3", "$@4", "$@5", "$@6", "$@7", "$@8", "control_line_error",
- "integer_constant", "expression", "identifier_list", "text_line",
- "replacement_list", "junk", "pp_tokens", "preprocessing_token",
- "operator", YY_NULLPTR
+ "$end", "error", "$undefined", "COMMA_FINAL", "DEFINED",
+ "ELIF_EXPANDED", "HASH", "HASH_DEFINE", "FUNC_IDENTIFIER",
+ "OBJ_IDENTIFIER", "HASH_ELIF", "HASH_ELSE", "HASH_ENDIF", "HASH_IF",
+ "HASH_IFDEF", "HASH_IFNDEF", "HASH_LINE", "HASH_UNDEF", "HASH_VERSION",
+ "IDENTIFIER", "IF_EXPANDED", "INTEGER", "INTEGER_STRING",
+ "LINE_EXPANDED", "NEWLINE", "OTHER", "PLACEHOLDER", "SPACE", "PASTE",
+ "OR", "AND", "'|'", "'^'", "'&'", "EQUAL", "NOT_EQUAL", "'<'", "'>'",
+ "LESS_OR_EQUAL", "GREATER_OR_EQUAL", "LEFT_SHIFT", "RIGHT_SHIFT", "'+'",
+ "'-'", "'*'", "'/'", "'%'", "UNARY", "'('", "')'", "'!'", "'~'", "','",
+ "'['", "']'", "'{'", "'}'", "'.'", "';'", "'='", "$accept", "input",
+ "line", "$@1", "expanded_line", "define", "control_line", "$@2", "$@3",
+ "$@4", "$@5", "$@6", "$@7", "$@8", "integer_constant", "expression",
+ "identifier_list", "text_line", "non_directive", "replacement_list",
+ "junk", "conditional_token", "conditional_tokens", "pp_tokens",
+ "preprocessing_token", "operator", YY_NULLPTR
};
#endif
@@ -678,17 +664,16 @@ static const yytype_uint16 yytoknum[] =
0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
275, 276, 277, 278, 279, 280, 281, 282, 283, 284,
- 285, 286, 287, 288, 289, 124, 94, 38, 290, 291,
- 60, 62, 292, 293, 294, 295, 43, 45, 42, 47,
- 37, 296, 40, 41, 33, 126, 44, 91, 93, 123,
- 125, 46, 59, 61
+ 285, 124, 94, 38, 286, 287, 60, 62, 288, 289,
+ 290, 291, 43, 45, 42, 47, 37, 292, 40, 41,
+ 33, 126, 44, 91, 93, 123, 125, 46, 59, 61
};
# endif
-#define YYPACT_NINF -142
+#define YYPACT_NINF -166
#define yypact_value_is_default(Yystate) \
- (!!((Yystate) == (-142)))
+ (!!((Yystate) == (-166)))
#define YYTABLE_NINF -1
@@ -699,25 +684,25 @@ static const yytype_uint16 yytoknum[] =
STATE-NUM. */
static const yytype_int16 yypact[] =
{
- -142, 134, -142, -142, -18, 578, -142, -18, -142, -15,
- -142, -142, 26, -142, -142, -142, -142, -142, -142, -142,
- -142, -142, -142, -142, -142, -142, -142, -142, -142, -142,
- -142, -142, -142, -142, -142, -142, -142, -142, -142, -142,
- -142, -142, -142, -142, -142, -142, -142, -142, -142, -142,
- -142, -142, 182, -142, -142, -142, -142, -142, -18, -18,
- -18, -18, -18, -142, 508, 7, 230, -142, -142, 9,
- 25, -142, -142, -142, 35, -142, -15, 470, -142, 533,
- 81, -142, -142, -142, -142, -142, -142, -23, -142, -142,
- -142, -18, -18, -18, -18, -18, -18, -18, -18, -18,
- -18, -18, -18, -18, -18, -18, -18, -18, -18, -142,
- 65, -142, 278, 38, 58, -142, -142, 470, 90, 91,
- 470, -142, 92, 37, 326, -142, -142, 89, -142, 571,
- 587, 602, 83, 102, 0, 0, 33, 33, 33, 33,
- 20, 20, 60, 60, -142, -142, -142, 66, 470, -142,
- -142, -142, -142, 374, 470, 470, 422, 109, 110, -142,
- -142, -142, -14, 131, 470, -142, 136, 470, 172, -142,
- -142, -142, -142, 470, 4, -142, -142, -142, 173, 470,
- 179, -142, 175, -142, -142
+ -166, 147, -166, 87, -10, -166, 190, -166, -166, -17,
+ -166, -166, -166, -166, 52, -166, 87, -166, 52, -166,
+ -166, -166, -166, -166, -166, -166, -166, -166, -166, -166,
+ -166, -166, -166, -166, -166, -166, -166, -166, -166, -166,
+ -166, -166, -166, -166, -166, -166, -166, -166, -166, -166,
+ -166, -166, -166, -166, -166, -166, -166, 360, -166, -166,
+ -166, -166, -166, 87, 87, 87, 87, 87, -166, 519,
+ -166, -166, 401, 105, 31, -166, -166, 233, -166, 34,
+ 44, -166, 319, 67, 86, 483, 88, -8, 542, 48,
+ -166, -166, -166, -166, 560, -166, -166, -166, 87, 87,
+ 87, 87, 87, 87, 87, 87, 87, 87, 87, 87,
+ 87, 87, 87, 87, 87, 87, -166, -35, 483, -166,
+ -166, 96, -166, -166, -166, -166, 276, 483, 483, 442,
+ 92, 93, -166, -166, -166, 94, -166, 580, 596, 611,
+ 625, 638, 649, 649, 19, 19, 19, 19, 38, 38,
+ 66, 66, -166, -166, -166, 18, 95, 483, 72, -166,
+ 98, 483, 100, -166, -166, -166, -166, -166, 483, 26,
+ -166, -166, -166, -166, 101, 483, 107, -166, 108, -166,
+ -166
};
/* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM.
@@ -725,41 +710,41 @@ static const yytype_int16 yypact[] =
means the default is an error. */
static const yytype_uint8 yydefact[] =
{
- 2, 0, 1, 83, 0, 0, 80, 0, 81, 0,
- 72, 84, 85, 117, 118, 116, 112, 111, 110, 109,
- 93, 107, 108, 103, 104, 105, 106, 101, 102, 95,
- 96, 94, 99, 100, 88, 89, 98, 97, 114, 86,
- 87, 90, 91, 92, 113, 115, 3, 7, 4, 15,
- 16, 6, 0, 78, 82, 46, 44, 43, 0, 0,
- 0, 0, 0, 45, 0, 19, 0, 32, 34, 0,
- 23, 26, 28, 17, 0, 21, 0, 0, 38, 0,
- 0, 5, 73, 85, 79, 68, 67, 0, 65, 66,
- 9, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 41,
- 0, 31, 0, 0, 0, 40, 25, 0, 0, 0,
- 0, 39, 0, 0, 0, 8, 10, 0, 69, 47,
- 48, 49, 50, 51, 53, 52, 57, 56, 55, 54,
- 59, 58, 61, 60, 64, 63, 62, 0, 74, 20,
- 30, 33, 35, 0, 76, 76, 0, 0, 0, 36,
- 42, 11, 0, 0, 75, 24, 0, 77, 0, 18,
- 22, 37, 70, 74, 0, 12, 27, 29, 0, 74,
- 0, 13, 0, 71, 14
+ 2, 0, 1, 0, 0, 17, 0, 30, 32, 21,
+ 24, 26, 5, 19, 0, 80, 0, 81, 0, 66,
+ 83, 84, 115, 111, 110, 109, 108, 92, 106, 107,
+ 102, 103, 104, 105, 100, 101, 94, 95, 93, 98,
+ 99, 87, 88, 97, 96, 113, 85, 86, 89, 90,
+ 91, 112, 114, 3, 8, 4, 7, 0, 78, 82,
+ 40, 38, 37, 0, 0, 0, 0, 0, 39, 0,
+ 36, 9, 0, 0, 0, 29, 76, 0, 75, 0,
+ 0, 23, 0, 0, 0, 0, 0, 0, 0, 0,
+ 67, 79, 62, 61, 0, 59, 60, 11, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 68, 0, 69, 18,
+ 73, 0, 28, 77, 31, 33, 0, 71, 71, 0,
+ 0, 0, 34, 10, 12, 0, 63, 41, 42, 43,
+ 44, 45, 47, 46, 51, 50, 49, 48, 53, 52,
+ 55, 54, 58, 57, 56, 0, 0, 70, 0, 22,
+ 0, 72, 0, 6, 20, 35, 13, 64, 69, 0,
+ 14, 74, 25, 27, 0, 69, 0, 15, 0, 65,
+ 16
};
/* YYPGOTO[NTERM-NUM]. */
static const yytype_int16 yypgoto[] =
{
- -142, -142, -142, -142, -142, 47, -142, -142, -142, -142,
- -142, -142, -142, -142, -142, -142, -5, -6, -142, -142,
- -141, 49, -1, -50, -142
+ -166, -166, -166, -166, -166, -166, -166, -166, -166, -166,
+ -166, -166, -166, -166, -12, -11, -166, -166, -166, -165,
+ 3, -69, 51, 0, -6, -166
};
/* YYDEFGOTO[NTERM-NUM]. */
static const yytype_int16 yydefgoto[] =
{
- -1, 1, 46, 47, 149, 48, 120, 49, 110, 122,
- 117, 118, 119, 113, 114, 50, 63, 64, 174, 51,
- 163, 166, 164, 53, 54
+ -1, 1, 53, 85, 54, 119, 55, 73, 86, 82,
+ 83, 84, 79, 80, 68, 69, 169, 56, 71, 156,
+ 160, 76, 77, 157, 58, 59
};
/* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If
@@ -767,201 +752,209 @@ static const yytype_int16 yydefgoto[] =
number is the opposite. If YYTABLE_NINF, syntax error. */
static const yytype_uint8 yytable[] =
{
- 52, 79, 84, 55, 80, 56, 57, 172, 56, 57,
- 91, 92, 93, 94, 95, 96, 97, 98, 99, 100,
- 101, 102, 103, 104, 105, 106, 107, 108, 58, 59,
- 128, 5, 178, 109, 60, 115, 61, 62, 182, 173,
- 98, 99, 100, 101, 102, 103, 104, 105, 106, 107,
- 108, 116, 85, 86, 87, 88, 89, 179, 158, 81,
- 180, 121, 84, 159, 151, 112, 104, 105, 106, 107,
- 108, 123, 147, 148, 84, 127, 124, 102, 103, 104,
- 105, 106, 107, 108, 152, 129, 130, 131, 132, 133,
- 134, 135, 136, 137, 138, 139, 140, 141, 142, 143,
- 144, 145, 146, 84, 56, 57, 84, 126, 106, 107,
- 108, 154, 155, 157, 84, 161, 153, 84, 162, 156,
- 95, 96, 97, 98, 99, 100, 101, 102, 103, 104,
- 105, 106, 107, 108, 2, 170, 171, 3, 4, 5,
- 96, 97, 98, 99, 100, 101, 102, 103, 104, 105,
- 106, 107, 108, 167, 167, 6, 7, 175, 8, 9,
- 10, 11, 176, 12, 13, 14, 15, 16, 17, 18,
- 19, 20, 21, 22, 23, 24, 25, 26, 27, 28,
- 29, 30, 31, 32, 33, 3, 34, 35, 36, 37,
- 38, 39, 40, 41, 42, 43, 44, 45, 177, 181,
- 183, 184, 0, 6, 168, 0, 8, 0, 82, 11,
- 0, 83, 13, 14, 15, 16, 17, 18, 19, 20,
+ 78, 57, 87, 174, 72, 88, 89, 81, 123, 15,
+ 178, 131, 17, 155, 70, 20, 132, 21, 22, 23,
+ 24, 25, 26, 27, 28, 29, 30, 31, 32, 33,
+ 34, 35, 36, 37, 38, 39, 40, 167, 41, 42,
+ 43, 44, 45, 46, 47, 48, 49, 50, 51, 52,
+ 120, 91, 92, 93, 94, 95, 96, 123, 124, 109,
+ 110, 111, 112, 113, 114, 115, 91, 168, 125, 61,
+ 62, 78, 134, 61, 62, 175, 78, 135, 176, 121,
+ 111, 112, 113, 114, 115, 129, 127, 137, 138, 139,
+ 140, 141, 142, 143, 144, 145, 146, 147, 148, 149,
+ 150, 151, 152, 153, 154, 128, 60, 130, 61, 62,
+ 113, 114, 115, 117, 118, 158, 164, 165, 166, 170,
+ 78, 171, 172, 91, 173, 177, 179, 161, 161, 63,
+ 64, 162, 180, 126, 0, 65, 0, 66, 67, 0,
+ 0, 0, 0, 0, 0, 0, 0, 2, 0, 0,
+ 0, 91, 3, 4, 5, 91, 0, 6, 7, 8,
+ 9, 10, 11, 12, 13, 14, 15, 16, 0, 17,
+ 18, 19, 20, 0, 21, 22, 23, 24, 25, 26,
+ 27, 28, 29, 30, 31, 32, 33, 34, 35, 36,
+ 37, 38, 39, 40, 74, 41, 42, 43, 44, 45,
+ 46, 47, 48, 49, 50, 51, 52, 0, 0, 15,
+ 0, 0, 17, 0, 75, 20, 0, 21, 22, 23,
+ 24, 25, 26, 27, 28, 29, 30, 31, 32, 33,
+ 34, 35, 36, 37, 38, 39, 40, 74, 41, 42,
+ 43, 44, 45, 46, 47, 48, 49, 50, 51, 52,
+ 0, 0, 15, 0, 0, 17, 0, 122, 20, 0,
21, 22, 23, 24, 25, 26, 27, 28, 29, 30,
- 31, 32, 33, 3, 34, 35, 36, 37, 38, 39,
- 40, 41, 42, 43, 44, 45, 0, 0, 0, 0,
- 0, 6, 0, 0, 8, 0, 111, 11, 0, 83,
- 13, 14, 15, 16, 17, 18, 19, 20, 21, 22,
+ 31, 32, 33, 34, 35, 36, 37, 38, 39, 40,
+ 74, 41, 42, 43, 44, 45, 46, 47, 48, 49,
+ 50, 51, 52, 0, 0, 15, 0, 0, 17, 0,
+ 159, 20, 0, 21, 22, 23, 24, 25, 26, 27,
+ 28, 29, 30, 31, 32, 33, 34, 35, 36, 37,
+ 38, 39, 40, 74, 41, 42, 43, 44, 45, 46,
+ 47, 48, 49, 50, 51, 52, 0, 0, 15, 0,
+ 0, 17, 0, 0, 20, 0, 21, 22, 23, 24,
+ 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
+ 35, 36, 37, 38, 39, 40, 0, 41, 42, 43,
+ 44, 45, 46, 47, 48, 49, 50, 51, 52, 15,
+ 0, 0, 17, 0, 90, 20, 0, 21, 22, 23,
+ 24, 25, 26, 27, 28, 29, 30, 31, 32, 33,
+ 34, 35, 36, 37, 38, 39, 40, 0, 41, 42,
+ 43, 44, 45, 46, 47, 48, 49, 50, 51, 52,
+ 15, 0, 0, 17, 0, 116, 20, 0, 21, 22,
23, 24, 25, 26, 27, 28, 29, 30, 31, 32,
- 33, 3, 34, 35, 36, 37, 38, 39, 40, 41,
- 42, 43, 44, 45, 0, 0, 0, 0, 0, 6,
- 0, 0, 8, 0, 150, 11, 0, 83, 13, 14,
- 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
- 25, 26, 27, 28, 29, 30, 31, 32, 33, 3,
- 34, 35, 36, 37, 38, 39, 40, 41, 42, 43,
- 44, 45, 0, 0, 0, 0, 0, 6, 0, 0,
- 8, 0, 160, 11, 0, 83, 13, 14, 15, 16,
- 17, 18, 19, 20, 21, 22, 23, 24, 25, 26,
- 27, 28, 29, 30, 31, 32, 33, 3, 34, 35,
- 36, 37, 38, 39, 40, 41, 42, 43, 44, 45,
- 0, 0, 0, 0, 0, 6, 0, 0, 8, 0,
- 165, 11, 0, 83, 13, 14, 15, 16, 17, 18,
- 19, 20, 21, 22, 23, 24, 25, 26, 27, 28,
- 29, 30, 31, 32, 33, 3, 34, 35, 36, 37,
- 38, 39, 40, 41, 42, 43, 44, 45, 0, 0,
- 0, 0, 0, 6, 0, 0, 8, 0, 169, 11,
- 0, 83, 13, 14, 15, 16, 17, 18, 19, 20,
+ 33, 34, 35, 36, 37, 38, 39, 40, 0, 41,
+ 42, 43, 44, 45, 46, 47, 48, 49, 50, 51,
+ 52, 15, 0, 0, 17, 0, 163, 20, 0, 21,
+ 22, 23, 24, 25, 26, 27, 28, 29, 30, 31,
+ 32, 33, 34, 35, 36, 37, 38, 39, 40, 0,
+ 41, 42, 43, 44, 45, 46, 47, 48, 49, 50,
+ 51, 52, 15, 0, 0, 17, 0, 0, 20, 0,
21, 22, 23, 24, 25, 26, 27, 28, 29, 30,
- 31, 32, 33, 3, 34, 35, 36, 37, 38, 39,
- 40, 41, 42, 43, 44, 45, 0, 0, 0, 0,
- 0, 6, 0, 0, 8, 0, 0, 11, 0, 83,
- 13, 14, 15, 16, 17, 18, 19, 20, 21, 22,
- 23, 24, 25, 26, 27, 28, 29, 30, 31, 32,
- 33, 0, 34, 35, 36, 37, 38, 39, 40, 41,
- 42, 43, 44, 45, 90, 0, 0, 0, 0, 0,
- 0, 91, 92, 93, 94, 95, 96, 97, 98, 99,
- 100, 101, 102, 103, 104, 105, 106, 107, 108, 125,
- 0, 0, 0, 0, 0, 0, 91, 92, 93, 94,
- 95, 96, 97, 98, 99, 100, 101, 102, 103, 104,
- 105, 106, 107, 108, 65, 0, 0, 66, 67, 68,
- 69, 70, 71, 72, 73, 74, 75, 76, 77, 0,
- 0, 0, 0, 0, 78, 92, 93, 94, 95, 96,
- 97, 98, 99, 100, 101, 102, 103, 104, 105, 106,
- 107, 108, 93, 94, 95, 96, 97, 98, 99, 100,
- 101, 102, 103, 104, 105, 106, 107, 108, 94, 95,
- 96, 97, 98, 99, 100, 101, 102, 103, 104, 105,
- 106, 107, 108
+ 31, 32, 33, 34, 35, 36, 37, 38, 39, 40,
+ 0, 41, 42, 43, 44, 45, 46, 47, 48, 49,
+ 50, 51, 52, 97, 0, 0, 0, 0, 98, 99,
+ 100, 101, 102, 103, 104, 105, 106, 107, 108, 109,
+ 110, 111, 112, 113, 114, 115, 133, 0, 0, 0,
+ 0, 98, 99, 100, 101, 102, 103, 104, 105, 106,
+ 107, 108, 109, 110, 111, 112, 113, 114, 115, 98,
+ 99, 100, 101, 102, 103, 104, 105, 106, 107, 108,
+ 109, 110, 111, 112, 113, 114, 115, 0, 0, 136,
+ 99, 100, 101, 102, 103, 104, 105, 106, 107, 108,
+ 109, 110, 111, 112, 113, 114, 115, 100, 101, 102,
+ 103, 104, 105, 106, 107, 108, 109, 110, 111, 112,
+ 113, 114, 115, 101, 102, 103, 104, 105, 106, 107,
+ 108, 109, 110, 111, 112, 113, 114, 115, 102, 103,
+ 104, 105, 106, 107, 108, 109, 110, 111, 112, 113,
+ 114, 115, 103, 104, 105, 106, 107, 108, 109, 110,
+ 111, 112, 113, 114, 115, 105, 106, 107, 108, 109,
+ 110, 111, 112, 113, 114, 115
};
static const yytype_int16 yycheck[] =
{
- 1, 7, 52, 21, 9, 23, 24, 21, 23, 24,
+ 6, 1, 14, 168, 4, 16, 18, 24, 77, 19,
+ 175, 19, 22, 48, 24, 25, 24, 27, 28, 29,
+ 30, 31, 32, 33, 34, 35, 36, 37, 38, 39,
+ 40, 41, 42, 43, 44, 45, 46, 19, 48, 49,
+ 50, 51, 52, 53, 54, 55, 56, 57, 58, 59,
+ 19, 57, 63, 64, 65, 66, 67, 126, 24, 40,
+ 41, 42, 43, 44, 45, 46, 72, 49, 24, 21,
+ 22, 77, 24, 21, 22, 49, 82, 89, 52, 48,
+ 42, 43, 44, 45, 46, 85, 19, 98, 99, 100,
+ 101, 102, 103, 104, 105, 106, 107, 108, 109, 110,
+ 111, 112, 113, 114, 115, 19, 19, 19, 21, 22,
+ 44, 45, 46, 8, 9, 19, 24, 24, 24, 24,
+ 126, 49, 24, 129, 24, 24, 19, 127, 128, 42,
+ 43, 128, 24, 82, -1, 48, -1, 50, 51, -1,
+ -1, -1, -1, -1, -1, -1, -1, 0, -1, -1,
+ -1, 157, 5, 6, 7, 161, -1, 10, 11, 12,
+ 13, 14, 15, 16, 17, 18, 19, 20, -1, 22,
+ 23, 24, 25, -1, 27, 28, 29, 30, 31, 32,
33, 34, 35, 36, 37, 38, 39, 40, 41, 42,
- 43, 44, 45, 46, 47, 48, 49, 50, 46, 47,
- 53, 5, 173, 26, 52, 26, 54, 55, 179, 53,
- 40, 41, 42, 43, 44, 45, 46, 47, 48, 49,
- 50, 26, 58, 59, 60, 61, 62, 53, 21, 12,
- 56, 26, 112, 26, 26, 66, 46, 47, 48, 49,
- 50, 76, 7, 8, 124, 80, 77, 44, 45, 46,
- 47, 48, 49, 50, 26, 91, 92, 93, 94, 95,
- 96, 97, 98, 99, 100, 101, 102, 103, 104, 105,
- 106, 107, 108, 153, 23, 24, 156, 26, 48, 49,
- 50, 21, 21, 21, 164, 26, 117, 167, 52, 120,
- 37, 38, 39, 40, 41, 42, 43, 44, 45, 46,
- 47, 48, 49, 50, 0, 26, 26, 3, 4, 5,
- 38, 39, 40, 41, 42, 43, 44, 45, 46, 47,
- 48, 49, 50, 154, 155, 21, 22, 26, 24, 25,
- 26, 27, 26, 29, 30, 31, 32, 33, 34, 35,
- 36, 37, 38, 39, 40, 41, 42, 43, 44, 45,
- 46, 47, 48, 49, 50, 3, 52, 53, 54, 55,
- 56, 57, 58, 59, 60, 61, 62, 63, 26, 26,
- 21, 26, -1, 21, 155, -1, 24, -1, 26, 27,
- -1, 29, 30, 31, 32, 33, 34, 35, 36, 37,
- 38, 39, 40, 41, 42, 43, 44, 45, 46, 47,
- 48, 49, 50, 3, 52, 53, 54, 55, 56, 57,
- 58, 59, 60, 61, 62, 63, -1, -1, -1, -1,
- -1, 21, -1, -1, 24, -1, 26, 27, -1, 29,
+ 43, 44, 45, 46, 4, 48, 49, 50, 51, 52,
+ 53, 54, 55, 56, 57, 58, 59, -1, -1, 19,
+ -1, -1, 22, -1, 24, 25, -1, 27, 28, 29,
30, 31, 32, 33, 34, 35, 36, 37, 38, 39,
- 40, 41, 42, 43, 44, 45, 46, 47, 48, 49,
- 50, 3, 52, 53, 54, 55, 56, 57, 58, 59,
- 60, 61, 62, 63, -1, -1, -1, -1, -1, 21,
- -1, -1, 24, -1, 26, 27, -1, 29, 30, 31,
- 32, 33, 34, 35, 36, 37, 38, 39, 40, 41,
- 42, 43, 44, 45, 46, 47, 48, 49, 50, 3,
- 52, 53, 54, 55, 56, 57, 58, 59, 60, 61,
- 62, 63, -1, -1, -1, -1, -1, 21, -1, -1,
- 24, -1, 26, 27, -1, 29, 30, 31, 32, 33,
+ 40, 41, 42, 43, 44, 45, 46, 4, 48, 49,
+ 50, 51, 52, 53, 54, 55, 56, 57, 58, 59,
+ -1, -1, 19, -1, -1, 22, -1, 24, 25, -1,
+ 27, 28, 29, 30, 31, 32, 33, 34, 35, 36,
+ 37, 38, 39, 40, 41, 42, 43, 44, 45, 46,
+ 4, 48, 49, 50, 51, 52, 53, 54, 55, 56,
+ 57, 58, 59, -1, -1, 19, -1, -1, 22, -1,
+ 24, 25, -1, 27, 28, 29, 30, 31, 32, 33,
34, 35, 36, 37, 38, 39, 40, 41, 42, 43,
- 44, 45, 46, 47, 48, 49, 50, 3, 52, 53,
- 54, 55, 56, 57, 58, 59, 60, 61, 62, 63,
- -1, -1, -1, -1, -1, 21, -1, -1, 24, -1,
- 26, 27, -1, 29, 30, 31, 32, 33, 34, 35,
- 36, 37, 38, 39, 40, 41, 42, 43, 44, 45,
- 46, 47, 48, 49, 50, 3, 52, 53, 54, 55,
- 56, 57, 58, 59, 60, 61, 62, 63, -1, -1,
- -1, -1, -1, 21, -1, -1, 24, -1, 26, 27,
- -1, 29, 30, 31, 32, 33, 34, 35, 36, 37,
- 38, 39, 40, 41, 42, 43, 44, 45, 46, 47,
- 48, 49, 50, 3, 52, 53, 54, 55, 56, 57,
- 58, 59, 60, 61, 62, 63, -1, -1, -1, -1,
- -1, 21, -1, -1, 24, -1, -1, 27, -1, 29,
+ 44, 45, 46, 4, 48, 49, 50, 51, 52, 53,
+ 54, 55, 56, 57, 58, 59, -1, -1, 19, -1,
+ -1, 22, -1, -1, 25, -1, 27, 28, 29, 30,
+ 31, 32, 33, 34, 35, 36, 37, 38, 39, 40,
+ 41, 42, 43, 44, 45, 46, -1, 48, 49, 50,
+ 51, 52, 53, 54, 55, 56, 57, 58, 59, 19,
+ -1, -1, 22, -1, 24, 25, -1, 27, 28, 29,
30, 31, 32, 33, 34, 35, 36, 37, 38, 39,
- 40, 41, 42, 43, 44, 45, 46, 47, 48, 49,
- 50, -1, 52, 53, 54, 55, 56, 57, 58, 59,
- 60, 61, 62, 63, 26, -1, -1, -1, -1, -1,
- -1, 33, 34, 35, 36, 37, 38, 39, 40, 41,
- 42, 43, 44, 45, 46, 47, 48, 49, 50, 26,
- -1, -1, -1, -1, -1, -1, 33, 34, 35, 36,
+ 40, 41, 42, 43, 44, 45, 46, -1, 48, 49,
+ 50, 51, 52, 53, 54, 55, 56, 57, 58, 59,
+ 19, -1, -1, 22, -1, 24, 25, -1, 27, 28,
+ 29, 30, 31, 32, 33, 34, 35, 36, 37, 38,
+ 39, 40, 41, 42, 43, 44, 45, 46, -1, 48,
+ 49, 50, 51, 52, 53, 54, 55, 56, 57, 58,
+ 59, 19, -1, -1, 22, -1, 24, 25, -1, 27,
+ 28, 29, 30, 31, 32, 33, 34, 35, 36, 37,
+ 38, 39, 40, 41, 42, 43, 44, 45, 46, -1,
+ 48, 49, 50, 51, 52, 53, 54, 55, 56, 57,
+ 58, 59, 19, -1, -1, 22, -1, -1, 25, -1,
+ 27, 28, 29, 30, 31, 32, 33, 34, 35, 36,
37, 38, 39, 40, 41, 42, 43, 44, 45, 46,
- 47, 48, 49, 50, 6, -1, -1, 9, 10, 11,
- 12, 13, 14, 15, 16, 17, 18, 19, 20, -1,
- -1, -1, -1, -1, 26, 34, 35, 36, 37, 38,
- 39, 40, 41, 42, 43, 44, 45, 46, 47, 48,
- 49, 50, 35, 36, 37, 38, 39, 40, 41, 42,
- 43, 44, 45, 46, 47, 48, 49, 50, 36, 37,
- 38, 39, 40, 41, 42, 43, 44, 45, 46, 47,
- 48, 49, 50
+ -1, 48, 49, 50, 51, 52, 53, 54, 55, 56,
+ 57, 58, 59, 24, -1, -1, -1, -1, 29, 30,
+ 31, 32, 33, 34, 35, 36, 37, 38, 39, 40,
+ 41, 42, 43, 44, 45, 46, 24, -1, -1, -1,
+ -1, 29, 30, 31, 32, 33, 34, 35, 36, 37,
+ 38, 39, 40, 41, 42, 43, 44, 45, 46, 29,
+ 30, 31, 32, 33, 34, 35, 36, 37, 38, 39,
+ 40, 41, 42, 43, 44, 45, 46, -1, -1, 49,
+ 30, 31, 32, 33, 34, 35, 36, 37, 38, 39,
+ 40, 41, 42, 43, 44, 45, 46, 31, 32, 33,
+ 34, 35, 36, 37, 38, 39, 40, 41, 42, 43,
+ 44, 45, 46, 32, 33, 34, 35, 36, 37, 38,
+ 39, 40, 41, 42, 43, 44, 45, 46, 33, 34,
+ 35, 36, 37, 38, 39, 40, 41, 42, 43, 44,
+ 45, 46, 34, 35, 36, 37, 38, 39, 40, 41,
+ 42, 43, 44, 45, 46, 36, 37, 38, 39, 40,
+ 41, 42, 43, 44, 45, 46
};
/* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
symbol of state STATE-NUM. */
static const yytype_uint8 yystos[] =
{
- 0, 65, 0, 3, 4, 5, 21, 22, 24, 25,
- 26, 27, 29, 30, 31, 32, 33, 34, 35, 36,
- 37, 38, 39, 40, 41, 42, 43, 44, 45, 46,
- 47, 48, 49, 50, 52, 53, 54, 55, 56, 57,
- 58, 59, 60, 61, 62, 63, 66, 67, 69, 71,
- 79, 83, 86, 87, 88, 21, 23, 24, 46, 47,
- 52, 54, 55, 80, 81, 6, 9, 10, 11, 12,
- 13, 14, 15, 16, 17, 18, 19, 20, 26, 81,
- 80, 69, 26, 29, 87, 81, 81, 81, 81, 81,
- 26, 33, 34, 35, 36, 37, 38, 39, 40, 41,
- 42, 43, 44, 45, 46, 47, 48, 49, 50, 26,
- 72, 26, 86, 77, 78, 26, 26, 74, 75, 76,
- 70, 26, 73, 80, 86, 26, 26, 80, 53, 81,
- 81, 81, 81, 81, 81, 81, 81, 81, 81, 81,
- 81, 81, 81, 81, 81, 81, 81, 7, 8, 68,
- 26, 26, 26, 86, 21, 21, 86, 21, 21, 26,
- 26, 26, 52, 84, 86, 26, 85, 86, 85, 26,
- 26, 26, 21, 53, 82, 26, 26, 26, 84, 53,
- 56, 26, 84, 21, 26
+ 0, 61, 0, 5, 6, 7, 10, 11, 12, 13,
+ 14, 15, 16, 17, 18, 19, 20, 22, 23, 24,
+ 25, 27, 28, 29, 30, 31, 32, 33, 34, 35,
+ 36, 37, 38, 39, 40, 41, 42, 43, 44, 45,
+ 46, 48, 49, 50, 51, 52, 53, 54, 55, 56,
+ 57, 58, 59, 62, 64, 66, 77, 83, 84, 85,
+ 19, 21, 22, 42, 43, 48, 50, 51, 74, 75,
+ 24, 78, 83, 67, 4, 24, 81, 82, 84, 72,
+ 73, 24, 69, 70, 71, 63, 68, 74, 75, 74,
+ 24, 84, 75, 75, 75, 75, 75, 24, 29, 30,
+ 31, 32, 33, 34, 35, 36, 37, 38, 39, 40,
+ 41, 42, 43, 44, 45, 46, 24, 8, 9, 65,
+ 19, 48, 24, 81, 24, 24, 82, 19, 19, 83,
+ 19, 19, 24, 24, 24, 74, 49, 75, 75, 75,
+ 75, 75, 75, 75, 75, 75, 75, 75, 75, 75,
+ 75, 75, 75, 75, 75, 48, 79, 83, 19, 24,
+ 80, 83, 80, 24, 24, 24, 24, 19, 49, 76,
+ 24, 49, 24, 24, 79, 49, 52, 24, 79, 19,
+ 24
};
/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
static const yytype_uint8 yyr1[] =
{
- 0, 64, 65, 65, 66, 66, 66, 66, 67, 67,
- 67, 67, 68, 68, 68, 69, 69, 70, 69, 72,
- 71, 73, 71, 74, 71, 71, 75, 71, 76, 71,
- 71, 71, 77, 71, 78, 71, 71, 71, 71, 71,
- 79, 79, 79, 80, 80, 81, 81, 81, 81, 81,
- 81, 81, 81, 81, 81, 81, 81, 81, 81, 81,
- 81, 81, 81, 81, 81, 81, 81, 81, 81, 81,
- 82, 82, 83, 83, 84, 84, 85, 85, 86, 86,
- 87, 87, 87, 87, 87, 87, 88, 88, 88, 88,
- 88, 88, 88, 88, 88, 88, 88, 88, 88, 88,
- 88, 88, 88, 88, 88, 88, 88, 88, 88, 88,
- 88, 88, 88, 88, 88, 88, 88, 88, 88
+ 0, 60, 61, 61, 62, 63, 62, 62, 62, 62,
+ 64, 64, 64, 64, 65, 65, 65, 67, 66, 68,
+ 66, 69, 66, 66, 70, 66, 71, 66, 66, 66,
+ 72, 66, 73, 66, 66, 66, 66, 74, 74, 75,
+ 75, 75, 75, 75, 75, 75, 75, 75, 75, 75,
+ 75, 75, 75, 75, 75, 75, 75, 75, 75, 75,
+ 75, 75, 75, 75, 76, 76, 77, 77, 78, 79,
+ 79, 80, 80, 81, 81, 81, 82, 82, 83, 83,
+ 84, 84, 84, 84, 84, 85, 85, 85, 85, 85,
+ 85, 85, 85, 85, 85, 85, 85, 85, 85, 85,
+ 85, 85, 85, 85, 85, 85, 85, 85, 85, 85,
+ 85, 85, 85, 85, 85, 85
};
/* YYR2[YYN] -- Number of symbols on the right hand side of rule YYN. */
static const yytype_uint8 yyr2[] =
{
- 0, 2, 0, 2, 1, 2, 1, 1, 3, 3,
- 3, 4, 3, 5, 6, 1, 1, 0, 5, 0,
- 4, 0, 5, 0, 5, 3, 0, 6, 0, 6,
- 4, 3, 0, 4, 0, 4, 4, 5, 2, 3,
- 3, 3, 4, 1, 1, 1, 1, 3, 3, 3,
- 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
- 3, 3, 3, 3, 3, 2, 2, 2, 2, 3,
- 1, 3, 1, 2, 0, 1, 0, 1, 1, 2,
+ 0, 2, 0, 2, 1, 0, 4, 1, 1, 2,
+ 3, 3, 3, 4, 3, 5, 6, 0, 3, 0,
+ 4, 0, 4, 2, 0, 5, 0, 5, 3, 2,
+ 0, 3, 0, 3, 3, 4, 2, 1, 1, 1,
+ 1, 3, 3, 3, 3, 3, 3, 3, 3, 3,
+ 3, 3, 3, 3, 3, 3, 3, 3, 3, 2,
+ 2, 2, 2, 3, 1, 3, 1, 2, 2, 0,
+ 1, 0, 1, 2, 4, 1, 1, 2, 1, 2,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1
+ 1, 1, 1, 1, 1, 1
};
@@ -1555,7 +1548,7 @@ YYLTYPE yylloc = yyloc_default;
yychar = YYEMPTY; /* Cause a token to be read. */
/* User initialization code. */
-#line 165 "glcpp/glcpp-parse.y" /* yacc.c:1429 */
+#line 155 "glcpp/glcpp-parse.y" /* yacc.c:1429 */
{
yylloc.first_line = 1;
yylloc.first_column = 1;
@@ -1564,7 +1557,7 @@ YYLTYPE yylloc = yyloc_default;
yylloc.source = 0;
}
-#line 1568 "glcpp/glcpp-parse.c" /* yacc.c:1429 */
+#line 1561 "glcpp/glcpp-parse.c" /* yacc.c:1429 */
yylsp[0] = yylloc;
goto yysetstate;
@@ -1750,38 +1743,64 @@ yyreduce:
YY_REDUCE_PRINT (yyn);
switch (yyn)
{
- case 6:
-#line 213 "glcpp/glcpp-parse.y" /* yacc.c:1646 */
+ case 4:
+#line 194 "glcpp/glcpp-parse.y" /* yacc.c:1646 */
+ {
+ ralloc_asprintf_rewrite_tail (&parser->output, &parser->output_length, "\n");
+ }
+#line 1752 "glcpp/glcpp-parse.c" /* yacc.c:1646 */
+ break;
+
+ case 5:
+#line 197 "glcpp/glcpp-parse.y" /* yacc.c:1646 */
+ {
+ glcpp_parser_resolve_implicit_version(parser);
+ }
+#line 1760 "glcpp/glcpp-parse.c" /* yacc.c:1646 */
+ break;
+
+ case 6:
+#line 199 "glcpp/glcpp-parse.y" /* yacc.c:1646 */
+ {
+
+ if (parser->skip_stack == NULL ||
+ parser->skip_stack->type == SKIP_NO_SKIP)
+ {
+ _glcpp_parser_expand_and_lex_from (parser,
+ LINE_EXPANDED, (yyvsp[-1].token_list));
+ }
+ }
+#line 1774 "glcpp/glcpp-parse.c" /* yacc.c:1646 */
+ break;
+
+ case 7:
+#line 208 "glcpp/glcpp-parse.y" /* yacc.c:1646 */
{
_glcpp_parser_print_expanded_token_list (parser, (yyvsp[0].token_list));
ralloc_asprintf_rewrite_tail (&parser->output, &parser->output_length, "\n");
ralloc_free ((yyvsp[0].token_list));
}
-#line 1761 "glcpp/glcpp-parse.c" /* yacc.c:1646 */
+#line 1784 "glcpp/glcpp-parse.c" /* yacc.c:1646 */
break;
- case 8:
-#line 222 "glcpp/glcpp-parse.y" /* yacc.c:1646 */
+ case 10:
+#line 218 "glcpp/glcpp-parse.y" /* yacc.c:1646 */
{
- if (parser->is_gles && (yyvsp[-1].expression_value).undefined_macro)
- glcpp_error(& (yylsp[-2]), parser, "undefined macro %s in expression (illegal in GLES)", (yyvsp[-1].expression_value).undefined_macro);
- _glcpp_parser_skip_stack_push_if (parser, & (yylsp[-2]), (yyvsp[-1].expression_value).value);
+ _glcpp_parser_skip_stack_push_if (parser, & (yylsp[-2]), (yyvsp[-1].ival));
}
-#line 1771 "glcpp/glcpp-parse.c" /* yacc.c:1646 */
+#line 1792 "glcpp/glcpp-parse.c" /* yacc.c:1646 */
break;
- case 9:
-#line 227 "glcpp/glcpp-parse.y" /* yacc.c:1646 */
+ case 11:
+#line 221 "glcpp/glcpp-parse.y" /* yacc.c:1646 */
{
- if (parser->is_gles && (yyvsp[-1].expression_value).undefined_macro)
- glcpp_error(& (yylsp[-2]), parser, "undefined macro %s in expression (illegal in GLES)", (yyvsp[-1].expression_value).undefined_macro);
- _glcpp_parser_skip_stack_change_if (parser, & (yylsp[-2]), "elif", (yyvsp[-1].expression_value).value);
+ _glcpp_parser_skip_stack_change_if (parser, & (yylsp[-2]), "elif", (yyvsp[-1].ival));
}
-#line 1781 "glcpp/glcpp-parse.c" /* yacc.c:1646 */
+#line 1800 "glcpp/glcpp-parse.c" /* yacc.c:1646 */
break;
- case 10:
-#line 232 "glcpp/glcpp-parse.y" /* yacc.c:1646 */
+ case 12:
+#line 224 "glcpp/glcpp-parse.y" /* yacc.c:1646 */
{
parser->has_new_line_number = 1;
parser->new_line_number = (yyvsp[-1].ival);
@@ -1790,11 +1809,11 @@ yyreduce:
"#line %" PRIiMAX "\n",
(yyvsp[-1].ival));
}
-#line 1794 "glcpp/glcpp-parse.c" /* yacc.c:1646 */
+#line 1813 "glcpp/glcpp-parse.c" /* yacc.c:1646 */
break;
- case 11:
-#line 240 "glcpp/glcpp-parse.y" /* yacc.c:1646 */
+ case 13:
+#line 232 "glcpp/glcpp-parse.y" /* yacc.c:1646 */
{
parser->has_new_line_number = 1;
parser->new_line_number = (yyvsp[-2].ival);
@@ -1805,110 +1824,72 @@ yyreduce:
"#line %" PRIiMAX " %" PRIiMAX "\n",
(yyvsp[-2].ival), (yyvsp[-1].ival));
}
-#line 1809 "glcpp/glcpp-parse.c" /* yacc.c:1646 */
+#line 1828 "glcpp/glcpp-parse.c" /* yacc.c:1646 */
break;
- case 12:
-#line 253 "glcpp/glcpp-parse.y" /* yacc.c:1646 */
+ case 14:
+#line 245 "glcpp/glcpp-parse.y" /* yacc.c:1646 */
{
_define_object_macro (parser, & (yylsp[-2]), (yyvsp[-2].str), (yyvsp[-1].token_list));
}
-#line 1817 "glcpp/glcpp-parse.c" /* yacc.c:1646 */
+#line 1836 "glcpp/glcpp-parse.c" /* yacc.c:1646 */
break;
- case 13:
-#line 256 "glcpp/glcpp-parse.y" /* yacc.c:1646 */
+ case 15:
+#line 248 "glcpp/glcpp-parse.y" /* yacc.c:1646 */
{
_define_function_macro (parser, & (yylsp[-4]), (yyvsp[-4].str), NULL, (yyvsp[-1].token_list));
}
-#line 1825 "glcpp/glcpp-parse.c" /* yacc.c:1646 */
+#line 1844 "glcpp/glcpp-parse.c" /* yacc.c:1646 */
break;
- case 14:
-#line 259 "glcpp/glcpp-parse.y" /* yacc.c:1646 */
+ case 16:
+#line 251 "glcpp/glcpp-parse.y" /* yacc.c:1646 */
{
_define_function_macro (parser, & (yylsp[-5]), (yyvsp[-5].str), (yyvsp[-3].string_list), (yyvsp[-1].token_list));
}
-#line 1833 "glcpp/glcpp-parse.c" /* yacc.c:1646 */
- break;
-
- case 15:
-#line 265 "glcpp/glcpp-parse.y" /* yacc.c:1646 */
- {
- ralloc_asprintf_rewrite_tail (&parser->output, &parser->output_length, "\n");
- }
-#line 1841 "glcpp/glcpp-parse.c" /* yacc.c:1646 */
+#line 1852 "glcpp/glcpp-parse.c" /* yacc.c:1646 */
break;
case 17:
-#line 269 "glcpp/glcpp-parse.y" /* yacc.c:1646 */
+#line 257 "glcpp/glcpp-parse.y" /* yacc.c:1646 */
{
glcpp_parser_resolve_implicit_version(parser);
}
-#line 1849 "glcpp/glcpp-parse.c" /* yacc.c:1646 */
- break;
-
- case 18:
-#line 271 "glcpp/glcpp-parse.y" /* yacc.c:1646 */
- {
-
- if (parser->skip_stack == NULL ||
- parser->skip_stack->type == SKIP_NO_SKIP)
- {
- _glcpp_parser_expand_and_lex_from (parser,
- LINE_EXPANDED, (yyvsp[-1].token_list),
- EXPANSION_MODE_IGNORE_DEFINED);
- }
- }
-#line 1864 "glcpp/glcpp-parse.c" /* yacc.c:1646 */
+#line 1860 "glcpp/glcpp-parse.c" /* yacc.c:1646 */
break;
case 19:
-#line 284 "glcpp/glcpp-parse.y" /* yacc.c:1646 */
+#line 260 "glcpp/glcpp-parse.y" /* yacc.c:1646 */
{
glcpp_parser_resolve_implicit_version(parser);
}
-#line 1872 "glcpp/glcpp-parse.c" /* yacc.c:1646 */
+#line 1868 "glcpp/glcpp-parse.c" /* yacc.c:1646 */
break;
- case 21:
-#line 287 "glcpp/glcpp-parse.y" /* yacc.c:1646 */
+ case 20:
+#line 262 "glcpp/glcpp-parse.y" /* yacc.c:1646 */
{
- glcpp_parser_resolve_implicit_version(parser);
- }
-#line 1880 "glcpp/glcpp-parse.c" /* yacc.c:1646 */
- break;
-
- case 22:
-#line 289 "glcpp/glcpp-parse.y" /* yacc.c:1646 */
- {
- macro_t *macro;
- if (strcmp("__LINE__", (yyvsp[-1].str)) == 0
- || strcmp("__FILE__", (yyvsp[-1].str)) == 0
- || strcmp("__VERSION__", (yyvsp[-1].str)) == 0)
- glcpp_error(& (yylsp[-4]), parser, "Built-in (pre-defined)"
- " macro names can not be undefined.");
-
- macro = hash_table_find (parser->defines, (yyvsp[-1].str));
+ macro_t *macro = hash_table_find (parser->defines, (yyvsp[-1].str));
if (macro) {
hash_table_remove (parser->defines, (yyvsp[-1].str));
ralloc_free (macro);
}
ralloc_free ((yyvsp[-1].str));
}
-#line 1900 "glcpp/glcpp-parse.c" /* yacc.c:1646 */
+#line 1881 "glcpp/glcpp-parse.c" /* yacc.c:1646 */
break;
- case 23:
-#line 304 "glcpp/glcpp-parse.y" /* yacc.c:1646 */
+ case 21:
+#line 270 "glcpp/glcpp-parse.y" /* yacc.c:1646 */
{
glcpp_parser_resolve_implicit_version(parser);
}
-#line 1908 "glcpp/glcpp-parse.c" /* yacc.c:1646 */
+#line 1889 "glcpp/glcpp-parse.c" /* yacc.c:1646 */
break;
- case 24:
-#line 306 "glcpp/glcpp-parse.y" /* yacc.c:1646 */
+ case 22:
+#line 272 "glcpp/glcpp-parse.y" /* yacc.c:1646 */
{
/* Be careful to only evaluate the 'if' expression if
* we are not skipping. When we are skipping, we
@@ -1921,71 +1902,70 @@ yyreduce:
parser->skip_stack->type == SKIP_NO_SKIP)
{
_glcpp_parser_expand_and_lex_from (parser,
- IF_EXPANDED, (yyvsp[-1].token_list),
- EXPANSION_MODE_EVALUATE_DEFINED);
+ IF_EXPANDED, (yyvsp[-1].token_list));
}
else
{
- _glcpp_parser_skip_stack_push_if (parser, & (yylsp[-4]), 0);
+ _glcpp_parser_skip_stack_push_if (parser, & (yylsp[-3]), 0);
parser->skip_stack->type = SKIP_TO_ENDIF;
}
}
-#line 1934 "glcpp/glcpp-parse.c" /* yacc.c:1646 */
+#line 1914 "glcpp/glcpp-parse.c" /* yacc.c:1646 */
break;
- case 25:
-#line 327 "glcpp/glcpp-parse.y" /* yacc.c:1646 */
+ case 23:
+#line 292 "glcpp/glcpp-parse.y" /* yacc.c:1646 */
{
/* #if without an expression is only an error if we
* are not skipping */
if (parser->skip_stack == NULL ||
parser->skip_stack->type == SKIP_NO_SKIP)
{
- glcpp_error(& (yylsp[-2]), parser, "#if with no expression");
+ glcpp_error(& (yylsp[-1]), parser, "#if with no expression");
}
- _glcpp_parser_skip_stack_push_if (parser, & (yylsp[-2]), 0);
+ _glcpp_parser_skip_stack_push_if (parser, & (yylsp[-1]), 0);
}
-#line 1949 "glcpp/glcpp-parse.c" /* yacc.c:1646 */
+#line 1929 "glcpp/glcpp-parse.c" /* yacc.c:1646 */
break;
- case 26:
-#line 337 "glcpp/glcpp-parse.y" /* yacc.c:1646 */
+ case 24:
+#line 302 "glcpp/glcpp-parse.y" /* yacc.c:1646 */
{
glcpp_parser_resolve_implicit_version(parser);
}
-#line 1957 "glcpp/glcpp-parse.c" /* yacc.c:1646 */
+#line 1937 "glcpp/glcpp-parse.c" /* yacc.c:1646 */
break;
- case 27:
-#line 339 "glcpp/glcpp-parse.y" /* yacc.c:1646 */
+ case 25:
+#line 304 "glcpp/glcpp-parse.y" /* yacc.c:1646 */
{
macro_t *macro = hash_table_find (parser->defines, (yyvsp[-2].str));
ralloc_free ((yyvsp[-2].str));
- _glcpp_parser_skip_stack_push_if (parser, & (yylsp[-5]), macro != NULL);
+ _glcpp_parser_skip_stack_push_if (parser, & (yylsp[-4]), macro != NULL);
}
-#line 1967 "glcpp/glcpp-parse.c" /* yacc.c:1646 */
+#line 1947 "glcpp/glcpp-parse.c" /* yacc.c:1646 */
break;
- case 28:
-#line 344 "glcpp/glcpp-parse.y" /* yacc.c:1646 */
+ case 26:
+#line 309 "glcpp/glcpp-parse.y" /* yacc.c:1646 */
{
glcpp_parser_resolve_implicit_version(parser);
}
-#line 1975 "glcpp/glcpp-parse.c" /* yacc.c:1646 */
+#line 1955 "glcpp/glcpp-parse.c" /* yacc.c:1646 */
break;
- case 29:
-#line 346 "glcpp/glcpp-parse.y" /* yacc.c:1646 */
+ case 27:
+#line 311 "glcpp/glcpp-parse.y" /* yacc.c:1646 */
{
macro_t *macro = hash_table_find (parser->defines, (yyvsp[-2].str));
ralloc_free ((yyvsp[-2].str));
_glcpp_parser_skip_stack_push_if (parser, & (yylsp[-3]), macro == NULL);
}
-#line 1985 "glcpp/glcpp-parse.c" /* yacc.c:1646 */
+#line 1965 "glcpp/glcpp-parse.c" /* yacc.c:1646 */
break;
- case 30:
-#line 351 "glcpp/glcpp-parse.y" /* yacc.c:1646 */
+ case 28:
+#line 316 "glcpp/glcpp-parse.y" /* yacc.c:1646 */
{
/* Be careful to only evaluate the 'elif' expression
* if we are not skipping. When we are skipping, we
@@ -1998,776 +1978,665 @@ yyreduce:
parser->skip_stack->type == SKIP_TO_ELSE)
{
_glcpp_parser_expand_and_lex_from (parser,
- ELIF_EXPANDED, (yyvsp[-1].token_list),
- EXPANSION_MODE_EVALUATE_DEFINED);
+ ELIF_EXPANDED, (yyvsp[-1].token_list));
}
else if (parser->skip_stack &&
parser->skip_stack->has_else)
{
- glcpp_error(& (yylsp[-3]), parser, "#elif after #else");
+ glcpp_error(& (yylsp[-2]), parser, "#elif after #else");
}
else
{
- _glcpp_parser_skip_stack_change_if (parser, & (yylsp[-3]),
+ _glcpp_parser_skip_stack_change_if (parser, & (yylsp[-2]),
"elif", 0);
}
}
-#line 2016 "glcpp/glcpp-parse.c" /* yacc.c:1646 */
+#line 1995 "glcpp/glcpp-parse.c" /* yacc.c:1646 */
break;
- case 31:
-#line 377 "glcpp/glcpp-parse.y" /* yacc.c:1646 */
+ case 29:
+#line 341 "glcpp/glcpp-parse.y" /* yacc.c:1646 */
{
/* #elif without an expression is an error unless we
* are skipping. */
if (parser->skip_stack &&
parser->skip_stack->type == SKIP_TO_ELSE)
{
- glcpp_error(& (yylsp[-2]), parser, "#elif with no expression");
+ glcpp_error(& (yylsp[-1]), parser, "#elif with no expression");
}
else if (parser->skip_stack &&
parser->skip_stack->has_else)
{
- glcpp_error(& (yylsp[-2]), parser, "#elif after #else");
+ glcpp_error(& (yylsp[-1]), parser, "#elif after #else");
}
else
{
- _glcpp_parser_skip_stack_change_if (parser, & (yylsp[-2]),
+ _glcpp_parser_skip_stack_change_if (parser, & (yylsp[-1]),
"elif", 0);
- glcpp_warning(& (yylsp[-2]), parser, "ignoring illegal #elif without expression");
+ glcpp_warning(& (yylsp[-1]), parser, "ignoring illegal #elif without expression");
}
}
-#line 2041 "glcpp/glcpp-parse.c" /* yacc.c:1646 */
+#line 2020 "glcpp/glcpp-parse.c" /* yacc.c:1646 */
break;
- case 32:
-#line 397 "glcpp/glcpp-parse.y" /* yacc.c:1646 */
- { parser->lexing_directive = 1; }
-#line 2047 "glcpp/glcpp-parse.c" /* yacc.c:1646 */
- break;
-
- case 33:
-#line 397 "glcpp/glcpp-parse.y" /* yacc.c:1646 */
+ case 30:
+#line 361 "glcpp/glcpp-parse.y" /* yacc.c:1646 */
{
if (parser->skip_stack &&
parser->skip_stack->has_else)
{
- glcpp_error(& (yylsp[-3]), parser, "multiple #else");
+ glcpp_error(& (yylsp[0]), parser, "multiple #else");
}
else
{
- _glcpp_parser_skip_stack_change_if (parser, & (yylsp[-3]), "else", 1);
+ _glcpp_parser_skip_stack_change_if (parser, & (yylsp[0]), "else", 1);
if (parser->skip_stack)
parser->skip_stack->has_else = true;
}
}
-#line 2065 "glcpp/glcpp-parse.c" /* yacc.c:1646 */
+#line 2038 "glcpp/glcpp-parse.c" /* yacc.c:1646 */
break;
- case 34:
-#line 410 "glcpp/glcpp-parse.y" /* yacc.c:1646 */
+ case 32:
+#line 374 "glcpp/glcpp-parse.y" /* yacc.c:1646 */
{
- _glcpp_parser_skip_stack_pop (parser, & (yylsp[-1]));
+ _glcpp_parser_skip_stack_pop (parser, & (yylsp[0]));
}
-#line 2073 "glcpp/glcpp-parse.c" /* yacc.c:1646 */
+#line 2046 "glcpp/glcpp-parse.c" /* yacc.c:1646 */
break;
- case 36:
-#line 413 "glcpp/glcpp-parse.y" /* yacc.c:1646 */
+ case 34:
+#line 377 "glcpp/glcpp-parse.y" /* yacc.c:1646 */
{
if (parser->version_resolved) {
- glcpp_error(& (yylsp[-3]), parser, "#version must appear on the first line");
+ glcpp_error(& (yylsp[-2]), parser, "#version must appear on the first line");
}
_glcpp_parser_handle_version_declaration(parser, (yyvsp[-1].ival), NULL, true);
}
-#line 2084 "glcpp/glcpp-parse.c" /* yacc.c:1646 */
+#line 2057 "glcpp/glcpp-parse.c" /* yacc.c:1646 */
break;
- case 37:
-#line 419 "glcpp/glcpp-parse.y" /* yacc.c:1646 */
+ case 35:
+#line 383 "glcpp/glcpp-parse.y" /* yacc.c:1646 */
{
if (parser->version_resolved) {
- glcpp_error(& (yylsp[-4]), parser, "#version must appear on the first line");
+ glcpp_error(& (yylsp[-3]), parser, "#version must appear on the first line");
}
_glcpp_parser_handle_version_declaration(parser, (yyvsp[-2].ival), (yyvsp[-1].str), true);
}
-#line 2095 "glcpp/glcpp-parse.c" /* yacc.c:1646 */
+#line 2068 "glcpp/glcpp-parse.c" /* yacc.c:1646 */
break;
- case 38:
-#line 425 "glcpp/glcpp-parse.y" /* yacc.c:1646 */
+ case 36:
+#line 389 "glcpp/glcpp-parse.y" /* yacc.c:1646 */
{
glcpp_parser_resolve_implicit_version(parser);
}
-#line 2103 "glcpp/glcpp-parse.c" /* yacc.c:1646 */
+#line 2076 "glcpp/glcpp-parse.c" /* yacc.c:1646 */
break;
- case 39:
-#line 428 "glcpp/glcpp-parse.y" /* yacc.c:1646 */
+ case 37:
+#line 395 "glcpp/glcpp-parse.y" /* yacc.c:1646 */
{
- ralloc_asprintf_rewrite_tail (&parser->output, &parser->output_length, "#%s", (yyvsp[-1].str));
+ if (strlen ((yyvsp[0].str)) >= 3 && strncmp ((yyvsp[0].str), "0x", 2) == 0) {
+ (yyval.ival) = strtoll ((yyvsp[0].str) + 2, NULL, 16);
+ } else if ((yyvsp[0].str)[0] == '0') {
+ (yyval.ival) = strtoll ((yyvsp[0].str), NULL, 8);
+ } else {
+ (yyval.ival) = strtoll ((yyvsp[0].str), NULL, 10);
+ }
}
-#line 2111 "glcpp/glcpp-parse.c" /* yacc.c:1646 */
+#line 2090 "glcpp/glcpp-parse.c" /* yacc.c:1646 */
+ break;
+
+ case 38:
+#line 404 "glcpp/glcpp-parse.y" /* yacc.c:1646 */
+ {
+ (yyval.ival) = (yyvsp[0].ival);
+ }
+#line 2098 "glcpp/glcpp-parse.c" /* yacc.c:1646 */
break;
case 40:
-#line 434 "glcpp/glcpp-parse.y" /* yacc.c:1646 */
+#line 410 "glcpp/glcpp-parse.y" /* yacc.c:1646 */
{
- glcpp_error(& (yylsp[-2]), parser, "#%s", (yyvsp[-1].str));
+ if (parser->is_gles)
+ glcpp_error(& (yylsp[0]), parser, "undefined macro %s in expression (illegal in GLES)", (yyvsp[0].str));
+ (yyval.ival) = 0;
}
-#line 2119 "glcpp/glcpp-parse.c" /* yacc.c:1646 */
+#line 2108 "glcpp/glcpp-parse.c" /* yacc.c:1646 */
break;
case 41:
-#line 437 "glcpp/glcpp-parse.y" /* yacc.c:1646 */
+#line 415 "glcpp/glcpp-parse.y" /* yacc.c:1646 */
{
- glcpp_error (& (yylsp[-2]), parser, "#define without macro name");
+ (yyval.ival) = (yyvsp[-2].ival) || (yyvsp[0].ival);
}
-#line 2127 "glcpp/glcpp-parse.c" /* yacc.c:1646 */
+#line 2116 "glcpp/glcpp-parse.c" /* yacc.c:1646 */
break;
case 42:
-#line 440 "glcpp/glcpp-parse.y" /* yacc.c:1646 */
+#line 418 "glcpp/glcpp-parse.y" /* yacc.c:1646 */
{
- glcpp_error (& (yylsp[-3]), parser, "Illegal non-directive after #");
+ (yyval.ival) = (yyvsp[-2].ival) && (yyvsp[0].ival);
}
-#line 2135 "glcpp/glcpp-parse.c" /* yacc.c:1646 */
+#line 2124 "glcpp/glcpp-parse.c" /* yacc.c:1646 */
break;
case 43:
-#line 446 "glcpp/glcpp-parse.y" /* yacc.c:1646 */
+#line 421 "glcpp/glcpp-parse.y" /* yacc.c:1646 */
{
- if (strlen ((yyvsp[0].str)) >= 3 && strncmp ((yyvsp[0].str), "0x", 2) == 0) {
- (yyval.ival) = strtoll ((yyvsp[0].str) + 2, NULL, 16);
- } else if ((yyvsp[0].str)[0] == '0') {
- (yyval.ival) = strtoll ((yyvsp[0].str), NULL, 8);
- } else {
- (yyval.ival) = strtoll ((yyvsp[0].str), NULL, 10);
- }
+ (yyval.ival) = (yyvsp[-2].ival) | (yyvsp[0].ival);
}
-#line 2149 "glcpp/glcpp-parse.c" /* yacc.c:1646 */
+#line 2132 "glcpp/glcpp-parse.c" /* yacc.c:1646 */
break;
case 44:
-#line 455 "glcpp/glcpp-parse.y" /* yacc.c:1646 */
+#line 424 "glcpp/glcpp-parse.y" /* yacc.c:1646 */
{
- (yyval.ival) = (yyvsp[0].ival);
+ (yyval.ival) = (yyvsp[-2].ival) ^ (yyvsp[0].ival);
}
-#line 2157 "glcpp/glcpp-parse.c" /* yacc.c:1646 */
+#line 2140 "glcpp/glcpp-parse.c" /* yacc.c:1646 */
break;
case 45:
-#line 460 "glcpp/glcpp-parse.y" /* yacc.c:1646 */
+#line 427 "glcpp/glcpp-parse.y" /* yacc.c:1646 */
{
- (yyval.expression_value).value = (yyvsp[0].ival);
- (yyval.expression_value).undefined_macro = NULL;
+ (yyval.ival) = (yyvsp[-2].ival) & (yyvsp[0].ival);
}
-#line 2166 "glcpp/glcpp-parse.c" /* yacc.c:1646 */
+#line 2148 "glcpp/glcpp-parse.c" /* yacc.c:1646 */
break;
case 46:
-#line 464 "glcpp/glcpp-parse.y" /* yacc.c:1646 */
+#line 430 "glcpp/glcpp-parse.y" /* yacc.c:1646 */
{
- (yyval.expression_value).value = 0;
- if (parser->is_gles)
- (yyval.expression_value).undefined_macro = ralloc_strdup (parser, (yyvsp[0].str));
- else
- (yyval.expression_value).undefined_macro = NULL;
+ (yyval.ival) = (yyvsp[-2].ival) != (yyvsp[0].ival);
}
-#line 2178 "glcpp/glcpp-parse.c" /* yacc.c:1646 */
+#line 2156 "glcpp/glcpp-parse.c" /* yacc.c:1646 */
break;
case 47:
-#line 471 "glcpp/glcpp-parse.y" /* yacc.c:1646 */
+#line 433 "glcpp/glcpp-parse.y" /* yacc.c:1646 */
{
- (yyval.expression_value).value = (yyvsp[-2].expression_value).value || (yyvsp[0].expression_value).value;
-
- /* Short-circuit: Only flag undefined from right side
- * if left side evaluates to false.
- */
- if ((yyvsp[-2].expression_value).undefined_macro)
- (yyval.expression_value).undefined_macro = (yyvsp[-2].expression_value).undefined_macro;
- else if (! (yyvsp[-2].expression_value).value)
- (yyval.expression_value).undefined_macro = (yyvsp[0].expression_value).undefined_macro;
+ (yyval.ival) = (yyvsp[-2].ival) == (yyvsp[0].ival);
}
-#line 2194 "glcpp/glcpp-parse.c" /* yacc.c:1646 */
+#line 2164 "glcpp/glcpp-parse.c" /* yacc.c:1646 */
break;
case 48:
-#line 482 "glcpp/glcpp-parse.y" /* yacc.c:1646 */
+#line 436 "glcpp/glcpp-parse.y" /* yacc.c:1646 */
{
- (yyval.expression_value).value = (yyvsp[-2].expression_value).value && (yyvsp[0].expression_value).value;
-
- /* Short-circuit: Only flag undefined from right-side
- * if left side evaluates to true.
- */
- if ((yyvsp[-2].expression_value).undefined_macro)
- (yyval.expression_value).undefined_macro = (yyvsp[-2].expression_value).undefined_macro;
- else if ((yyvsp[-2].expression_value).value)
- (yyval.expression_value).undefined_macro = (yyvsp[0].expression_value).undefined_macro;
+ (yyval.ival) = (yyvsp[-2].ival) >= (yyvsp[0].ival);
}
-#line 2210 "glcpp/glcpp-parse.c" /* yacc.c:1646 */
+#line 2172 "glcpp/glcpp-parse.c" /* yacc.c:1646 */
break;
case 49:
-#line 493 "glcpp/glcpp-parse.y" /* yacc.c:1646 */
+#line 439 "glcpp/glcpp-parse.y" /* yacc.c:1646 */
{
- (yyval.expression_value).value = (yyvsp[-2].expression_value).value | (yyvsp[0].expression_value).value;
- if ((yyvsp[-2].expression_value).undefined_macro)
- (yyval.expression_value).undefined_macro = (yyvsp[-2].expression_value).undefined_macro;
- else
- (yyval.expression_value).undefined_macro = (yyvsp[0].expression_value).undefined_macro;
+ (yyval.ival) = (yyvsp[-2].ival) <= (yyvsp[0].ival);
}
-#line 2222 "glcpp/glcpp-parse.c" /* yacc.c:1646 */
+#line 2180 "glcpp/glcpp-parse.c" /* yacc.c:1646 */
break;
case 50:
-#line 500 "glcpp/glcpp-parse.y" /* yacc.c:1646 */
+#line 442 "glcpp/glcpp-parse.y" /* yacc.c:1646 */
{
- (yyval.expression_value).value = (yyvsp[-2].expression_value).value ^ (yyvsp[0].expression_value).value;
- if ((yyvsp[-2].expression_value).undefined_macro)
- (yyval.expression_value).undefined_macro = (yyvsp[-2].expression_value).undefined_macro;
- else
- (yyval.expression_value).undefined_macro = (yyvsp[0].expression_value).undefined_macro;
+ (yyval.ival) = (yyvsp[-2].ival) > (yyvsp[0].ival);
}
-#line 2234 "glcpp/glcpp-parse.c" /* yacc.c:1646 */
+#line 2188 "glcpp/glcpp-parse.c" /* yacc.c:1646 */
break;
case 51:
-#line 507 "glcpp/glcpp-parse.y" /* yacc.c:1646 */
+#line 445 "glcpp/glcpp-parse.y" /* yacc.c:1646 */
{
- (yyval.expression_value).value = (yyvsp[-2].expression_value).value & (yyvsp[0].expression_value).value;
- if ((yyvsp[-2].expression_value).undefined_macro)
- (yyval.expression_value).undefined_macro = (yyvsp[-2].expression_value).undefined_macro;
- else
- (yyval.expression_value).undefined_macro = (yyvsp[0].expression_value).undefined_macro;
+ (yyval.ival) = (yyvsp[-2].ival) < (yyvsp[0].ival);
}
-#line 2246 "glcpp/glcpp-parse.c" /* yacc.c:1646 */
+#line 2196 "glcpp/glcpp-parse.c" /* yacc.c:1646 */
break;
case 52:
-#line 514 "glcpp/glcpp-parse.y" /* yacc.c:1646 */
+#line 448 "glcpp/glcpp-parse.y" /* yacc.c:1646 */
{
- (yyval.expression_value).value = (yyvsp[-2].expression_value).value != (yyvsp[0].expression_value).value;
- if ((yyvsp[-2].expression_value).undefined_macro)
- (yyval.expression_value).undefined_macro = (yyvsp[-2].expression_value).undefined_macro;
- else
- (yyval.expression_value).undefined_macro = (yyvsp[0].expression_value).undefined_macro;
+ (yyval.ival) = (yyvsp[-2].ival) >> (yyvsp[0].ival);
}
-#line 2258 "glcpp/glcpp-parse.c" /* yacc.c:1646 */
+#line 2204 "glcpp/glcpp-parse.c" /* yacc.c:1646 */
break;
case 53:
-#line 521 "glcpp/glcpp-parse.y" /* yacc.c:1646 */
+#line 451 "glcpp/glcpp-parse.y" /* yacc.c:1646 */
{
- (yyval.expression_value).value = (yyvsp[-2].expression_value).value == (yyvsp[0].expression_value).value;
- if ((yyvsp[-2].expression_value).undefined_macro)
- (yyval.expression_value).undefined_macro = (yyvsp[-2].expression_value).undefined_macro;
- else
- (yyval.expression_value).undefined_macro = (yyvsp[0].expression_value).undefined_macro;
+ (yyval.ival) = (yyvsp[-2].ival) << (yyvsp[0].ival);
}
-#line 2270 "glcpp/glcpp-parse.c" /* yacc.c:1646 */
+#line 2212 "glcpp/glcpp-parse.c" /* yacc.c:1646 */
break;
case 54:
-#line 528 "glcpp/glcpp-parse.y" /* yacc.c:1646 */
+#line 454 "glcpp/glcpp-parse.y" /* yacc.c:1646 */
{
- (yyval.expression_value).value = (yyvsp[-2].expression_value).value >= (yyvsp[0].expression_value).value;
- if ((yyvsp[-2].expression_value).undefined_macro)
- (yyval.expression_value).undefined_macro = (yyvsp[-2].expression_value).undefined_macro;
- else
- (yyval.expression_value).undefined_macro = (yyvsp[0].expression_value).undefined_macro;
+ (yyval.ival) = (yyvsp[-2].ival) - (yyvsp[0].ival);
}
-#line 2282 "glcpp/glcpp-parse.c" /* yacc.c:1646 */
+#line 2220 "glcpp/glcpp-parse.c" /* yacc.c:1646 */
break;
case 55:
-#line 535 "glcpp/glcpp-parse.y" /* yacc.c:1646 */
+#line 457 "glcpp/glcpp-parse.y" /* yacc.c:1646 */
{
- (yyval.expression_value).value = (yyvsp[-2].expression_value).value <= (yyvsp[0].expression_value).value;
- if ((yyvsp[-2].expression_value).undefined_macro)
- (yyval.expression_value).undefined_macro = (yyvsp[-2].expression_value).undefined_macro;
- else
- (yyval.expression_value).undefined_macro = (yyvsp[0].expression_value).undefined_macro;
+ (yyval.ival) = (yyvsp[-2].ival) + (yyvsp[0].ival);
}
-#line 2294 "glcpp/glcpp-parse.c" /* yacc.c:1646 */
+#line 2228 "glcpp/glcpp-parse.c" /* yacc.c:1646 */
break;
case 56:
-#line 542 "glcpp/glcpp-parse.y" /* yacc.c:1646 */
+#line 460 "glcpp/glcpp-parse.y" /* yacc.c:1646 */
{
- (yyval.expression_value).value = (yyvsp[-2].expression_value).value > (yyvsp[0].expression_value).value;
- if ((yyvsp[-2].expression_value).undefined_macro)
- (yyval.expression_value).undefined_macro = (yyvsp[-2].expression_value).undefined_macro;
- else
- (yyval.expression_value).undefined_macro = (yyvsp[0].expression_value).undefined_macro;
+ if ((yyvsp[0].ival) == 0) {
+ yyerror (& (yylsp[-2]), parser,
+ "zero modulus in preprocessor directive");
+ } else {
+ (yyval.ival) = (yyvsp[-2].ival) % (yyvsp[0].ival);
+ }
}
-#line 2306 "glcpp/glcpp-parse.c" /* yacc.c:1646 */
+#line 2241 "glcpp/glcpp-parse.c" /* yacc.c:1646 */
break;
case 57:
-#line 549 "glcpp/glcpp-parse.y" /* yacc.c:1646 */
+#line 468 "glcpp/glcpp-parse.y" /* yacc.c:1646 */
{
- (yyval.expression_value).value = (yyvsp[-2].expression_value).value < (yyvsp[0].expression_value).value;
- if ((yyvsp[-2].expression_value).undefined_macro)
- (yyval.expression_value).undefined_macro = (yyvsp[-2].expression_value).undefined_macro;
- else
- (yyval.expression_value).undefined_macro = (yyvsp[0].expression_value).undefined_macro;
+ if ((yyvsp[0].ival) == 0) {
+ yyerror (& (yylsp[-2]), parser,
+ "division by 0 in preprocessor directive");
+ } else {
+ (yyval.ival) = (yyvsp[-2].ival) / (yyvsp[0].ival);
+ }
}
-#line 2318 "glcpp/glcpp-parse.c" /* yacc.c:1646 */
+#line 2254 "glcpp/glcpp-parse.c" /* yacc.c:1646 */
break;
case 58:
-#line 556 "glcpp/glcpp-parse.y" /* yacc.c:1646 */
+#line 476 "glcpp/glcpp-parse.y" /* yacc.c:1646 */
{
- (yyval.expression_value).value = (yyvsp[-2].expression_value).value >> (yyvsp[0].expression_value).value;
- if ((yyvsp[-2].expression_value).undefined_macro)
- (yyval.expression_value).undefined_macro = (yyvsp[-2].expression_value).undefined_macro;
- else
- (yyval.expression_value).undefined_macro = (yyvsp[0].expression_value).undefined_macro;
+ (yyval.ival) = (yyvsp[-2].ival) * (yyvsp[0].ival);
}
-#line 2330 "glcpp/glcpp-parse.c" /* yacc.c:1646 */
+#line 2262 "glcpp/glcpp-parse.c" /* yacc.c:1646 */
break;
case 59:
-#line 563 "glcpp/glcpp-parse.y" /* yacc.c:1646 */
+#line 479 "glcpp/glcpp-parse.y" /* yacc.c:1646 */
{
- (yyval.expression_value).value = (yyvsp[-2].expression_value).value << (yyvsp[0].expression_value).value;
- if ((yyvsp[-2].expression_value).undefined_macro)
- (yyval.expression_value).undefined_macro = (yyvsp[-2].expression_value).undefined_macro;
- else
- (yyval.expression_value).undefined_macro = (yyvsp[0].expression_value).undefined_macro;
+ (yyval.ival) = ! (yyvsp[0].ival);
}
-#line 2342 "glcpp/glcpp-parse.c" /* yacc.c:1646 */
+#line 2270 "glcpp/glcpp-parse.c" /* yacc.c:1646 */
break;
case 60:
-#line 570 "glcpp/glcpp-parse.y" /* yacc.c:1646 */
+#line 482 "glcpp/glcpp-parse.y" /* yacc.c:1646 */
{
- (yyval.expression_value).value = (yyvsp[-2].expression_value).value - (yyvsp[0].expression_value).value;
- if ((yyvsp[-2].expression_value).undefined_macro)
- (yyval.expression_value).undefined_macro = (yyvsp[-2].expression_value).undefined_macro;
- else
- (yyval.expression_value).undefined_macro = (yyvsp[0].expression_value).undefined_macro;
+ (yyval.ival) = ~ (yyvsp[0].ival);
}
-#line 2354 "glcpp/glcpp-parse.c" /* yacc.c:1646 */
+#line 2278 "glcpp/glcpp-parse.c" /* yacc.c:1646 */
break;
case 61:
-#line 577 "glcpp/glcpp-parse.y" /* yacc.c:1646 */
+#line 485 "glcpp/glcpp-parse.y" /* yacc.c:1646 */
{
- (yyval.expression_value).value = (yyvsp[-2].expression_value).value + (yyvsp[0].expression_value).value;
- if ((yyvsp[-2].expression_value).undefined_macro)
- (yyval.expression_value).undefined_macro = (yyvsp[-2].expression_value).undefined_macro;
- else
- (yyval.expression_value).undefined_macro = (yyvsp[0].expression_value).undefined_macro;
+ (yyval.ival) = - (yyvsp[0].ival);
}
-#line 2366 "glcpp/glcpp-parse.c" /* yacc.c:1646 */
+#line 2286 "glcpp/glcpp-parse.c" /* yacc.c:1646 */
break;
case 62:
-#line 584 "glcpp/glcpp-parse.y" /* yacc.c:1646 */
+#line 488 "glcpp/glcpp-parse.y" /* yacc.c:1646 */
{
- if ((yyvsp[0].expression_value).value == 0) {
- yyerror (& (yylsp[-2]), parser,
- "zero modulus in preprocessor directive");
- } else {
- (yyval.expression_value).value = (yyvsp[-2].expression_value).value % (yyvsp[0].expression_value).value;
- }
- if ((yyvsp[-2].expression_value).undefined_macro)
- (yyval.expression_value).undefined_macro = (yyvsp[-2].expression_value).undefined_macro;
- else
- (yyval.expression_value).undefined_macro = (yyvsp[0].expression_value).undefined_macro;
+ (yyval.ival) = + (yyvsp[0].ival);
}
-#line 2383 "glcpp/glcpp-parse.c" /* yacc.c:1646 */
+#line 2294 "glcpp/glcpp-parse.c" /* yacc.c:1646 */
break;
case 63:
-#line 596 "glcpp/glcpp-parse.y" /* yacc.c:1646 */
+#line 491 "glcpp/glcpp-parse.y" /* yacc.c:1646 */
{
- if ((yyvsp[0].expression_value).value == 0) {
- yyerror (& (yylsp[-2]), parser,
- "division by 0 in preprocessor directive");
- } else {
- (yyval.expression_value).value = (yyvsp[-2].expression_value).value / (yyvsp[0].expression_value).value;
- }
- if ((yyvsp[-2].expression_value).undefined_macro)
- (yyval.expression_value).undefined_macro = (yyvsp[-2].expression_value).undefined_macro;
- else
- (yyval.expression_value).undefined_macro = (yyvsp[0].expression_value).undefined_macro;
+ (yyval.ival) = (yyvsp[-1].ival);
}
-#line 2400 "glcpp/glcpp-parse.c" /* yacc.c:1646 */
+#line 2302 "glcpp/glcpp-parse.c" /* yacc.c:1646 */
break;
case 64:
-#line 608 "glcpp/glcpp-parse.y" /* yacc.c:1646 */
+#line 497 "glcpp/glcpp-parse.y" /* yacc.c:1646 */
{
- (yyval.expression_value).value = (yyvsp[-2].expression_value).value * (yyvsp[0].expression_value).value;
- if ((yyvsp[-2].expression_value).undefined_macro)
- (yyval.expression_value).undefined_macro = (yyvsp[-2].expression_value).undefined_macro;
- else
- (yyval.expression_value).undefined_macro = (yyvsp[0].expression_value).undefined_macro;
+ (yyval.string_list) = _string_list_create (parser);
+ _string_list_append_item ((yyval.string_list), (yyvsp[0].str));
+ ralloc_steal ((yyval.string_list), (yyvsp[0].str));
}
-#line 2412 "glcpp/glcpp-parse.c" /* yacc.c:1646 */
+#line 2312 "glcpp/glcpp-parse.c" /* yacc.c:1646 */
break;
case 65:
-#line 615 "glcpp/glcpp-parse.y" /* yacc.c:1646 */
+#line 502 "glcpp/glcpp-parse.y" /* yacc.c:1646 */
{
- (yyval.expression_value).value = ! (yyvsp[0].expression_value).value;
- (yyval.expression_value).undefined_macro = (yyvsp[0].expression_value).undefined_macro;
+ (yyval.string_list) = (yyvsp[-2].string_list);
+ _string_list_append_item ((yyval.string_list), (yyvsp[0].str));
+ ralloc_steal ((yyval.string_list), (yyvsp[0].str));
}
-#line 2421 "glcpp/glcpp-parse.c" /* yacc.c:1646 */
+#line 2322 "glcpp/glcpp-parse.c" /* yacc.c:1646 */
break;
case 66:
-#line 619 "glcpp/glcpp-parse.y" /* yacc.c:1646 */
- {
- (yyval.expression_value).value = ~ (yyvsp[0].expression_value).value;
- (yyval.expression_value).undefined_macro = (yyvsp[0].expression_value).undefined_macro;
- }
-#line 2430 "glcpp/glcpp-parse.c" /* yacc.c:1646 */
- break;
-
- case 67:
-#line 623 "glcpp/glcpp-parse.y" /* yacc.c:1646 */
- {
- (yyval.expression_value).value = - (yyvsp[0].expression_value).value;
- (yyval.expression_value).undefined_macro = (yyvsp[0].expression_value).undefined_macro;
- }
-#line 2439 "glcpp/glcpp-parse.c" /* yacc.c:1646 */
+#line 510 "glcpp/glcpp-parse.y" /* yacc.c:1646 */
+ { (yyval.token_list) = NULL; }
+#line 2328 "glcpp/glcpp-parse.c" /* yacc.c:1646 */
break;
case 68:
-#line 627 "glcpp/glcpp-parse.y" /* yacc.c:1646 */
+#line 515 "glcpp/glcpp-parse.y" /* yacc.c:1646 */
{
- (yyval.expression_value).value = + (yyvsp[0].expression_value).value;
- (yyval.expression_value).undefined_macro = (yyvsp[0].expression_value).undefined_macro;
+ yyerror (& (yylsp[-1]), parser, "Invalid tokens after #");
}
-#line 2448 "glcpp/glcpp-parse.c" /* yacc.c:1646 */
+#line 2336 "glcpp/glcpp-parse.c" /* yacc.c:1646 */
break;
case 69:
-#line 631 "glcpp/glcpp-parse.y" /* yacc.c:1646 */
- {
- (yyval.expression_value) = (yyvsp[-1].expression_value);
- }
-#line 2456 "glcpp/glcpp-parse.c" /* yacc.c:1646 */
+#line 521 "glcpp/glcpp-parse.y" /* yacc.c:1646 */
+ { (yyval.token_list) = NULL; }
+#line 2342 "glcpp/glcpp-parse.c" /* yacc.c:1646 */
break;
- case 70:
-#line 637 "glcpp/glcpp-parse.y" /* yacc.c:1646 */
+ case 72:
+#line 527 "glcpp/glcpp-parse.y" /* yacc.c:1646 */
{
- (yyval.string_list) = _string_list_create (parser);
- _string_list_append_item ((yyval.string_list), (yyvsp[0].str));
- ralloc_steal ((yyval.string_list), (yyvsp[0].str));
+ glcpp_warning(&(yylsp[0]), parser, "extra tokens at end of directive");
}
-#line 2466 "glcpp/glcpp-parse.c" /* yacc.c:1646 */
+#line 2350 "glcpp/glcpp-parse.c" /* yacc.c:1646 */
break;
- case 71:
-#line 642 "glcpp/glcpp-parse.y" /* yacc.c:1646 */
+ case 73:
+#line 534 "glcpp/glcpp-parse.y" /* yacc.c:1646 */
{
- (yyval.string_list) = (yyvsp[-2].string_list);
- _string_list_append_item ((yyval.string_list), (yyvsp[0].str));
- ralloc_steal ((yyval.string_list), (yyvsp[0].str));
+ int v = hash_table_find (parser->defines, (yyvsp[0].str)) ? 1 : 0;
+ (yyval.token) = _token_create_ival (parser, INTEGER, v);
}
-#line 2476 "glcpp/glcpp-parse.c" /* yacc.c:1646 */
+#line 2359 "glcpp/glcpp-parse.c" /* yacc.c:1646 */
break;
- case 72:
-#line 650 "glcpp/glcpp-parse.y" /* yacc.c:1646 */
- { (yyval.token_list) = NULL; }
-#line 2482 "glcpp/glcpp-parse.c" /* yacc.c:1646 */
+ case 74:
+#line 538 "glcpp/glcpp-parse.y" /* yacc.c:1646 */
+ {
+ int v = hash_table_find (parser->defines, (yyvsp[-1].str)) ? 1 : 0;
+ (yyval.token) = _token_create_ival (parser, INTEGER, v);
+ }
+#line 2368 "glcpp/glcpp-parse.c" /* yacc.c:1646 */
break;
- case 74:
-#line 655 "glcpp/glcpp-parse.y" /* yacc.c:1646 */
- { (yyval.token_list) = NULL; }
-#line 2488 "glcpp/glcpp-parse.c" /* yacc.c:1646 */
+ case 76:
+#line 547 "glcpp/glcpp-parse.y" /* yacc.c:1646 */
+ {
+ (yyval.token_list) = _token_list_create (parser);
+ _token_list_append ((yyval.token_list), (yyvsp[0].token));
+ }
+#line 2377 "glcpp/glcpp-parse.c" /* yacc.c:1646 */
break;
case 77:
-#line 661 "glcpp/glcpp-parse.y" /* yacc.c:1646 */
+#line 551 "glcpp/glcpp-parse.y" /* yacc.c:1646 */
{
- glcpp_error(&(yylsp[0]), parser, "extra tokens at end of directive");
+ (yyval.token_list) = (yyvsp[-1].token_list);
+ _token_list_append ((yyval.token_list), (yyvsp[0].token));
}
-#line 2496 "glcpp/glcpp-parse.c" /* yacc.c:1646 */
+#line 2386 "glcpp/glcpp-parse.c" /* yacc.c:1646 */
break;
case 78:
-#line 667 "glcpp/glcpp-parse.y" /* yacc.c:1646 */
+#line 558 "glcpp/glcpp-parse.y" /* yacc.c:1646 */
{
parser->space_tokens = 1;
(yyval.token_list) = _token_list_create (parser);
_token_list_append ((yyval.token_list), (yyvsp[0].token));
}
-#line 2506 "glcpp/glcpp-parse.c" /* yacc.c:1646 */
+#line 2396 "glcpp/glcpp-parse.c" /* yacc.c:1646 */
break;
case 79:
-#line 672 "glcpp/glcpp-parse.y" /* yacc.c:1646 */
+#line 563 "glcpp/glcpp-parse.y" /* yacc.c:1646 */
{
(yyval.token_list) = (yyvsp[-1].token_list);
_token_list_append ((yyval.token_list), (yyvsp[0].token));
}
-#line 2515 "glcpp/glcpp-parse.c" /* yacc.c:1646 */
+#line 2405 "glcpp/glcpp-parse.c" /* yacc.c:1646 */
break;
case 80:
-#line 679 "glcpp/glcpp-parse.y" /* yacc.c:1646 */
+#line 570 "glcpp/glcpp-parse.y" /* yacc.c:1646 */
{
(yyval.token) = _token_create_str (parser, IDENTIFIER, (yyvsp[0].str));
(yyval.token)->location = yylloc;
}
-#line 2524 "glcpp/glcpp-parse.c" /* yacc.c:1646 */
+#line 2414 "glcpp/glcpp-parse.c" /* yacc.c:1646 */
break;
case 81:
-#line 683 "glcpp/glcpp-parse.y" /* yacc.c:1646 */
+#line 574 "glcpp/glcpp-parse.y" /* yacc.c:1646 */
{
(yyval.token) = _token_create_str (parser, INTEGER_STRING, (yyvsp[0].str));
(yyval.token)->location = yylloc;
}
-#line 2533 "glcpp/glcpp-parse.c" /* yacc.c:1646 */
+#line 2423 "glcpp/glcpp-parse.c" /* yacc.c:1646 */
break;
case 82:
-#line 687 "glcpp/glcpp-parse.y" /* yacc.c:1646 */
+#line 578 "glcpp/glcpp-parse.y" /* yacc.c:1646 */
{
(yyval.token) = _token_create_ival (parser, (yyvsp[0].ival), (yyvsp[0].ival));
(yyval.token)->location = yylloc;
}
-#line 2542 "glcpp/glcpp-parse.c" /* yacc.c:1646 */
+#line 2432 "glcpp/glcpp-parse.c" /* yacc.c:1646 */
break;
case 83:
-#line 691 "glcpp/glcpp-parse.y" /* yacc.c:1646 */
- {
- (yyval.token) = _token_create_ival (parser, DEFINED, DEFINED);
- (yyval.token)->location = yylloc;
- }
-#line 2551 "glcpp/glcpp-parse.c" /* yacc.c:1646 */
- break;
-
- case 84:
-#line 695 "glcpp/glcpp-parse.y" /* yacc.c:1646 */
+#line 582 "glcpp/glcpp-parse.y" /* yacc.c:1646 */
{
(yyval.token) = _token_create_str (parser, OTHER, (yyvsp[0].str));
(yyval.token)->location = yylloc;
}
-#line 2560 "glcpp/glcpp-parse.c" /* yacc.c:1646 */
+#line 2441 "glcpp/glcpp-parse.c" /* yacc.c:1646 */
break;
- case 85:
-#line 699 "glcpp/glcpp-parse.y" /* yacc.c:1646 */
+ case 84:
+#line 586 "glcpp/glcpp-parse.y" /* yacc.c:1646 */
{
(yyval.token) = _token_create_ival (parser, SPACE, SPACE);
(yyval.token)->location = yylloc;
}
-#line 2569 "glcpp/glcpp-parse.c" /* yacc.c:1646 */
+#line 2450 "glcpp/glcpp-parse.c" /* yacc.c:1646 */
break;
- case 86:
-#line 706 "glcpp/glcpp-parse.y" /* yacc.c:1646 */
+ case 85:
+#line 593 "glcpp/glcpp-parse.y" /* yacc.c:1646 */
{ (yyval.ival) = '['; }
-#line 2575 "glcpp/glcpp-parse.c" /* yacc.c:1646 */
+#line 2456 "glcpp/glcpp-parse.c" /* yacc.c:1646 */
break;
- case 87:
-#line 707 "glcpp/glcpp-parse.y" /* yacc.c:1646 */
+ case 86:
+#line 594 "glcpp/glcpp-parse.y" /* yacc.c:1646 */
{ (yyval.ival) = ']'; }
-#line 2581 "glcpp/glcpp-parse.c" /* yacc.c:1646 */
+#line 2462 "glcpp/glcpp-parse.c" /* yacc.c:1646 */
break;
- case 88:
-#line 708 "glcpp/glcpp-parse.y" /* yacc.c:1646 */
+ case 87:
+#line 595 "glcpp/glcpp-parse.y" /* yacc.c:1646 */
{ (yyval.ival) = '('; }
-#line 2587 "glcpp/glcpp-parse.c" /* yacc.c:1646 */
+#line 2468 "glcpp/glcpp-parse.c" /* yacc.c:1646 */
break;
- case 89:
-#line 709 "glcpp/glcpp-parse.y" /* yacc.c:1646 */
+ case 88:
+#line 596 "glcpp/glcpp-parse.y" /* yacc.c:1646 */
{ (yyval.ival) = ')'; }
-#line 2593 "glcpp/glcpp-parse.c" /* yacc.c:1646 */
+#line 2474 "glcpp/glcpp-parse.c" /* yacc.c:1646 */
break;
- case 90:
-#line 710 "glcpp/glcpp-parse.y" /* yacc.c:1646 */
+ case 89:
+#line 597 "glcpp/glcpp-parse.y" /* yacc.c:1646 */
{ (yyval.ival) = '{'; }
-#line 2599 "glcpp/glcpp-parse.c" /* yacc.c:1646 */
+#line 2480 "glcpp/glcpp-parse.c" /* yacc.c:1646 */
break;
- case 91:
-#line 711 "glcpp/glcpp-parse.y" /* yacc.c:1646 */
+ case 90:
+#line 598 "glcpp/glcpp-parse.y" /* yacc.c:1646 */
{ (yyval.ival) = '}'; }
-#line 2605 "glcpp/glcpp-parse.c" /* yacc.c:1646 */
+#line 2486 "glcpp/glcpp-parse.c" /* yacc.c:1646 */
break;
- case 92:
-#line 712 "glcpp/glcpp-parse.y" /* yacc.c:1646 */
+ case 91:
+#line 599 "glcpp/glcpp-parse.y" /* yacc.c:1646 */
{ (yyval.ival) = '.'; }
-#line 2611 "glcpp/glcpp-parse.c" /* yacc.c:1646 */
+#line 2492 "glcpp/glcpp-parse.c" /* yacc.c:1646 */
break;
- case 93:
-#line 713 "glcpp/glcpp-parse.y" /* yacc.c:1646 */
+ case 92:
+#line 600 "glcpp/glcpp-parse.y" /* yacc.c:1646 */
{ (yyval.ival) = '&'; }
-#line 2617 "glcpp/glcpp-parse.c" /* yacc.c:1646 */
+#line 2498 "glcpp/glcpp-parse.c" /* yacc.c:1646 */
break;
- case 94:
-#line 714 "glcpp/glcpp-parse.y" /* yacc.c:1646 */
+ case 93:
+#line 601 "glcpp/glcpp-parse.y" /* yacc.c:1646 */
{ (yyval.ival) = '*'; }
-#line 2623 "glcpp/glcpp-parse.c" /* yacc.c:1646 */
+#line 2504 "glcpp/glcpp-parse.c" /* yacc.c:1646 */
break;
- case 95:
-#line 715 "glcpp/glcpp-parse.y" /* yacc.c:1646 */
+ case 94:
+#line 602 "glcpp/glcpp-parse.y" /* yacc.c:1646 */
{ (yyval.ival) = '+'; }
-#line 2629 "glcpp/glcpp-parse.c" /* yacc.c:1646 */
+#line 2510 "glcpp/glcpp-parse.c" /* yacc.c:1646 */
break;
- case 96:
-#line 716 "glcpp/glcpp-parse.y" /* yacc.c:1646 */
+ case 95:
+#line 603 "glcpp/glcpp-parse.y" /* yacc.c:1646 */
{ (yyval.ival) = '-'; }
-#line 2635 "glcpp/glcpp-parse.c" /* yacc.c:1646 */
+#line 2516 "glcpp/glcpp-parse.c" /* yacc.c:1646 */
break;
- case 97:
-#line 717 "glcpp/glcpp-parse.y" /* yacc.c:1646 */
+ case 96:
+#line 604 "glcpp/glcpp-parse.y" /* yacc.c:1646 */
{ (yyval.ival) = '~'; }
-#line 2641 "glcpp/glcpp-parse.c" /* yacc.c:1646 */
+#line 2522 "glcpp/glcpp-parse.c" /* yacc.c:1646 */
break;
- case 98:
-#line 718 "glcpp/glcpp-parse.y" /* yacc.c:1646 */
+ case 97:
+#line 605 "glcpp/glcpp-parse.y" /* yacc.c:1646 */
{ (yyval.ival) = '!'; }
-#line 2647 "glcpp/glcpp-parse.c" /* yacc.c:1646 */
+#line 2528 "glcpp/glcpp-parse.c" /* yacc.c:1646 */
break;
- case 99:
-#line 719 "glcpp/glcpp-parse.y" /* yacc.c:1646 */
+ case 98:
+#line 606 "glcpp/glcpp-parse.y" /* yacc.c:1646 */
{ (yyval.ival) = '/'; }
-#line 2653 "glcpp/glcpp-parse.c" /* yacc.c:1646 */
+#line 2534 "glcpp/glcpp-parse.c" /* yacc.c:1646 */
break;
- case 100:
-#line 720 "glcpp/glcpp-parse.y" /* yacc.c:1646 */
+ case 99:
+#line 607 "glcpp/glcpp-parse.y" /* yacc.c:1646 */
{ (yyval.ival) = '%'; }
-#line 2659 "glcpp/glcpp-parse.c" /* yacc.c:1646 */
+#line 2540 "glcpp/glcpp-parse.c" /* yacc.c:1646 */
break;
- case 101:
-#line 721 "glcpp/glcpp-parse.y" /* yacc.c:1646 */
+ case 100:
+#line 608 "glcpp/glcpp-parse.y" /* yacc.c:1646 */
{ (yyval.ival) = LEFT_SHIFT; }
-#line 2665 "glcpp/glcpp-parse.c" /* yacc.c:1646 */
+#line 2546 "glcpp/glcpp-parse.c" /* yacc.c:1646 */
break;
- case 102:
-#line 722 "glcpp/glcpp-parse.y" /* yacc.c:1646 */
+ case 101:
+#line 609 "glcpp/glcpp-parse.y" /* yacc.c:1646 */
{ (yyval.ival) = RIGHT_SHIFT; }
-#line 2671 "glcpp/glcpp-parse.c" /* yacc.c:1646 */
+#line 2552 "glcpp/glcpp-parse.c" /* yacc.c:1646 */
break;
- case 103:
-#line 723 "glcpp/glcpp-parse.y" /* yacc.c:1646 */
+ case 102:
+#line 610 "glcpp/glcpp-parse.y" /* yacc.c:1646 */
{ (yyval.ival) = '<'; }
-#line 2677 "glcpp/glcpp-parse.c" /* yacc.c:1646 */
+#line 2558 "glcpp/glcpp-parse.c" /* yacc.c:1646 */
break;
- case 104:
-#line 724 "glcpp/glcpp-parse.y" /* yacc.c:1646 */
+ case 103:
+#line 611 "glcpp/glcpp-parse.y" /* yacc.c:1646 */
{ (yyval.ival) = '>'; }
-#line 2683 "glcpp/glcpp-parse.c" /* yacc.c:1646 */
+#line 2564 "glcpp/glcpp-parse.c" /* yacc.c:1646 */
break;
- case 105:
-#line 725 "glcpp/glcpp-parse.y" /* yacc.c:1646 */
+ case 104:
+#line 612 "glcpp/glcpp-parse.y" /* yacc.c:1646 */
{ (yyval.ival) = LESS_OR_EQUAL; }
-#line 2689 "glcpp/glcpp-parse.c" /* yacc.c:1646 */
+#line 2570 "glcpp/glcpp-parse.c" /* yacc.c:1646 */
break;
- case 106:
-#line 726 "glcpp/glcpp-parse.y" /* yacc.c:1646 */
+ case 105:
+#line 613 "glcpp/glcpp-parse.y" /* yacc.c:1646 */
{ (yyval.ival) = GREATER_OR_EQUAL; }
-#line 2695 "glcpp/glcpp-parse.c" /* yacc.c:1646 */
+#line 2576 "glcpp/glcpp-parse.c" /* yacc.c:1646 */
break;
- case 107:
-#line 727 "glcpp/glcpp-parse.y" /* yacc.c:1646 */
+ case 106:
+#line 614 "glcpp/glcpp-parse.y" /* yacc.c:1646 */
{ (yyval.ival) = EQUAL; }
-#line 2701 "glcpp/glcpp-parse.c" /* yacc.c:1646 */
+#line 2582 "glcpp/glcpp-parse.c" /* yacc.c:1646 */
break;
- case 108:
-#line 728 "glcpp/glcpp-parse.y" /* yacc.c:1646 */
+ case 107:
+#line 615 "glcpp/glcpp-parse.y" /* yacc.c:1646 */
{ (yyval.ival) = NOT_EQUAL; }
-#line 2707 "glcpp/glcpp-parse.c" /* yacc.c:1646 */
+#line 2588 "glcpp/glcpp-parse.c" /* yacc.c:1646 */
break;
- case 109:
-#line 729 "glcpp/glcpp-parse.y" /* yacc.c:1646 */
+ case 108:
+#line 616 "glcpp/glcpp-parse.y" /* yacc.c:1646 */
{ (yyval.ival) = '^'; }
-#line 2713 "glcpp/glcpp-parse.c" /* yacc.c:1646 */
+#line 2594 "glcpp/glcpp-parse.c" /* yacc.c:1646 */
break;
- case 110:
-#line 730 "glcpp/glcpp-parse.y" /* yacc.c:1646 */
+ case 109:
+#line 617 "glcpp/glcpp-parse.y" /* yacc.c:1646 */
{ (yyval.ival) = '|'; }
-#line 2719 "glcpp/glcpp-parse.c" /* yacc.c:1646 */
+#line 2600 "glcpp/glcpp-parse.c" /* yacc.c:1646 */
break;
- case 111:
-#line 731 "glcpp/glcpp-parse.y" /* yacc.c:1646 */
+ case 110:
+#line 618 "glcpp/glcpp-parse.y" /* yacc.c:1646 */
{ (yyval.ival) = AND; }
-#line 2725 "glcpp/glcpp-parse.c" /* yacc.c:1646 */
+#line 2606 "glcpp/glcpp-parse.c" /* yacc.c:1646 */
break;
- case 112:
-#line 732 "glcpp/glcpp-parse.y" /* yacc.c:1646 */
+ case 111:
+#line 619 "glcpp/glcpp-parse.y" /* yacc.c:1646 */
{ (yyval.ival) = OR; }
-#line 2731 "glcpp/glcpp-parse.c" /* yacc.c:1646 */
+#line 2612 "glcpp/glcpp-parse.c" /* yacc.c:1646 */
break;
- case 113:
-#line 733 "glcpp/glcpp-parse.y" /* yacc.c:1646 */
+ case 112:
+#line 620 "glcpp/glcpp-parse.y" /* yacc.c:1646 */
{ (yyval.ival) = ';'; }
-#line 2737 "glcpp/glcpp-parse.c" /* yacc.c:1646 */
+#line 2618 "glcpp/glcpp-parse.c" /* yacc.c:1646 */
break;
- case 114:
-#line 734 "glcpp/glcpp-parse.y" /* yacc.c:1646 */
+ case 113:
+#line 621 "glcpp/glcpp-parse.y" /* yacc.c:1646 */
{ (yyval.ival) = ','; }
-#line 2743 "glcpp/glcpp-parse.c" /* yacc.c:1646 */
+#line 2624 "glcpp/glcpp-parse.c" /* yacc.c:1646 */
break;
- case 115:
-#line 735 "glcpp/glcpp-parse.y" /* yacc.c:1646 */
+ case 114:
+#line 622 "glcpp/glcpp-parse.y" /* yacc.c:1646 */
{ (yyval.ival) = '='; }
-#line 2749 "glcpp/glcpp-parse.c" /* yacc.c:1646 */
+#line 2630 "glcpp/glcpp-parse.c" /* yacc.c:1646 */
break;
- case 116:
-#line 736 "glcpp/glcpp-parse.y" /* yacc.c:1646 */
+ case 115:
+#line 623 "glcpp/glcpp-parse.y" /* yacc.c:1646 */
{ (yyval.ival) = PASTE; }
-#line 2755 "glcpp/glcpp-parse.c" /* yacc.c:1646 */
- break;
-
- case 117:
-#line 737 "glcpp/glcpp-parse.y" /* yacc.c:1646 */
- { (yyval.ival) = PLUS_PLUS; }
-#line 2761 "glcpp/glcpp-parse.c" /* yacc.c:1646 */
- break;
-
- case 118:
-#line 738 "glcpp/glcpp-parse.y" /* yacc.c:1646 */
- { (yyval.ival) = MINUS_MINUS; }
-#line 2767 "glcpp/glcpp-parse.c" /* yacc.c:1646 */
+#line 2636 "glcpp/glcpp-parse.c" /* yacc.c:1646 */
break;
-#line 2771 "glcpp/glcpp-parse.c" /* yacc.c:1646 */
+#line 2640 "glcpp/glcpp-parse.c" /* yacc.c:1646 */
default: break;
}
/* User semantic actions sometimes alter yychar, and that requires
@@ -3002,7 +2871,7 @@ yyreturn:
#endif
return yyresult;
}
-#line 741 "glcpp/glcpp-parse.y" /* yacc.c:1906 */
+#line 626 "glcpp/glcpp-parse.y" /* yacc.c:1906 */
string_list_t *
@@ -3056,25 +2925,6 @@ _string_list_contains (string_list_t *list, const char *member, int *index)
return 0;
}
-/* Return duplicate string in list (if any), NULL otherwise. */
-const char *
-_string_list_has_duplicate (string_list_t *list)
-{
- string_node_t *node, *dup;
-
- if (list == NULL)
- return NULL;
-
- for (node = list->head; node; node = node->next) {
- for (dup = node->next; dup; dup = dup->next) {
- if (strcmp (node->str, dup->str) == 0)
- return node->str;
- }
- }
-
- return NULL;
-}
-
int
_string_list_length (string_list_t *list)
{
@@ -3332,16 +3182,14 @@ _token_list_equal_ignoring_space (token_list_t *a, token_list_t *b)
if (node_a == NULL || node_b == NULL)
return 0;
- /* Make sure whitespace appears in the same places in both.
- * It need not be exactly the same amount of whitespace,
- * though.
- */
- if (node_a->token->type == SPACE
- && node_b->token->type == SPACE) {
- while (node_a->token->type == SPACE)
- node_a = node_a->next;
- while (node_b->token->type == SPACE)
- node_b = node_b->next;
+
+ if (node_a->token->type == SPACE) {
+ node_a = node_a->next;
+ continue;
+ }
+
+ if (node_b->token->type == SPACE) {
+ node_b = node_b->next;
continue;
}
@@ -3421,21 +3269,14 @@ _token_print (char **out, size_t *len, token_t *token)
case PASTE:
ralloc_asprintf_rewrite_tail (out, len, "##");
break;
- case PLUS_PLUS:
- ralloc_asprintf_rewrite_tail (out, len, "++");
- break;
- case MINUS_MINUS:
- ralloc_asprintf_rewrite_tail (out, len, "--");
- break;
- case DEFINED:
- ralloc_asprintf_rewrite_tail (out, len, "defined");
+ case COMMA_FINAL:
+ ralloc_asprintf_rewrite_tail (out, len, ",");
break;
case PLACEHOLDER:
/* Nothing to print. */
break;
default:
assert(!"Error: Don't know how to print token.");
-
break;
}
}
@@ -3611,18 +3452,14 @@ glcpp_parser_create (const struct gl_extensions *extensions, gl_api api)
parser->defines = hash_table_ctor (32, hash_table_string_hash,
hash_table_string_compare);
parser->active = NULL;
- parser->lexing_directive = 0;
+ parser->lexing_if = 0;
parser->space_tokens = 1;
- parser->last_token_was_newline = 0;
- parser->last_token_was_space = 0;
- parser->first_non_space_token_this_line = 1;
parser->newline_as_space = 0;
parser->in_control_line = 0;
parser->paren_count = 0;
parser->commented_newlines = 0;
parser->skip_stack = NULL;
- parser->skipping = 0;
parser->lex_from_list = NULL;
parser->lex_from_node = NULL;
@@ -3768,143 +3605,15 @@ _token_list_create_with_one_integer (void *ctx, int ival)
return _token_list_create_with_one_ival (ctx, INTEGER, ival);
}
-/* Evaluate a DEFINED token node (based on subsequent tokens in the list).
- *
- * Note: This function must only be called when "node" is a DEFINED token,
- * (and will abort with an assertion failure otherwise).
- *
- * If "node" is followed, (ignoring any SPACE tokens), by an IDENTIFIER token
- * (optionally preceded and followed by '(' and ')' tokens) then the following
- * occurs:
- *
- * If the identifier is a defined macro, this function returns 1.
- *
- * If the identifier is not a defined macro, this function returns 0.
- *
- * In either case, *last will be updated to the last node in the list
- * consumed by the evaluation, (either the token of the identifier or the
- * token of the closing parenthesis).
- *
- * In all other cases, (such as "node is the final node of the list", or
- * "missing closing parenthesis", etc.), this function generates a
- * preprocessor error, returns -1 and *last will not be set.
- */
-static int
-_glcpp_parser_evaluate_defined (glcpp_parser_t *parser,
- token_node_t *node,
- token_node_t **last)
-{
- token_node_t *argument, *defined = node;
-
- assert (node->token->type == DEFINED);
-
- node = node->next;
-
- /* Ignore whitespace after DEFINED token. */
- while (node && node->token->type == SPACE)
- node = node->next;
-
- if (node == NULL)
- goto FAIL;
-
- if (node->token->type == IDENTIFIER || node->token->type == OTHER) {
- argument = node;
- } else if (node->token->type == '(') {
- node = node->next;
-
- /* Ignore whitespace after '(' token. */
- while (node && node->token->type == SPACE)
- node = node->next;
-
- if (node == NULL || (node->token->type != IDENTIFIER &&
- node->token->type != OTHER))
- {
- goto FAIL;
- }
-
- argument = node;
-
- node = node->next;
-
- /* Ignore whitespace after identifier, before ')' token. */
- while (node && node->token->type == SPACE)
- node = node->next;
-
- if (node == NULL || node->token->type != ')')
- goto FAIL;
- } else {
- goto FAIL;
- }
-
- *last = node;
-
- return hash_table_find (parser->defines,
- argument->token->value.str) ? 1 : 0;
-
-FAIL:
- glcpp_error (&defined->token->location, parser,
- "\"defined\" not followed by an identifier");
- return -1;
-}
-
-/* Evaluate all DEFINED nodes in a given list, modifying the list in place.
- */
-static void
-_glcpp_parser_evaluate_defined_in_list (glcpp_parser_t *parser,
- token_list_t *list)
-{
- token_node_t *node, *node_prev, *replacement, *last = NULL;
- int value;
-
- if (list == NULL)
- return;
-
- node_prev = NULL;
- node = list->head;
-
- while (node) {
-
- if (node->token->type != DEFINED)
- goto NEXT;
-
- value = _glcpp_parser_evaluate_defined (parser, node, &last);
- if (value == -1)
- goto NEXT;
-
- replacement = ralloc (list, token_node_t);
- replacement->token = _token_create_ival (list, INTEGER, value);
-
- /* Splice replacement node into list, replacing from "node"
- * through "last". */
- if (node_prev)
- node_prev->next = replacement;
- else
- list->head = replacement;
- replacement->next = last->next;
- if (last == list->tail)
- list->tail = replacement;
-
- node = replacement;
-
- NEXT:
- node_prev = node;
- node = node->next;
- }
-}
-
/* Perform macro expansion on 'list', placing the resulting tokens
* into a new list which is initialized with a first token of type
* 'head_token_type'. Then begin lexing from the resulting list,
* (return to the current lexing source when this list is exhausted).
- *
- * See the documentation of _glcpp_parser_expand_token_list for a description
- * of the "mode" parameter.
*/
static void
_glcpp_parser_expand_and_lex_from (glcpp_parser_t *parser,
int head_token_type,
- token_list_t *list,
- expansion_mode_t mode)
+ token_list_t *list)
{
token_list_t *expanded;
token_t *token;
@@ -3912,7 +3621,7 @@ _glcpp_parser_expand_and_lex_from (glcpp_parser_t *parser,
expanded = _token_list_create (parser);
token = _token_create_ival (parser, head_token_type, head_token_type);
_token_list_append (expanded, token);
- _glcpp_parser_expand_token_list (parser, list, mode);
+ _glcpp_parser_expand_token_list (parser, list);
_token_list_append_list (expanded, list);
glcpp_parser_lex_from (parser, expanded);
}
@@ -3975,15 +3684,12 @@ _glcpp_parser_apply_pastes (glcpp_parser_t *parser, token_list_t *list)
* *last to the last node in the list that was consumed by the
* expansion. Specifically, *last will be set as follows: as the
* token of the closing right parenthesis.
- *
- * See the documentation of _glcpp_parser_expand_token_list for a description
- * of the "mode" parameter.
*/
static token_list_t *
_glcpp_parser_expand_function (glcpp_parser_t *parser,
token_node_t *node,
- token_node_t **last,
- expansion_mode_t mode)
+ token_node_t **last)
+
{
macro_t *macro;
const char *identifier;
@@ -4052,8 +3758,7 @@ _glcpp_parser_expand_function (glcpp_parser_t *parser,
expanded_argument = _token_list_copy (parser,
argument);
_glcpp_parser_expand_token_list (parser,
- expanded_argument,
- mode);
+ expanded_argument);
_token_list_append_list (substituted,
expanded_argument);
} else {
@@ -4093,15 +3798,11 @@ _glcpp_parser_expand_function (glcpp_parser_t *parser,
*
* As the token of the closing right parenthesis in the case of
* function-like macro expansion.
- *
- * See the documentation of _glcpp_parser_expand_token_list for a description
- * of the "mode" parameter.
*/
static token_list_t *
_glcpp_parser_expand_node (glcpp_parser_t *parser,
token_node_t *node,
- token_node_t **last,
- expansion_mode_t mode)
+ token_node_t **last)
{
token_t *token = node->token;
const char *identifier;
@@ -4109,6 +3810,14 @@ _glcpp_parser_expand_node (glcpp_parser_t *parser,
/* We only expand identifiers */
if (token->type != IDENTIFIER) {
+ /* We change any COMMA into a COMMA_FINAL to prevent
+ * it being mistaken for an argument separator
+ * later. */
+ if (token->type == ',') {
+ token->type = COMMA_FINAL;
+ token->value.ival = COMMA_FINAL;
+ }
+
return NULL;
}
@@ -4160,7 +3869,7 @@ _glcpp_parser_expand_node (glcpp_parser_t *parser,
return replacement;
}
- return _glcpp_parser_expand_function (parser, node, last, mode);
+ return _glcpp_parser_expand_function (parser, node, last);
}
/* Push a new identifier onto the parser's active list.
@@ -4219,28 +3928,11 @@ _parser_active_list_contains (glcpp_parser_t *parser, const char *identifier)
/* Walk over the token list replacing nodes with their expansion.
* Whenever nodes are expanded the walking will walk over the new
* nodes, continuing to expand as necessary. The results are placed in
- * 'list' itself.
- *
- * The "mode" argument controls the handling of any DEFINED tokens that
- * result from expansion as follows:
- *
- * EXPANSION_MODE_IGNORE_DEFINED: Any resulting DEFINED tokens will be
- * left in the final list, unevaluated. This is the correct mode
- * for expanding any list in any context other than a
- * preprocessor conditional, (#if or #elif).
- *
- * EXPANSION_MODE_EVALUATE_DEFINED: Any resulting DEFINED tokens will be
- * evaluated to 0 or 1 tokens depending on whether the following
- * token is the name of a defined macro. If the DEFINED token is
- * not followed by an (optionally parenthesized) identifier, then
- * an error will be generated. This the correct mode for
- * expanding any list in the context of a preprocessor
- * conditional, (#if or #elif).
+ * 'list' itself;
*/
static void
_glcpp_parser_expand_token_list (glcpp_parser_t *parser,
- token_list_t *list,
- expansion_mode_t mode)
+ token_list_t *list)
{
token_node_t *node_prev;
token_node_t *node, *last = NULL;
@@ -4255,23 +3947,15 @@ _glcpp_parser_expand_token_list (glcpp_parser_t *parser,
node_prev = NULL;
node = list->head;
- if (mode == EXPANSION_MODE_EVALUATE_DEFINED)
- _glcpp_parser_evaluate_defined_in_list (parser, list);
-
while (node) {
while (parser->active && parser->active->marker == node)
_parser_active_list_pop (parser);
- expansion = _glcpp_parser_expand_node (parser, node, &last, mode);
+ expansion = _glcpp_parser_expand_node (parser, node, &last);
if (expansion) {
token_node_t *n;
- if (mode == EXPANSION_MODE_EVALUATE_DEFINED) {
- _glcpp_parser_evaluate_defined_in_list (parser,
- expansion);
- }
-
for (n = node; n != last->next; n = n->next)
while (parser->active &&
parser->active->marker == n)
@@ -4324,7 +4008,7 @@ _glcpp_parser_print_expanded_token_list (glcpp_parser_t *parser,
if (list == NULL)
return;
- _glcpp_parser_expand_token_list (parser, list, EXPANSION_MODE_IGNORE_DEFINED);
+ _glcpp_parser_expand_token_list (parser, list);
_token_list_trim_trailing_space (list);
@@ -4385,10 +4069,6 @@ _define_object_macro (glcpp_parser_t *parser,
{
macro_t *macro, *previous;
- /* We define pre-defined macros before we've started parsing the
- * actual file. So if there's no location defined yet, that's what
- * were doing and we don't want to generate an error for using the
- * reserved names. */
if (loc != NULL)
_check_for_reserved_macro_name(parser, loc, identifier);
@@ -4421,16 +4101,9 @@ _define_function_macro (glcpp_parser_t *parser,
token_list_t *replacements)
{
macro_t *macro, *previous;
- const char *dup;
_check_for_reserved_macro_name(parser, loc, identifier);
- /* Check for any duplicate parameter names. */
- if ((dup = _string_list_has_duplicate (parameters)) != NULL) {
- glcpp_error (loc, parser, "Duplicate macro parameter \"%s\"",
- dup);
- }
-
macro = ralloc (parser, macro_t);
ralloc_steal (macro, parameters);
ralloc_steal (macro, replacements);
@@ -4493,11 +4166,11 @@ glcpp_parser_lex (YYSTYPE *yylval, YYLTYPE *yylloc, glcpp_parser_t *parser)
if (ret == NEWLINE)
parser->in_control_line = 0;
}
- else if (ret == DEFINE_TOKEN ||
- ret == UNDEF || ret == IF ||
- ret == IFDEF || ret == IFNDEF ||
- ret == ELIF || ret == ELSE ||
- ret == ENDIF || ret == HASH_TOKEN)
+ else if (ret == HASH_DEFINE ||
+ ret == HASH_UNDEF || ret == HASH_IF ||
+ ret == HASH_IFDEF || ret == HASH_IFNDEF ||
+ ret == HASH_ELIF || ret == HASH_ELSE ||
+ ret == HASH_ENDIF || ret == HASH)
{
parser->in_control_line = 1;
}
@@ -4590,7 +4263,7 @@ _glcpp_parser_skip_stack_change_if (glcpp_parser_t *parser, YYLTYPE *loc,
const char *type, int condition)
{
if (parser->skip_stack == NULL) {
- glcpp_error (loc, parser, "#%s without #if\n", type);
+ glcpp_error (loc, parser, "%s without #if\n", type);
return;
}
@@ -4643,8 +4316,6 @@ _glcpp_parser_handle_version_declaration(glcpp_parser_t *parser, intmax_t versio
if (extensions != NULL) {
if (extensions->OES_EGL_image_external)
add_builtin_define(parser, "GL_OES_EGL_image_external", 1);
- if (extensions->OES_standard_derivatives)
- add_builtin_define(parser, "GL_OES_standard_derivatives", 1);
}
} else {
add_builtin_define(parser, "GL_ARB_draw_buffers", 1);
@@ -4664,15 +4335,9 @@ _glcpp_parser_handle_version_declaration(glcpp_parser_t *parser, intmax_t versio
add_builtin_define(parser, "GL_ARB_fragment_coord_conventions",
1);
- if (extensions->ARB_fragment_layer_viewport)
- add_builtin_define(parser, "GL_ARB_fragment_layer_viewport", 1);
-
if (extensions->ARB_explicit_attrib_location)
add_builtin_define(parser, "GL_ARB_explicit_attrib_location", 1);
- if (extensions->ARB_explicit_uniform_location)
- add_builtin_define(parser, "GL_ARB_explicit_uniform_location", 1);
-
if (extensions->ARB_shader_texture_lod)
add_builtin_define(parser, "GL_ARB_shader_texture_lod", 1);
@@ -4711,9 +4376,6 @@ _glcpp_parser_handle_version_declaration(glcpp_parser_t *parser, intmax_t versio
if (extensions->AMD_vertex_shader_layer)
add_builtin_define(parser, "GL_AMD_vertex_shader_layer", 1);
- if (extensions->AMD_vertex_shader_viewport_index)
- add_builtin_define(parser, "GL_AMD_vertex_shader_viewport_index", 1);
-
if (extensions->ARB_shading_language_420pack)
add_builtin_define(parser, "GL_ARB_shading_language_420pack", 1);
@@ -4734,9 +4396,6 @@ _glcpp_parser_handle_version_declaration(glcpp_parser_t *parser, intmax_t versio
if (extensions->ARB_shader_image_load_store)
add_builtin_define(parser, "GL_ARB_shader_image_load_store", 1);
-
- if (extensions->ARB_derivative_control)
- add_builtin_define(parser, "GL_ARB_derivative_control", 1);
}
}
diff --git a/dist/Mesa/src/glsl/glcpp/glcpp-parse.h b/dist/Mesa/src/glsl/glcpp/glcpp-parse.h
index df0025778..97e48602a 100644
--- a/dist/Mesa/src/glsl/glcpp/glcpp-parse.h
+++ b/dist/Mesa/src/glsl/glcpp/glcpp-parse.h
@@ -34,7 +34,7 @@
# define YY_GLCPP_PARSER_SRC_GLSL_GLCPP_GLCPP_PARSE_H_INCLUDED
/* Debug traces. */
#ifndef YYDEBUG
-# define YYDEBUG 1
+# define YYDEBUG 0
#endif
#if YYDEBUG
extern int glcpp_parser_debug;
@@ -45,45 +45,41 @@ extern int glcpp_parser_debug;
# define YYTOKENTYPE
enum yytokentype
{
- DEFINED = 258,
- ELIF_EXPANDED = 259,
- HASH_TOKEN = 260,
- DEFINE_TOKEN = 261,
- FUNC_IDENTIFIER = 262,
- OBJ_IDENTIFIER = 263,
- ELIF = 264,
- ELSE = 265,
- ENDIF = 266,
- ERROR_TOKEN = 267,
- IF = 268,
- IFDEF = 269,
- IFNDEF = 270,
- LINE = 271,
- PRAGMA = 272,
- UNDEF = 273,
- VERSION_TOKEN = 274,
- GARBAGE = 275,
- IDENTIFIER = 276,
- IF_EXPANDED = 277,
- INTEGER = 278,
- INTEGER_STRING = 279,
- LINE_EXPANDED = 280,
- NEWLINE = 281,
- OTHER = 282,
- PLACEHOLDER = 283,
- SPACE = 284,
- PLUS_PLUS = 285,
- MINUS_MINUS = 286,
- PASTE = 287,
- OR = 288,
- AND = 289,
- EQUAL = 290,
- NOT_EQUAL = 291,
- LESS_OR_EQUAL = 292,
- GREATER_OR_EQUAL = 293,
- LEFT_SHIFT = 294,
- RIGHT_SHIFT = 295,
- UNARY = 296
+ COMMA_FINAL = 258,
+ DEFINED = 259,
+ ELIF_EXPANDED = 260,
+ HASH = 261,
+ HASH_DEFINE = 262,
+ FUNC_IDENTIFIER = 263,
+ OBJ_IDENTIFIER = 264,
+ HASH_ELIF = 265,
+ HASH_ELSE = 266,
+ HASH_ENDIF = 267,
+ HASH_IF = 268,
+ HASH_IFDEF = 269,
+ HASH_IFNDEF = 270,
+ HASH_LINE = 271,
+ HASH_UNDEF = 272,
+ HASH_VERSION = 273,
+ IDENTIFIER = 274,
+ IF_EXPANDED = 275,
+ INTEGER = 276,
+ INTEGER_STRING = 277,
+ LINE_EXPANDED = 278,
+ NEWLINE = 279,
+ OTHER = 280,
+ PLACEHOLDER = 281,
+ SPACE = 282,
+ PASTE = 283,
+ OR = 284,
+ AND = 285,
+ EQUAL = 286,
+ NOT_EQUAL = 287,
+ LESS_OR_EQUAL = 288,
+ GREATER_OR_EQUAL = 289,
+ LEFT_SHIFT = 290,
+ RIGHT_SHIFT = 291,
+ UNARY = 292
};
#endif
diff --git a/dist/Mesa/src/glsl/glcpp/glcpp-parse.y b/dist/Mesa/src/glsl/glcpp/glcpp-parse.y
index f1119eb80..98875837c 100644
--- a/dist/Mesa/src/glsl/glcpp/glcpp-parse.y
+++ b/dist/Mesa/src/glsl/glcpp/glcpp-parse.y
@@ -57,9 +57,6 @@ _string_list_append_item (string_list_t *list, const char *str);
static int
_string_list_contains (string_list_t *list, const char *member, int *index);
-static const char *
-_string_list_has_duplicate (string_list_t *list);
-
static int
_string_list_length (string_list_t *list);
@@ -108,25 +105,18 @@ _parser_active_list_pop (glcpp_parser_t *parser);
static int
_parser_active_list_contains (glcpp_parser_t *parser, const char *identifier);
-typedef enum {
- EXPANSION_MODE_IGNORE_DEFINED,
- EXPANSION_MODE_EVALUATE_DEFINED
-} expansion_mode_t;
-
/* Expand list, and begin lexing from the result (after first
* prefixing a token of type 'head_token_type').
*/
static void
_glcpp_parser_expand_and_lex_from (glcpp_parser_t *parser,
int head_token_type,
- token_list_t *list,
- expansion_mode_t mode);
+ token_list_t *list);
/* Perform macro expansion in-place on the given list. */
static void
_glcpp_parser_expand_token_list (glcpp_parser_t *parser,
- token_list_t *list,
- expansion_mode_t mode);
+ token_list_t *list);
static void
_glcpp_parser_print_expanded_token_list (glcpp_parser_t *parser,
@@ -174,18 +164,13 @@ add_builtin_define(glcpp_parser_t *parser, const char *name, int value);
%lex-param {glcpp_parser_t *parser}
%expect 0
-
- /* We use HASH_TOKEN, DEFINE_TOKEN and VERSION_TOKEN (as opposed to
- * HASH, DEFINE, and VERSION) to avoid conflicts with other symbols,
- * (such as the <HASH> and <DEFINE> start conditions in the lexer). */
-%token DEFINED ELIF_EXPANDED HASH_TOKEN DEFINE_TOKEN FUNC_IDENTIFIER OBJ_IDENTIFIER ELIF ELSE ENDIF ERROR_TOKEN IF IFDEF IFNDEF LINE PRAGMA UNDEF VERSION_TOKEN GARBAGE IDENTIFIER IF_EXPANDED INTEGER INTEGER_STRING LINE_EXPANDED NEWLINE OTHER PLACEHOLDER SPACE PLUS_PLUS MINUS_MINUS
+%token COMMA_FINAL DEFINED ELIF_EXPANDED HASH HASH_DEFINE FUNC_IDENTIFIER OBJ_IDENTIFIER HASH_ELIF HASH_ELSE HASH_ENDIF HASH_IF HASH_IFDEF HASH_IFNDEF HASH_LINE HASH_UNDEF HASH_VERSION IDENTIFIER IF_EXPANDED INTEGER INTEGER_STRING LINE_EXPANDED NEWLINE OTHER PLACEHOLDER SPACE
%token PASTE
-%type <ival> INTEGER operator SPACE integer_constant
-%type <expression_value> expression
-%type <str> IDENTIFIER FUNC_IDENTIFIER OBJ_IDENTIFIER INTEGER_STRING OTHER ERROR_TOKEN PRAGMA
+%type <ival> expression INTEGER operator SPACE integer_constant
+%type <str> IDENTIFIER FUNC_IDENTIFIER OBJ_IDENTIFIER INTEGER_STRING OTHER
%type <string_list> identifier_list
-%type <token> preprocessing_token
-%type <token_list> pp_tokens replacement_list text_line
+%type <token> preprocessing_token conditional_token
+%type <token_list> pp_tokens replacement_list text_line conditional_tokens
%left OR
%left AND
%left '|'
@@ -198,8 +183,6 @@ add_builtin_define(glcpp_parser_t *parser, const char *name, int value);
%left '*' '/' '%'
%right UNARY
-%debug
-
%%
input:
@@ -208,26 +191,35 @@ input:
;
line:
- control_line
-| SPACE control_line
+ control_line {
+ ralloc_asprintf_rewrite_tail (&parser->output, &parser->output_length, "\n");
+ }
+| HASH_LINE {
+ glcpp_parser_resolve_implicit_version(parser);
+ } pp_tokens NEWLINE {
+
+ if (parser->skip_stack == NULL ||
+ parser->skip_stack->type == SKIP_NO_SKIP)
+ {
+ _glcpp_parser_expand_and_lex_from (parser,
+ LINE_EXPANDED, $3);
+ }
+ }
| text_line {
_glcpp_parser_print_expanded_token_list (parser, $1);
ralloc_asprintf_rewrite_tail (&parser->output, &parser->output_length, "\n");
ralloc_free ($1);
}
| expanded_line
+| HASH non_directive
;
expanded_line:
IF_EXPANDED expression NEWLINE {
- if (parser->is_gles && $2.undefined_macro)
- glcpp_error(& @1, parser, "undefined macro %s in expression (illegal in GLES)", $2.undefined_macro);
- _glcpp_parser_skip_stack_push_if (parser, & @1, $2.value);
+ _glcpp_parser_skip_stack_push_if (parser, & @1, $2);
}
| ELIF_EXPANDED expression NEWLINE {
- if (parser->is_gles && $2.undefined_macro)
- glcpp_error(& @1, parser, "undefined macro %s in expression (illegal in GLES)", $2.undefined_macro);
- _glcpp_parser_skip_stack_change_if (parser, & @1, "elif", $2.value);
+ _glcpp_parser_skip_stack_change_if (parser, & @1, "elif", $2);
}
| LINE_EXPANDED integer_constant NEWLINE {
parser->has_new_line_number = 1;
@@ -262,48 +254,22 @@ define:
;
control_line:
- control_line_success {
- ralloc_asprintf_rewrite_tail (&parser->output, &parser->output_length, "\n");
- }
-| control_line_error
-| HASH_TOKEN LINE {
- glcpp_parser_resolve_implicit_version(parser);
- } pp_tokens NEWLINE {
-
- if (parser->skip_stack == NULL ||
- parser->skip_stack->type == SKIP_NO_SKIP)
- {
- _glcpp_parser_expand_and_lex_from (parser,
- LINE_EXPANDED, $4,
- EXPANSION_MODE_IGNORE_DEFINED);
- }
- }
-;
-
-control_line_success:
- HASH_TOKEN DEFINE_TOKEN {
+ HASH_DEFINE {
glcpp_parser_resolve_implicit_version(parser);
} define
-| HASH_TOKEN UNDEF {
+| HASH_UNDEF {
glcpp_parser_resolve_implicit_version(parser);
} IDENTIFIER NEWLINE {
- macro_t *macro;
- if (strcmp("__LINE__", $4) == 0
- || strcmp("__FILE__", $4) == 0
- || strcmp("__VERSION__", $4) == 0)
- glcpp_error(& @1, parser, "Built-in (pre-defined)"
- " macro names can not be undefined.");
-
- macro = hash_table_find (parser->defines, $4);
+ macro_t *macro = hash_table_find (parser->defines, $3);
if (macro) {
- hash_table_remove (parser->defines, $4);
+ hash_table_remove (parser->defines, $3);
ralloc_free (macro);
}
- ralloc_free ($4);
+ ralloc_free ($3);
}
-| HASH_TOKEN IF {
+| HASH_IF {
glcpp_parser_resolve_implicit_version(parser);
- } pp_tokens NEWLINE {
+ } conditional_tokens NEWLINE {
/* Be careful to only evaluate the 'if' expression if
* we are not skipping. When we are skipping, we
* simply push a new 0-valued 'if' onto the skip
@@ -315,8 +281,7 @@ control_line_success:
parser->skip_stack->type == SKIP_NO_SKIP)
{
_glcpp_parser_expand_and_lex_from (parser,
- IF_EXPANDED, $4,
- EXPANSION_MODE_EVALUATE_DEFINED);
+ IF_EXPANDED, $3);
}
else
{
@@ -324,7 +289,7 @@ control_line_success:
parser->skip_stack->type = SKIP_TO_ENDIF;
}
}
-| HASH_TOKEN IF NEWLINE {
+| HASH_IF NEWLINE {
/* #if without an expression is only an error if we
* are not skipping */
if (parser->skip_stack == NULL ||
@@ -334,21 +299,21 @@ control_line_success:
}
_glcpp_parser_skip_stack_push_if (parser, & @1, 0);
}
-| HASH_TOKEN IFDEF {
+| HASH_IFDEF {
glcpp_parser_resolve_implicit_version(parser);
} IDENTIFIER junk NEWLINE {
- macro_t *macro = hash_table_find (parser->defines, $4);
- ralloc_free ($4);
+ macro_t *macro = hash_table_find (parser->defines, $3);
+ ralloc_free ($3);
_glcpp_parser_skip_stack_push_if (parser, & @1, macro != NULL);
}
-| HASH_TOKEN IFNDEF {
+| HASH_IFNDEF {
glcpp_parser_resolve_implicit_version(parser);
} IDENTIFIER junk NEWLINE {
- macro_t *macro = hash_table_find (parser->defines, $4);
- ralloc_free ($4);
- _glcpp_parser_skip_stack_push_if (parser, & @3, macro == NULL);
+ macro_t *macro = hash_table_find (parser->defines, $3);
+ ralloc_free ($3);
+ _glcpp_parser_skip_stack_push_if (parser, & @2, macro == NULL);
}
-| HASH_TOKEN ELIF pp_tokens NEWLINE {
+| HASH_ELIF conditional_tokens NEWLINE {
/* Be careful to only evaluate the 'elif' expression
* if we are not skipping. When we are skipping, we
* simply change to a 0-valued 'elif' on the skip
@@ -360,8 +325,7 @@ control_line_success:
parser->skip_stack->type == SKIP_TO_ELSE)
{
_glcpp_parser_expand_and_lex_from (parser,
- ELIF_EXPANDED, $3,
- EXPANSION_MODE_EVALUATE_DEFINED);
+ ELIF_EXPANDED, $2);
}
else if (parser->skip_stack &&
parser->skip_stack->has_else)
@@ -374,7 +338,7 @@ control_line_success:
"elif", 0);
}
}
-| HASH_TOKEN ELIF NEWLINE {
+| HASH_ELIF NEWLINE {
/* #elif without an expression is an error unless we
* are skipping. */
if (parser->skip_stack &&
@@ -394,7 +358,7 @@ control_line_success:
glcpp_warning(& @1, parser, "ignoring illegal #elif without expression");
}
}
-| HASH_TOKEN ELSE { parser->lexing_directive = 1; } NEWLINE {
+| HASH_ELSE {
if (parser->skip_stack &&
parser->skip_stack->has_else)
{
@@ -406,40 +370,25 @@ control_line_success:
if (parser->skip_stack)
parser->skip_stack->has_else = true;
}
- }
-| HASH_TOKEN ENDIF {
+ } NEWLINE
+| HASH_ENDIF {
_glcpp_parser_skip_stack_pop (parser, & @1);
} NEWLINE
-| HASH_TOKEN VERSION_TOKEN integer_constant NEWLINE {
+| HASH_VERSION integer_constant NEWLINE {
if (parser->version_resolved) {
glcpp_error(& @1, parser, "#version must appear on the first line");
}
- _glcpp_parser_handle_version_declaration(parser, $3, NULL, true);
+ _glcpp_parser_handle_version_declaration(parser, $2, NULL, true);
}
-| HASH_TOKEN VERSION_TOKEN integer_constant IDENTIFIER NEWLINE {
+| HASH_VERSION integer_constant IDENTIFIER NEWLINE {
if (parser->version_resolved) {
glcpp_error(& @1, parser, "#version must appear on the first line");
}
- _glcpp_parser_handle_version_declaration(parser, $3, $4, true);
+ _glcpp_parser_handle_version_declaration(parser, $2, $3, true);
}
-| HASH_TOKEN NEWLINE {
+| HASH NEWLINE {
glcpp_parser_resolve_implicit_version(parser);
}
-| HASH_TOKEN PRAGMA NEWLINE {
- ralloc_asprintf_rewrite_tail (&parser->output, &parser->output_length, "#%s", $2);
- }
-;
-
-control_line_error:
- HASH_TOKEN ERROR_TOKEN NEWLINE {
- glcpp_error(& @1, parser, "#%s", $2);
- }
-| HASH_TOKEN DEFINE_TOKEN NEWLINE {
- glcpp_error (& @1, parser, "#define without macro name");
- }
-| HASH_TOKEN GARBAGE pp_tokens NEWLINE {
- glcpp_error (& @1, parser, "Illegal non-directive after #");
- }
;
integer_constant:
@@ -457,176 +406,87 @@ integer_constant:
}
expression:
- integer_constant {
- $$.value = $1;
- $$.undefined_macro = NULL;
- }
+ integer_constant
| IDENTIFIER {
- $$.value = 0;
if (parser->is_gles)
- $$.undefined_macro = ralloc_strdup (parser, $1);
- else
- $$.undefined_macro = NULL;
+ glcpp_error(& @1, parser, "undefined macro %s in expression (illegal in GLES)", $1);
+ $$ = 0;
}
| expression OR expression {
- $$.value = $1.value || $3.value;
-
- /* Short-circuit: Only flag undefined from right side
- * if left side evaluates to false.
- */
- if ($1.undefined_macro)
- $$.undefined_macro = $1.undefined_macro;
- else if (! $1.value)
- $$.undefined_macro = $3.undefined_macro;
+ $$ = $1 || $3;
}
| expression AND expression {
- $$.value = $1.value && $3.value;
-
- /* Short-circuit: Only flag undefined from right-side
- * if left side evaluates to true.
- */
- if ($1.undefined_macro)
- $$.undefined_macro = $1.undefined_macro;
- else if ($1.value)
- $$.undefined_macro = $3.undefined_macro;
+ $$ = $1 && $3;
}
| expression '|' expression {
- $$.value = $1.value | $3.value;
- if ($1.undefined_macro)
- $$.undefined_macro = $1.undefined_macro;
- else
- $$.undefined_macro = $3.undefined_macro;
+ $$ = $1 | $3;
}
| expression '^' expression {
- $$.value = $1.value ^ $3.value;
- if ($1.undefined_macro)
- $$.undefined_macro = $1.undefined_macro;
- else
- $$.undefined_macro = $3.undefined_macro;
+ $$ = $1 ^ $3;
}
| expression '&' expression {
- $$.value = $1.value & $3.value;
- if ($1.undefined_macro)
- $$.undefined_macro = $1.undefined_macro;
- else
- $$.undefined_macro = $3.undefined_macro;
+ $$ = $1 & $3;
}
| expression NOT_EQUAL expression {
- $$.value = $1.value != $3.value;
- if ($1.undefined_macro)
- $$.undefined_macro = $1.undefined_macro;
- else
- $$.undefined_macro = $3.undefined_macro;
+ $$ = $1 != $3;
}
| expression EQUAL expression {
- $$.value = $1.value == $3.value;
- if ($1.undefined_macro)
- $$.undefined_macro = $1.undefined_macro;
- else
- $$.undefined_macro = $3.undefined_macro;
+ $$ = $1 == $3;
}
| expression GREATER_OR_EQUAL expression {
- $$.value = $1.value >= $3.value;
- if ($1.undefined_macro)
- $$.undefined_macro = $1.undefined_macro;
- else
- $$.undefined_macro = $3.undefined_macro;
+ $$ = $1 >= $3;
}
| expression LESS_OR_EQUAL expression {
- $$.value = $1.value <= $3.value;
- if ($1.undefined_macro)
- $$.undefined_macro = $1.undefined_macro;
- else
- $$.undefined_macro = $3.undefined_macro;
+ $$ = $1 <= $3;
}
| expression '>' expression {
- $$.value = $1.value > $3.value;
- if ($1.undefined_macro)
- $$.undefined_macro = $1.undefined_macro;
- else
- $$.undefined_macro = $3.undefined_macro;
+ $$ = $1 > $3;
}
| expression '<' expression {
- $$.value = $1.value < $3.value;
- if ($1.undefined_macro)
- $$.undefined_macro = $1.undefined_macro;
- else
- $$.undefined_macro = $3.undefined_macro;
+ $$ = $1 < $3;
}
| expression RIGHT_SHIFT expression {
- $$.value = $1.value >> $3.value;
- if ($1.undefined_macro)
- $$.undefined_macro = $1.undefined_macro;
- else
- $$.undefined_macro = $3.undefined_macro;
+ $$ = $1 >> $3;
}
| expression LEFT_SHIFT expression {
- $$.value = $1.value << $3.value;
- if ($1.undefined_macro)
- $$.undefined_macro = $1.undefined_macro;
- else
- $$.undefined_macro = $3.undefined_macro;
+ $$ = $1 << $3;
}
| expression '-' expression {
- $$.value = $1.value - $3.value;
- if ($1.undefined_macro)
- $$.undefined_macro = $1.undefined_macro;
- else
- $$.undefined_macro = $3.undefined_macro;
+ $$ = $1 - $3;
}
| expression '+' expression {
- $$.value = $1.value + $3.value;
- if ($1.undefined_macro)
- $$.undefined_macro = $1.undefined_macro;
- else
- $$.undefined_macro = $3.undefined_macro;
+ $$ = $1 + $3;
}
| expression '%' expression {
- if ($3.value == 0) {
+ if ($3 == 0) {
yyerror (& @1, parser,
"zero modulus in preprocessor directive");
} else {
- $$.value = $1.value % $3.value;
+ $$ = $1 % $3;
}
- if ($1.undefined_macro)
- $$.undefined_macro = $1.undefined_macro;
- else
- $$.undefined_macro = $3.undefined_macro;
}
| expression '/' expression {
- if ($3.value == 0) {
+ if ($3 == 0) {
yyerror (& @1, parser,
"division by 0 in preprocessor directive");
} else {
- $$.value = $1.value / $3.value;
+ $$ = $1 / $3;
}
- if ($1.undefined_macro)
- $$.undefined_macro = $1.undefined_macro;
- else
- $$.undefined_macro = $3.undefined_macro;
}
| expression '*' expression {
- $$.value = $1.value * $3.value;
- if ($1.undefined_macro)
- $$.undefined_macro = $1.undefined_macro;
- else
- $$.undefined_macro = $3.undefined_macro;
+ $$ = $1 * $3;
}
| '!' expression %prec UNARY {
- $$.value = ! $2.value;
- $$.undefined_macro = $2.undefined_macro;
+ $$ = ! $2;
}
| '~' expression %prec UNARY {
- $$.value = ~ $2.value;
- $$.undefined_macro = $2.undefined_macro;
+ $$ = ~ $2;
}
| '-' expression %prec UNARY {
- $$.value = - $2.value;
- $$.undefined_macro = $2.undefined_macro;
+ $$ = - $2;
}
| '+' expression %prec UNARY {
- $$.value = + $2.value;
- $$.undefined_macro = $2.undefined_macro;
+ $$ = + $2;
}
| '(' expression ')' {
$$ = $2;
@@ -651,6 +511,12 @@ text_line:
| pp_tokens NEWLINE
;
+non_directive:
+ pp_tokens NEWLINE {
+ yyerror (& @1, parser, "Invalid tokens after #");
+ }
+;
+
replacement_list:
/* empty */ { $$ = NULL; }
| pp_tokens
@@ -659,7 +525,32 @@ replacement_list:
junk:
/* empty */
| pp_tokens {
- glcpp_error(&@1, parser, "extra tokens at end of directive");
+ glcpp_warning(&@1, parser, "extra tokens at end of directive");
+ }
+;
+
+conditional_token:
+ /* Handle "defined" operator */
+ DEFINED IDENTIFIER {
+ int v = hash_table_find (parser->defines, $2) ? 1 : 0;
+ $$ = _token_create_ival (parser, INTEGER, v);
+ }
+| DEFINED '(' IDENTIFIER ')' {
+ int v = hash_table_find (parser->defines, $3) ? 1 : 0;
+ $$ = _token_create_ival (parser, INTEGER, v);
+ }
+| preprocessing_token
+;
+
+conditional_tokens:
+ /* Exactly the same as pp_tokens, but using conditional_token */
+ conditional_token {
+ $$ = _token_list_create (parser);
+ _token_list_append ($$, $1);
+ }
+| conditional_tokens conditional_token {
+ $$ = $1;
+ _token_list_append ($$, $2);
}
;
@@ -688,10 +579,6 @@ preprocessing_token:
$$ = _token_create_ival (parser, $1, $1);
$$->location = yylloc;
}
-| DEFINED {
- $$ = _token_create_ival (parser, DEFINED, DEFINED);
- $$->location = yylloc;
- }
| OTHER {
$$ = _token_create_str (parser, OTHER, $1);
$$->location = yylloc;
@@ -734,8 +621,6 @@ operator:
| ',' { $$ = ','; }
| '=' { $$ = '='; }
| PASTE { $$ = PASTE; }
-| PLUS_PLUS { $$ = PLUS_PLUS; }
-| MINUS_MINUS { $$ = MINUS_MINUS; }
;
%%
@@ -791,25 +676,6 @@ _string_list_contains (string_list_t *list, const char *member, int *index)
return 0;
}
-/* Return duplicate string in list (if any), NULL otherwise. */
-const char *
-_string_list_has_duplicate (string_list_t *list)
-{
- string_node_t *node, *dup;
-
- if (list == NULL)
- return NULL;
-
- for (node = list->head; node; node = node->next) {
- for (dup = node->next; dup; dup = dup->next) {
- if (strcmp (node->str, dup->str) == 0)
- return node->str;
- }
- }
-
- return NULL;
-}
-
int
_string_list_length (string_list_t *list)
{
@@ -1067,16 +933,14 @@ _token_list_equal_ignoring_space (token_list_t *a, token_list_t *b)
if (node_a == NULL || node_b == NULL)
return 0;
- /* Make sure whitespace appears in the same places in both.
- * It need not be exactly the same amount of whitespace,
- * though.
- */
- if (node_a->token->type == SPACE
- && node_b->token->type == SPACE) {
- while (node_a->token->type == SPACE)
- node_a = node_a->next;
- while (node_b->token->type == SPACE)
- node_b = node_b->next;
+
+ if (node_a->token->type == SPACE) {
+ node_a = node_a->next;
+ continue;
+ }
+
+ if (node_b->token->type == SPACE) {
+ node_b = node_b->next;
continue;
}
@@ -1156,21 +1020,14 @@ _token_print (char **out, size_t *len, token_t *token)
case PASTE:
ralloc_asprintf_rewrite_tail (out, len, "##");
break;
- case PLUS_PLUS:
- ralloc_asprintf_rewrite_tail (out, len, "++");
- break;
- case MINUS_MINUS:
- ralloc_asprintf_rewrite_tail (out, len, "--");
- break;
- case DEFINED:
- ralloc_asprintf_rewrite_tail (out, len, "defined");
+ case COMMA_FINAL:
+ ralloc_asprintf_rewrite_tail (out, len, ",");
break;
case PLACEHOLDER:
/* Nothing to print. */
break;
default:
assert(!"Error: Don't know how to print token.");
-
break;
}
}
@@ -1346,18 +1203,14 @@ glcpp_parser_create (const struct gl_extensions *extensions, gl_api api)
parser->defines = hash_table_ctor (32, hash_table_string_hash,
hash_table_string_compare);
parser->active = NULL;
- parser->lexing_directive = 0;
+ parser->lexing_if = 0;
parser->space_tokens = 1;
- parser->last_token_was_newline = 0;
- parser->last_token_was_space = 0;
- parser->first_non_space_token_this_line = 1;
parser->newline_as_space = 0;
parser->in_control_line = 0;
parser->paren_count = 0;
parser->commented_newlines = 0;
parser->skip_stack = NULL;
- parser->skipping = 0;
parser->lex_from_list = NULL;
parser->lex_from_node = NULL;
@@ -1503,143 +1356,15 @@ _token_list_create_with_one_integer (void *ctx, int ival)
return _token_list_create_with_one_ival (ctx, INTEGER, ival);
}
-/* Evaluate a DEFINED token node (based on subsequent tokens in the list).
- *
- * Note: This function must only be called when "node" is a DEFINED token,
- * (and will abort with an assertion failure otherwise).
- *
- * If "node" is followed, (ignoring any SPACE tokens), by an IDENTIFIER token
- * (optionally preceded and followed by '(' and ')' tokens) then the following
- * occurs:
- *
- * If the identifier is a defined macro, this function returns 1.
- *
- * If the identifier is not a defined macro, this function returns 0.
- *
- * In either case, *last will be updated to the last node in the list
- * consumed by the evaluation, (either the token of the identifier or the
- * token of the closing parenthesis).
- *
- * In all other cases, (such as "node is the final node of the list", or
- * "missing closing parenthesis", etc.), this function generates a
- * preprocessor error, returns -1 and *last will not be set.
- */
-static int
-_glcpp_parser_evaluate_defined (glcpp_parser_t *parser,
- token_node_t *node,
- token_node_t **last)
-{
- token_node_t *argument, *defined = node;
-
- assert (node->token->type == DEFINED);
-
- node = node->next;
-
- /* Ignore whitespace after DEFINED token. */
- while (node && node->token->type == SPACE)
- node = node->next;
-
- if (node == NULL)
- goto FAIL;
-
- if (node->token->type == IDENTIFIER || node->token->type == OTHER) {
- argument = node;
- } else if (node->token->type == '(') {
- node = node->next;
-
- /* Ignore whitespace after '(' token. */
- while (node && node->token->type == SPACE)
- node = node->next;
-
- if (node == NULL || (node->token->type != IDENTIFIER &&
- node->token->type != OTHER))
- {
- goto FAIL;
- }
-
- argument = node;
-
- node = node->next;
-
- /* Ignore whitespace after identifier, before ')' token. */
- while (node && node->token->type == SPACE)
- node = node->next;
-
- if (node == NULL || node->token->type != ')')
- goto FAIL;
- } else {
- goto FAIL;
- }
-
- *last = node;
-
- return hash_table_find (parser->defines,
- argument->token->value.str) ? 1 : 0;
-
-FAIL:
- glcpp_error (&defined->token->location, parser,
- "\"defined\" not followed by an identifier");
- return -1;
-}
-
-/* Evaluate all DEFINED nodes in a given list, modifying the list in place.
- */
-static void
-_glcpp_parser_evaluate_defined_in_list (glcpp_parser_t *parser,
- token_list_t *list)
-{
- token_node_t *node, *node_prev, *replacement, *last = NULL;
- int value;
-
- if (list == NULL)
- return;
-
- node_prev = NULL;
- node = list->head;
-
- while (node) {
-
- if (node->token->type != DEFINED)
- goto NEXT;
-
- value = _glcpp_parser_evaluate_defined (parser, node, &last);
- if (value == -1)
- goto NEXT;
-
- replacement = ralloc (list, token_node_t);
- replacement->token = _token_create_ival (list, INTEGER, value);
-
- /* Splice replacement node into list, replacing from "node"
- * through "last". */
- if (node_prev)
- node_prev->next = replacement;
- else
- list->head = replacement;
- replacement->next = last->next;
- if (last == list->tail)
- list->tail = replacement;
-
- node = replacement;
-
- NEXT:
- node_prev = node;
- node = node->next;
- }
-}
-
/* Perform macro expansion on 'list', placing the resulting tokens
* into a new list which is initialized with a first token of type
* 'head_token_type'. Then begin lexing from the resulting list,
* (return to the current lexing source when this list is exhausted).
- *
- * See the documentation of _glcpp_parser_expand_token_list for a description
- * of the "mode" parameter.
*/
static void
_glcpp_parser_expand_and_lex_from (glcpp_parser_t *parser,
int head_token_type,
- token_list_t *list,
- expansion_mode_t mode)
+ token_list_t *list)
{
token_list_t *expanded;
token_t *token;
@@ -1647,7 +1372,7 @@ _glcpp_parser_expand_and_lex_from (glcpp_parser_t *parser,
expanded = _token_list_create (parser);
token = _token_create_ival (parser, head_token_type, head_token_type);
_token_list_append (expanded, token);
- _glcpp_parser_expand_token_list (parser, list, mode);
+ _glcpp_parser_expand_token_list (parser, list);
_token_list_append_list (expanded, list);
glcpp_parser_lex_from (parser, expanded);
}
@@ -1710,15 +1435,12 @@ _glcpp_parser_apply_pastes (glcpp_parser_t *parser, token_list_t *list)
* *last to the last node in the list that was consumed by the
* expansion. Specifically, *last will be set as follows: as the
* token of the closing right parenthesis.
- *
- * See the documentation of _glcpp_parser_expand_token_list for a description
- * of the "mode" parameter.
*/
static token_list_t *
_glcpp_parser_expand_function (glcpp_parser_t *parser,
token_node_t *node,
- token_node_t **last,
- expansion_mode_t mode)
+ token_node_t **last)
+
{
macro_t *macro;
const char *identifier;
@@ -1787,8 +1509,7 @@ _glcpp_parser_expand_function (glcpp_parser_t *parser,
expanded_argument = _token_list_copy (parser,
argument);
_glcpp_parser_expand_token_list (parser,
- expanded_argument,
- mode);
+ expanded_argument);
_token_list_append_list (substituted,
expanded_argument);
} else {
@@ -1828,15 +1549,11 @@ _glcpp_parser_expand_function (glcpp_parser_t *parser,
*
* As the token of the closing right parenthesis in the case of
* function-like macro expansion.
- *
- * See the documentation of _glcpp_parser_expand_token_list for a description
- * of the "mode" parameter.
*/
static token_list_t *
_glcpp_parser_expand_node (glcpp_parser_t *parser,
token_node_t *node,
- token_node_t **last,
- expansion_mode_t mode)
+ token_node_t **last)
{
token_t *token = node->token;
const char *identifier;
@@ -1844,6 +1561,14 @@ _glcpp_parser_expand_node (glcpp_parser_t *parser,
/* We only expand identifiers */
if (token->type != IDENTIFIER) {
+ /* We change any COMMA into a COMMA_FINAL to prevent
+ * it being mistaken for an argument separator
+ * later. */
+ if (token->type == ',') {
+ token->type = COMMA_FINAL;
+ token->value.ival = COMMA_FINAL;
+ }
+
return NULL;
}
@@ -1895,7 +1620,7 @@ _glcpp_parser_expand_node (glcpp_parser_t *parser,
return replacement;
}
- return _glcpp_parser_expand_function (parser, node, last, mode);
+ return _glcpp_parser_expand_function (parser, node, last);
}
/* Push a new identifier onto the parser's active list.
@@ -1954,28 +1679,11 @@ _parser_active_list_contains (glcpp_parser_t *parser, const char *identifier)
/* Walk over the token list replacing nodes with their expansion.
* Whenever nodes are expanded the walking will walk over the new
* nodes, continuing to expand as necessary. The results are placed in
- * 'list' itself.
- *
- * The "mode" argument controls the handling of any DEFINED tokens that
- * result from expansion as follows:
- *
- * EXPANSION_MODE_IGNORE_DEFINED: Any resulting DEFINED tokens will be
- * left in the final list, unevaluated. This is the correct mode
- * for expanding any list in any context other than a
- * preprocessor conditional, (#if or #elif).
- *
- * EXPANSION_MODE_EVALUATE_DEFINED: Any resulting DEFINED tokens will be
- * evaluated to 0 or 1 tokens depending on whether the following
- * token is the name of a defined macro. If the DEFINED token is
- * not followed by an (optionally parenthesized) identifier, then
- * an error will be generated. This the correct mode for
- * expanding any list in the context of a preprocessor
- * conditional, (#if or #elif).
+ * 'list' itself;
*/
static void
_glcpp_parser_expand_token_list (glcpp_parser_t *parser,
- token_list_t *list,
- expansion_mode_t mode)
+ token_list_t *list)
{
token_node_t *node_prev;
token_node_t *node, *last = NULL;
@@ -1990,23 +1698,15 @@ _glcpp_parser_expand_token_list (glcpp_parser_t *parser,
node_prev = NULL;
node = list->head;
- if (mode == EXPANSION_MODE_EVALUATE_DEFINED)
- _glcpp_parser_evaluate_defined_in_list (parser, list);
-
while (node) {
while (parser->active && parser->active->marker == node)
_parser_active_list_pop (parser);
- expansion = _glcpp_parser_expand_node (parser, node, &last, mode);
+ expansion = _glcpp_parser_expand_node (parser, node, &last);
if (expansion) {
token_node_t *n;
- if (mode == EXPANSION_MODE_EVALUATE_DEFINED) {
- _glcpp_parser_evaluate_defined_in_list (parser,
- expansion);
- }
-
for (n = node; n != last->next; n = n->next)
while (parser->active &&
parser->active->marker == n)
@@ -2059,7 +1759,7 @@ _glcpp_parser_print_expanded_token_list (glcpp_parser_t *parser,
if (list == NULL)
return;
- _glcpp_parser_expand_token_list (parser, list, EXPANSION_MODE_IGNORE_DEFINED);
+ _glcpp_parser_expand_token_list (parser, list);
_token_list_trim_trailing_space (list);
@@ -2120,10 +1820,6 @@ _define_object_macro (glcpp_parser_t *parser,
{
macro_t *macro, *previous;
- /* We define pre-defined macros before we've started parsing the
- * actual file. So if there's no location defined yet, that's what
- * were doing and we don't want to generate an error for using the
- * reserved names. */
if (loc != NULL)
_check_for_reserved_macro_name(parser, loc, identifier);
@@ -2156,16 +1852,9 @@ _define_function_macro (glcpp_parser_t *parser,
token_list_t *replacements)
{
macro_t *macro, *previous;
- const char *dup;
_check_for_reserved_macro_name(parser, loc, identifier);
- /* Check for any duplicate parameter names. */
- if ((dup = _string_list_has_duplicate (parameters)) != NULL) {
- glcpp_error (loc, parser, "Duplicate macro parameter \"%s\"",
- dup);
- }
-
macro = ralloc (parser, macro_t);
ralloc_steal (macro, parameters);
ralloc_steal (macro, replacements);
@@ -2228,11 +1917,11 @@ glcpp_parser_lex (YYSTYPE *yylval, YYLTYPE *yylloc, glcpp_parser_t *parser)
if (ret == NEWLINE)
parser->in_control_line = 0;
}
- else if (ret == DEFINE_TOKEN ||
- ret == UNDEF || ret == IF ||
- ret == IFDEF || ret == IFNDEF ||
- ret == ELIF || ret == ELSE ||
- ret == ENDIF || ret == HASH_TOKEN)
+ else if (ret == HASH_DEFINE ||
+ ret == HASH_UNDEF || ret == HASH_IF ||
+ ret == HASH_IFDEF || ret == HASH_IFNDEF ||
+ ret == HASH_ELIF || ret == HASH_ELSE ||
+ ret == HASH_ENDIF || ret == HASH)
{
parser->in_control_line = 1;
}
@@ -2325,7 +2014,7 @@ _glcpp_parser_skip_stack_change_if (glcpp_parser_t *parser, YYLTYPE *loc,
const char *type, int condition)
{
if (parser->skip_stack == NULL) {
- glcpp_error (loc, parser, "#%s without #if\n", type);
+ glcpp_error (loc, parser, "%s without #if\n", type);
return;
}
@@ -2378,8 +2067,6 @@ _glcpp_parser_handle_version_declaration(glcpp_parser_t *parser, intmax_t versio
if (extensions != NULL) {
if (extensions->OES_EGL_image_external)
add_builtin_define(parser, "GL_OES_EGL_image_external", 1);
- if (extensions->OES_standard_derivatives)
- add_builtin_define(parser, "GL_OES_standard_derivatives", 1);
}
} else {
add_builtin_define(parser, "GL_ARB_draw_buffers", 1);
@@ -2399,15 +2086,9 @@ _glcpp_parser_handle_version_declaration(glcpp_parser_t *parser, intmax_t versio
add_builtin_define(parser, "GL_ARB_fragment_coord_conventions",
1);
- if (extensions->ARB_fragment_layer_viewport)
- add_builtin_define(parser, "GL_ARB_fragment_layer_viewport", 1);
-
if (extensions->ARB_explicit_attrib_location)
add_builtin_define(parser, "GL_ARB_explicit_attrib_location", 1);
- if (extensions->ARB_explicit_uniform_location)
- add_builtin_define(parser, "GL_ARB_explicit_uniform_location", 1);
-
if (extensions->ARB_shader_texture_lod)
add_builtin_define(parser, "GL_ARB_shader_texture_lod", 1);
@@ -2446,9 +2127,6 @@ _glcpp_parser_handle_version_declaration(glcpp_parser_t *parser, intmax_t versio
if (extensions->AMD_vertex_shader_layer)
add_builtin_define(parser, "GL_AMD_vertex_shader_layer", 1);
- if (extensions->AMD_vertex_shader_viewport_index)
- add_builtin_define(parser, "GL_AMD_vertex_shader_viewport_index", 1);
-
if (extensions->ARB_shading_language_420pack)
add_builtin_define(parser, "GL_ARB_shading_language_420pack", 1);
@@ -2469,9 +2147,6 @@ _glcpp_parser_handle_version_declaration(glcpp_parser_t *parser, intmax_t versio
if (extensions->ARB_shader_image_load_store)
add_builtin_define(parser, "GL_ARB_shader_image_load_store", 1);
-
- if (extensions->ARB_derivative_control)
- add_builtin_define(parser, "GL_ARB_derivative_control", 1);
}
}
diff --git a/dist/Mesa/src/glsl/glcpp/glcpp.c b/dist/Mesa/src/glsl/glcpp/glcpp.c
index ca188015c..07b1500b6 100644
--- a/dist/Mesa/src/glsl/glcpp/glcpp.c
+++ b/dist/Mesa/src/glsl/glcpp/glcpp.c
@@ -124,7 +124,6 @@ enum {
const static struct option
long_options[] = {
{"disable-line-continuations", no_argument, 0, DISABLE_LINE_CONTINUATIONS_OPT },
- {"debug", no_argument, 0, 'd'},
{0, 0, 0, 0 }
};
@@ -141,14 +140,11 @@ main (int argc, char *argv[])
init_fake_gl_context (&gl_ctx);
- while ((c = getopt_long(argc, argv, "d", long_options, NULL)) != -1) {
+ while ((c = getopt_long(argc, argv, "", long_options, NULL)) != -1) {
switch (c) {
case DISABLE_LINE_CONTINUATIONS_OPT:
gl_ctx.Const.DisableGLSLLineContinuations = true;
break;
- case 'd':
- glcpp_parser_debug = 1;
- break;
default:
usage ();
exit (1);
diff --git a/dist/Mesa/src/glsl/glcpp/tests/063-comments.c.expected b/dist/Mesa/src/glsl/glcpp/tests/063-comments.c.expected
index f6e10ce03..1965c9be0 100644
--- a/dist/Mesa/src/glsl/glcpp/tests/063-comments.c.expected
+++ b/dist/Mesa/src/glsl/glcpp/tests/063-comments.c.expected
@@ -18,3 +18,4 @@ more code here
are not treated like comments.
+
diff --git a/dist/Mesa/src/glsl/glcpp/tests/086-reserved-macro-names.c.expected b/dist/Mesa/src/glsl/glcpp/tests/086-reserved-macro-names.c.expected
index 38b089dae..5ca42a983 100644
--- a/dist/Mesa/src/glsl/glcpp/tests/086-reserved-macro-names.c.expected
+++ b/dist/Mesa/src/glsl/glcpp/tests/086-reserved-macro-names.c.expected
@@ -1,4 +1,4 @@
-0:1(9): preprocessor warning: Macro names containing "__" are reserved for use by the implementation.
+0:1(10): preprocessor warning: Macro names containing "__" are reserved for use by the implementation.
0:2(9): preprocessor error: Macro names starting with "GL_" are reserved.
@@ -7,3 +7,4 @@
+
diff --git a/dist/Mesa/src/glsl/glcpp/tests/092-redefine-macro-error-2.c.expected b/dist/Mesa/src/glsl/glcpp/tests/092-redefine-macro-error-2.c.expected
index 698294d91..0026f91f3 100644
--- a/dist/Mesa/src/glsl/glcpp/tests/092-redefine-macro-error-2.c.expected
+++ b/dist/Mesa/src/glsl/glcpp/tests/092-redefine-macro-error-2.c.expected
@@ -7,3 +7,4 @@
+
diff --git a/dist/Mesa/src/glsl/glcpp/tests/093-divide-by-zero.c.expected b/dist/Mesa/src/glsl/glcpp/tests/093-divide-by-zero.c.expected
index a858870b7..08f183f24 100644
--- a/dist/Mesa/src/glsl/glcpp/tests/093-divide-by-zero.c.expected
+++ b/dist/Mesa/src/glsl/glcpp/tests/093-divide-by-zero.c.expected
@@ -1,3 +1,4 @@
-0:1(12): preprocessor error: division by 0 in preprocessor directive
+0:1(13): preprocessor error: division by 0 in preprocessor directive
+
diff --git a/dist/Mesa/src/glsl/glcpp/tests/094-divide-by-zero-short-circuit.c.expected b/dist/Mesa/src/glsl/glcpp/tests/094-divide-by-zero-short-circuit.c.expected
index 570952b24..be20b7c89 100644
--- a/dist/Mesa/src/glsl/glcpp/tests/094-divide-by-zero-short-circuit.c.expected
+++ b/dist/Mesa/src/glsl/glcpp/tests/094-divide-by-zero-short-circuit.c.expected
@@ -12,3 +12,4 @@
+
diff --git a/dist/Mesa/src/glsl/glcpp/tests/095-recursive-define.c.expected b/dist/Mesa/src/glsl/glcpp/tests/095-recursive-define.c.expected
index 493ab091b..c7aa18ff6 100644
--- a/dist/Mesa/src/glsl/glcpp/tests/095-recursive-define.c.expected
+++ b/dist/Mesa/src/glsl/glcpp/tests/095-recursive-define.c.expected
@@ -1,3 +1,4 @@
B(0, C)
+
diff --git a/dist/Mesa/src/glsl/glcpp/tests/097-paste-with-non-function-macro.c.expected b/dist/Mesa/src/glsl/glcpp/tests/097-paste-with-non-function-macro.c.expected
index 36f669925..af92187ee 100644
--- a/dist/Mesa/src/glsl/glcpp/tests/097-paste-with-non-function-macro.c.expected
+++ b/dist/Mesa/src/glsl/glcpp/tests/097-paste-with-non-function-macro.c.expected
@@ -1,3 +1,4 @@
onetoken
+
diff --git a/dist/Mesa/src/glsl/glcpp/tests/098-elif-undefined.c.expected b/dist/Mesa/src/glsl/glcpp/tests/098-elif-undefined.c.expected
index c6ef689ce..2af0a1269 100644
--- a/dist/Mesa/src/glsl/glcpp/tests/098-elif-undefined.c.expected
+++ b/dist/Mesa/src/glsl/glcpp/tests/098-elif-undefined.c.expected
@@ -5,3 +5,4 @@
Yes, this.
+
diff --git a/dist/Mesa/src/glsl/glcpp/tests/103-garbage-after-else-0.c b/dist/Mesa/src/glsl/glcpp/tests/103-garbage-after-else.c
index c460feadf..c460feadf 100644
--- a/dist/Mesa/src/glsl/glcpp/tests/103-garbage-after-else-0.c
+++ b/dist/Mesa/src/glsl/glcpp/tests/103-garbage-after-else.c
diff --git a/dist/Mesa/src/glsl/glcpp/tests/103-garbage-after-else-0.c.expected b/dist/Mesa/src/glsl/glcpp/tests/103-garbage-after-else.c.expected
index b053b3997..f9f5f1976 100644
--- a/dist/Mesa/src/glsl/glcpp/tests/103-garbage-after-else-0.c.expected
+++ b/dist/Mesa/src/glsl/glcpp/tests/103-garbage-after-else.c.expected
@@ -1,4 +1,4 @@
0:2(7): preprocessor error: syntax error, unexpected IDENTIFIER, expecting NEWLINE
-0:1(6): preprocessor error: Unterminated #if
+0:1(7): preprocessor error: Unterminated #if
diff --git a/dist/Mesa/src/glsl/glcpp/tests/143-multiple-else.c b/dist/Mesa/src/glsl/glcpp/tests/118-multiple-else.c
index 62ad49cf7..62ad49cf7 100644
--- a/dist/Mesa/src/glsl/glcpp/tests/143-multiple-else.c
+++ b/dist/Mesa/src/glsl/glcpp/tests/118-multiple-else.c
diff --git a/dist/Mesa/src/glsl/glcpp/tests/143-multiple-else.c.expected b/dist/Mesa/src/glsl/glcpp/tests/118-multiple-else.c.expected
index 00b3328c8..eaec48150 100644
--- a/dist/Mesa/src/glsl/glcpp/tests/143-multiple-else.c.expected
+++ b/dist/Mesa/src/glsl/glcpp/tests/118-multiple-else.c.expected
@@ -5,3 +5,4 @@ int foo;
int bar;
+
diff --git a/dist/Mesa/src/glsl/glcpp/tests/120-undef-builtin.c b/dist/Mesa/src/glsl/glcpp/tests/120-undef-builtin.c
deleted file mode 100644
index 49e769661..000000000
--- a/dist/Mesa/src/glsl/glcpp/tests/120-undef-builtin.c
+++ /dev/null
@@ -1,3 +0,0 @@
-#undef __LINE__
-#undef __FILE__
-#undef __VERSION__
diff --git a/dist/Mesa/src/glsl/glcpp/tests/120-undef-builtin.c.expected b/dist/Mesa/src/glsl/glcpp/tests/120-undef-builtin.c.expected
deleted file mode 100644
index cdb9c29ad..000000000
--- a/dist/Mesa/src/glsl/glcpp/tests/120-undef-builtin.c.expected
+++ /dev/null
@@ -1,6 +0,0 @@
-0:1(1): preprocessor error: Built-in (pre-defined) macro names can not be undefined.
-0:2(1): preprocessor error: Built-in (pre-defined) macro names can not be undefined.
-0:3(1): preprocessor error: Built-in (pre-defined) macro names can not be undefined.
-
-
-
diff --git a/dist/Mesa/src/glsl/glcpp/tests/122-redefine-whitespace.c b/dist/Mesa/src/glsl/glcpp/tests/122-redefine-whitespace.c
deleted file mode 100644
index ae7ea09f6..000000000
--- a/dist/Mesa/src/glsl/glcpp/tests/122-redefine-whitespace.c
+++ /dev/null
@@ -1,16 +0,0 @@
-/* Original definitions. */
-#define TWO ( 1+1 )
-#define FOUR (2 + 2)
-#define SIX (3 + 3)
-
-/* Redefinitions with whitespace in same places, but different amounts, (so no
- * error). */
-#define TWO ( 1+1 )
-#define FOUR (2 + 2)
-#define SIX (3/*comment is whitespace*/+ /* collapsed */ /* to */ /* one */ /* space */ 3)
-
-/* Redefinitions with whitespace in different places. Each of these should
- * trigger an error. */
-#define TWO (1 + 1)
-#define FOUR ( 2+2 )
-#define SIX (/*not*/3 + 3/*expected*/)
diff --git a/dist/Mesa/src/glsl/glcpp/tests/122-redefine-whitespace.c.expected b/dist/Mesa/src/glsl/glcpp/tests/122-redefine-whitespace.c.expected
deleted file mode 100644
index 602bdef94..000000000
--- a/dist/Mesa/src/glsl/glcpp/tests/122-redefine-whitespace.c.expected
+++ /dev/null
@@ -1,22 +0,0 @@
-0:14(9): preprocessor error: Redefinition of macro TWO
-
-0:15(9): preprocessor error: Redefinition of macro FOUR
-
-0:16(9): preprocessor error: Redefinition of macro SIX
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/dist/Mesa/src/glsl/glcpp/tests/123-garbage-after-else-1.c b/dist/Mesa/src/glsl/glcpp/tests/123-garbage-after-else-1.c
deleted file mode 100644
index 0b341a381..000000000
--- a/dist/Mesa/src/glsl/glcpp/tests/123-garbage-after-else-1.c
+++ /dev/null
@@ -1,3 +0,0 @@
-#if 1
-#else garbage
-#endif
diff --git a/dist/Mesa/src/glsl/glcpp/tests/123-garbage-after-else-1.c.expected b/dist/Mesa/src/glsl/glcpp/tests/123-garbage-after-else-1.c.expected
deleted file mode 100644
index b053b3997..000000000
--- a/dist/Mesa/src/glsl/glcpp/tests/123-garbage-after-else-1.c.expected
+++ /dev/null
@@ -1,4 +0,0 @@
-0:2(7): preprocessor error: syntax error, unexpected IDENTIFIER, expecting NEWLINE
-0:1(6): preprocessor error: Unterminated #if
-
-
diff --git a/dist/Mesa/src/glsl/glcpp/tests/124-preprocessing-numbers.c b/dist/Mesa/src/glsl/glcpp/tests/124-preprocessing-numbers.c
deleted file mode 100644
index 947ba1885..000000000
--- a/dist/Mesa/src/glsl/glcpp/tests/124-preprocessing-numbers.c
+++ /dev/null
@@ -1,37 +0,0 @@
-#define e THIS_SHOULD_NOT_BE_EXPANDED
-#define E NOR_THIS
-#define p NOT_THIS_EITHER
-#define P AND_SURELY_NOT_THIS
-#define OK CRAZY_BUT_TRUE_THIS_NEITHER
-
-/* This one is actually meant to be expanded */
-#define MUST_EXPAND GO
-
-/* The following are "preprocessing numbers" and should not trigger macro
- * expansion. */
-1e
-1OK
-
-/* These are also "preprocessing numbers", so no expansion */
-123e+OK
-.23E+OK
-1.3e-OK
-12.E-OK
-123p+OK
-.23P+OK
-1.3p-OK
-12.P-OK
-123..OK
-.23.OK.OK
-
-/* Importantly, just before the MUST_EXPAND in each of these, the preceding
- * "preprocessing number" ends and we have an actual expression. So the
- * MUST_EXPAND macro must be expanded (who would have though?) in each case. */
-123ef+MUST_EXPAND
-.23E3-MUST_EXPAND
-1.3e--MUST_EXPAND
-12.E-&MUST_EXPAND
-123p+OK+MUST_EXPAND
-.23P+OK;MUST_EXPAND
-1.3p-OK-MUST_EXPAND
-12.P-OK&MUST_EXPAND
diff --git a/dist/Mesa/src/glsl/glcpp/tests/124-preprocessing-numbers.c.expected b/dist/Mesa/src/glsl/glcpp/tests/124-preprocessing-numbers.c.expected
deleted file mode 100644
index 6ec588862..000000000
--- a/dist/Mesa/src/glsl/glcpp/tests/124-preprocessing-numbers.c.expected
+++ /dev/null
@@ -1,37 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-1e
-1OK
-
-
-123e+OK
-.23E+OK
-1.3e-OK
-12.E-OK
-123p+OK
-.23P+OK
-1.3p-OK
-12.P-OK
-123..OK
-.23.OK.OK
-
-
-
-
-123ef+GO
-.23E3-GO
-1.3e--GO
-12.E-&GO
-123p+OK+GO
-.23P+OK;GO
-1.3p-OK-GO
-12.P-OK&GO
diff --git a/dist/Mesa/src/glsl/glcpp/tests/125-es-short-circuit-undefined.c b/dist/Mesa/src/glsl/glcpp/tests/125-es-short-circuit-undefined.c
deleted file mode 100644
index 4ee29f6d9..000000000
--- a/dist/Mesa/src/glsl/glcpp/tests/125-es-short-circuit-undefined.c
+++ /dev/null
@@ -1,27 +0,0 @@
-/* For GLSL in OpenGL ES, an undefined macro appearing in an #if or #elif
- * expression, (other than as an argument to defined) is an error.
- *
- * Except in the case of a short-circuiting && or || operator, where the
- * specification explicitly mandates that there be no error.
- */
-#version 300 es
-
-/* These yield errors */
-#if NOT_DEFINED
-#endif
-
-#if 0
-#elif ALSO_NOT_DEFINED
-#endif
-
-/* But these yield no errors */
-#if 1 || STILL_NOT_DEFINED
-Success
-#endif
-
-#if 0
-#elif 0 && WILL_ANYONE_DEFINE_ANYTHING
-#else
-More success
-#endif
-
diff --git a/dist/Mesa/src/glsl/glcpp/tests/125-es-short-circuit-undefined.c.expected b/dist/Mesa/src/glsl/glcpp/tests/125-es-short-circuit-undefined.c.expected
deleted file mode 100644
index 616aa912e..000000000
--- a/dist/Mesa/src/glsl/glcpp/tests/125-es-short-circuit-undefined.c.expected
+++ /dev/null
@@ -1,29 +0,0 @@
-0:10(16): preprocessor error: undefined macro NOT_DEFINED in expression (illegal in GLES)
-0:14(23): preprocessor error: undefined macro ALSO_NOT_DEFINED in expression (illegal in GLES)
-
-
-
-
-
-
-#version 300 es
-
-
-
-
-
-
-
-
-
-
-
-Success
-
-
-
-
-
-More success
-
-
diff --git a/dist/Mesa/src/glsl/glcpp/tests/126-garbage-after-directive.c b/dist/Mesa/src/glsl/glcpp/tests/126-garbage-after-directive.c
deleted file mode 100644
index 4c0d29000..000000000
--- a/dist/Mesa/src/glsl/glcpp/tests/126-garbage-after-directive.c
+++ /dev/null
@@ -1,5 +0,0 @@
-#ifdef MACRO garbage
-#endif
-
-#ifndef MORE garbage
-#endif
diff --git a/dist/Mesa/src/glsl/glcpp/tests/126-garbage-after-directive.c.expected b/dist/Mesa/src/glsl/glcpp/tests/126-garbage-after-directive.c.expected
deleted file mode 100644
index 82a06f8a3..000000000
--- a/dist/Mesa/src/glsl/glcpp/tests/126-garbage-after-directive.c.expected
+++ /dev/null
@@ -1,7 +0,0 @@
-0:1(14): preprocessor error: extra tokens at end of directive
-0:4(14): preprocessor error: extra tokens at end of directive
-
-
-
-
-
diff --git a/dist/Mesa/src/glsl/glcpp/tests/127-pragma-empty.c b/dist/Mesa/src/glsl/glcpp/tests/127-pragma-empty.c
deleted file mode 100644
index 0f9b0b3d3..000000000
--- a/dist/Mesa/src/glsl/glcpp/tests/127-pragma-empty.c
+++ /dev/null
@@ -1,3 +0,0 @@
-/* It seems an odd (and particularly useless) thing to have an empty pragma,
- * but we probably shouldn't trigger an error in this case. */
-#pragma
diff --git a/dist/Mesa/src/glsl/glcpp/tests/127-pragma-empty.c.expected b/dist/Mesa/src/glsl/glcpp/tests/127-pragma-empty.c.expected
deleted file mode 100644
index 92371a07c..000000000
--- a/dist/Mesa/src/glsl/glcpp/tests/127-pragma-empty.c.expected
+++ /dev/null
@@ -1,3 +0,0 @@
-
-
-
diff --git a/dist/Mesa/src/glsl/glcpp/tests/128-space-before-hash.c b/dist/Mesa/src/glsl/glcpp/tests/128-space-before-hash.c
deleted file mode 100644
index fba9596ba..000000000
--- a/dist/Mesa/src/glsl/glcpp/tests/128-space-before-hash.c
+++ /dev/null
@@ -1,21 +0,0 @@
- /* Any directive can be preceded by a space. */
- #version 300
- #pragma Testing spaces before hash
- #
- #line 3
- #define FOO
- #ifdef FOO
- yes
- #endif
- #if 0
- #elif defined FOO
- yes again
- #endif
- #if 0
- #else
- for the third time, yes!
- #endif
- #undef FOO
- #ifndef FOO
- yes, of course
- #endif
diff --git a/dist/Mesa/src/glsl/glcpp/tests/128-space-before-hash.c.expected b/dist/Mesa/src/glsl/glcpp/tests/128-space-before-hash.c.expected
deleted file mode 100644
index 9babb6fb0..000000000
--- a/dist/Mesa/src/glsl/glcpp/tests/128-space-before-hash.c.expected
+++ /dev/null
@@ -1,21 +0,0 @@
-
-#version 300
-#pragma Testing spaces before hash
-
-#line 3
-
-
- yes
-
-
-
- yes again
-
-
-
- for the third time, yes!
-
-
-
- yes, of course
-
diff --git a/dist/Mesa/src/glsl/glcpp/tests/129-define-non-identifier.c b/dist/Mesa/src/glsl/glcpp/tests/129-define-non-identifier.c
deleted file mode 100644
index a229179f1..000000000
--- a/dist/Mesa/src/glsl/glcpp/tests/129-define-non-identifier.c
+++ /dev/null
@@ -1 +0,0 @@
-#define 123 456
diff --git a/dist/Mesa/src/glsl/glcpp/tests/129-define-non-identifier.c.expected b/dist/Mesa/src/glsl/glcpp/tests/129-define-non-identifier.c.expected
deleted file mode 100644
index fd0b41347..000000000
--- a/dist/Mesa/src/glsl/glcpp/tests/129-define-non-identifier.c.expected
+++ /dev/null
@@ -1,2 +0,0 @@
-0:1(9): preprocessor error: #define followed by a non-identifier: 123
-0:1(9): preprocessor error: syntax error, unexpected INTEGER_STRING, expecting FUNC_IDENTIFIER or OBJ_IDENTIFIER
diff --git a/dist/Mesa/src/glsl/glcpp/tests/130-define-comment.c b/dist/Mesa/src/glsl/glcpp/tests/130-define-comment.c
deleted file mode 100644
index 33312362c..000000000
--- a/dist/Mesa/src/glsl/glcpp/tests/130-define-comment.c
+++ /dev/null
@@ -1,2 +0,0 @@
-#define /*...*/ FUNC( /*...*/ x /*...*/ ) /*...*/ FOO( /*...*/ x /*...*/ )
-FUNC(bar)
diff --git a/dist/Mesa/src/glsl/glcpp/tests/130-define-comment.c.expected b/dist/Mesa/src/glsl/glcpp/tests/130-define-comment.c.expected
deleted file mode 100644
index d789e29d5..000000000
--- a/dist/Mesa/src/glsl/glcpp/tests/130-define-comment.c.expected
+++ /dev/null
@@ -1,2 +0,0 @@
-
-FOO( bar )
diff --git a/dist/Mesa/src/glsl/glcpp/tests/131-eof-without-newline.c b/dist/Mesa/src/glsl/glcpp/tests/131-eof-without-newline.c
deleted file mode 100644
index 240292dad..000000000
--- a/dist/Mesa/src/glsl/glcpp/tests/131-eof-without-newline.c
+++ /dev/null
@@ -1 +0,0 @@
-this file ends with no newline \ No newline at end of file
diff --git a/dist/Mesa/src/glsl/glcpp/tests/131-eof-without-newline.c.expected b/dist/Mesa/src/glsl/glcpp/tests/131-eof-without-newline.c.expected
deleted file mode 100644
index 578003063..000000000
--- a/dist/Mesa/src/glsl/glcpp/tests/131-eof-without-newline.c.expected
+++ /dev/null
@@ -1 +0,0 @@
-this file ends with no newline
diff --git a/dist/Mesa/src/glsl/glcpp/tests/132-eof-without-newline-define.c b/dist/Mesa/src/glsl/glcpp/tests/132-eof-without-newline-define.c
deleted file mode 100644
index 6795e35ea..000000000
--- a/dist/Mesa/src/glsl/glcpp/tests/132-eof-without-newline-define.c
+++ /dev/null
@@ -1 +0,0 @@
-#define \ No newline at end of file
diff --git a/dist/Mesa/src/glsl/glcpp/tests/132-eof-without-newline-define.c.expected b/dist/Mesa/src/glsl/glcpp/tests/132-eof-without-newline-define.c.expected
deleted file mode 100644
index 341e5e2aa..000000000
--- a/dist/Mesa/src/glsl/glcpp/tests/132-eof-without-newline-define.c.expected
+++ /dev/null
@@ -1 +0,0 @@
-0:1(1): preprocessor error: #define without macro name
diff --git a/dist/Mesa/src/glsl/glcpp/tests/133-eof-without-newline-comment.c b/dist/Mesa/src/glsl/glcpp/tests/133-eof-without-newline-comment.c
deleted file mode 100644
index 56ec5f722..000000000
--- a/dist/Mesa/src/glsl/glcpp/tests/133-eof-without-newline-comment.c
+++ /dev/null
@@ -1 +0,0 @@
-This file ends with no newline within a comment /* \ No newline at end of file
diff --git a/dist/Mesa/src/glsl/glcpp/tests/133-eof-without-newline-comment.c.expected b/dist/Mesa/src/glsl/glcpp/tests/133-eof-without-newline-comment.c.expected
deleted file mode 100644
index d186f4876..000000000
--- a/dist/Mesa/src/glsl/glcpp/tests/133-eof-without-newline-comment.c.expected
+++ /dev/null
@@ -1,2 +0,0 @@
-0:1(51): preprocessor error: Unterminated comment
-This file ends with no newline within a comment
diff --git a/dist/Mesa/src/glsl/glcpp/tests/134-hash-comment-directive.c b/dist/Mesa/src/glsl/glcpp/tests/134-hash-comment-directive.c
deleted file mode 100644
index 3015f0e88..000000000
--- a/dist/Mesa/src/glsl/glcpp/tests/134-hash-comment-directive.c
+++ /dev/null
@@ -1,22 +0,0 @@
-/*...*/ # /*...*/ version 300
- /*...*/#/*...*/ extension whatever
- /*..*/ # /*..*/ pragma ignored
-/**/ # /**/ line 4
- /*...*/# /*...*/ ifdef NOT_DEFINED
- /*...*/# /*...*/ else
- /*..*/ #/*..*/ endif
- /*...*/# /*...*/ ifndef ALSO_NOT_DEFINED
- /*...*/# /*...*/ else
- /*..*/ #/*..*/ endif
-/*...*/ # /*...*/ if 0
- /*...*/#/*...*/ elif 1
- /*..*/ # /*..*/ else
- /**/ # /**/ endif
- /*...*/# /*...*/ define FOO bar
- /*..*/ #/*..*/ define FUNC() baz
- /*..*/ # /*..*/ define FUNC2(a,b) b a
-FOO
-FUNC()
-FUNC2(x,y)
-
-
diff --git a/dist/Mesa/src/glsl/glcpp/tests/134-hash-comment-directive.c.expected b/dist/Mesa/src/glsl/glcpp/tests/134-hash-comment-directive.c.expected
deleted file mode 100644
index 760c960cb..000000000
--- a/dist/Mesa/src/glsl/glcpp/tests/134-hash-comment-directive.c.expected
+++ /dev/null
@@ -1,22 +0,0 @@
-#version 300
-#extension whatever
-#pragma ignored
-#line 4
-
-
-
-
-
-
-
-
-
-
-
-
-
-bar
-baz
-y x
-
-
diff --git a/dist/Mesa/src/glsl/glcpp/tests/135-duplicate-parameter.c b/dist/Mesa/src/glsl/glcpp/tests/135-duplicate-parameter.c
deleted file mode 100644
index fd96bd64c..000000000
--- a/dist/Mesa/src/glsl/glcpp/tests/135-duplicate-parameter.c
+++ /dev/null
@@ -1,2 +0,0 @@
-#define FOO(a,a) which a?
-#define BAR(x,y,z,x) so very x
diff --git a/dist/Mesa/src/glsl/glcpp/tests/135-duplicate-parameter.c.expected b/dist/Mesa/src/glsl/glcpp/tests/135-duplicate-parameter.c.expected
deleted file mode 100644
index bc1a334ed..000000000
--- a/dist/Mesa/src/glsl/glcpp/tests/135-duplicate-parameter.c.expected
+++ /dev/null
@@ -1,4 +0,0 @@
-0:1(9): preprocessor error: Duplicate macro parameter "a"
-0:2(9): preprocessor error: Duplicate macro parameter "x"
-
-
diff --git a/dist/Mesa/src/glsl/glcpp/tests/136-plus-plus-and-minus-minus.c b/dist/Mesa/src/glsl/glcpp/tests/136-plus-plus-and-minus-minus.c
deleted file mode 100644
index 167d3c8a3..000000000
--- a/dist/Mesa/src/glsl/glcpp/tests/136-plus-plus-and-minus-minus.c
+++ /dev/null
@@ -1,8 +0,0 @@
-/* The body can include C expressions with ++ and -- */
-a = x++;
-b = ++x;
-c = x--;
-d = --x;
-/* But these are not legal in preprocessor expressions. */
-#if x++ > 4
-#endif
diff --git a/dist/Mesa/src/glsl/glcpp/tests/136-plus-plus-and-minus-minus.c.expected b/dist/Mesa/src/glsl/glcpp/tests/136-plus-plus-and-minus-minus.c.expected
deleted file mode 100644
index 137921b16..000000000
--- a/dist/Mesa/src/glsl/glcpp/tests/136-plus-plus-and-minus-minus.c.expected
+++ /dev/null
@@ -1,8 +0,0 @@
-0:7(12): preprocessor error: syntax error, unexpected PLUS_PLUS
-
-a = x++;
-b = ++x;
-c = x--;
-d = --x;
-
-
diff --git a/dist/Mesa/src/glsl/glcpp/tests/137-expand-macro-after-period.c b/dist/Mesa/src/glsl/glcpp/tests/137-expand-macro-after-period.c
deleted file mode 100644
index c8cd47fb5..000000000
--- a/dist/Mesa/src/glsl/glcpp/tests/137-expand-macro-after-period.c
+++ /dev/null
@@ -1,4 +0,0 @@
-#define FIELD(x) foo.x
-#define FIELD_OF(s, x) s.x
-FIELD(bar)
-FIELD_OF(foo, bar)
diff --git a/dist/Mesa/src/glsl/glcpp/tests/137-expand-macro-after-period.c.expected b/dist/Mesa/src/glsl/glcpp/tests/137-expand-macro-after-period.c.expected
deleted file mode 100644
index f9f5be13e..000000000
--- a/dist/Mesa/src/glsl/glcpp/tests/137-expand-macro-after-period.c.expected
+++ /dev/null
@@ -1,4 +0,0 @@
-
-
-foo.bar
-foo.bar
diff --git a/dist/Mesa/src/glsl/glcpp/tests/138-multi-line-comment-in-if-0.c b/dist/Mesa/src/glsl/glcpp/tests/138-multi-line-comment-in-if-0.c
deleted file mode 100644
index 38967dc57..000000000
--- a/dist/Mesa/src/glsl/glcpp/tests/138-multi-line-comment-in-if-0.c
+++ /dev/null
@@ -1,7 +0,0 @@
-#if 0
-/*
- * This multi-line comment needs to be 3 lines to test what's intended.
- */
-#else
-SUCCESS
-#endif
diff --git a/dist/Mesa/src/glsl/glcpp/tests/138-multi-line-comment-in-if-0.c.expected b/dist/Mesa/src/glsl/glcpp/tests/138-multi-line-comment-in-if-0.c.expected
deleted file mode 100644
index 0d6ef4d9a..000000000
--- a/dist/Mesa/src/glsl/glcpp/tests/138-multi-line-comment-in-if-0.c.expected
+++ /dev/null
@@ -1,7 +0,0 @@
-
-
-
-
-
-SUCCESS
-
diff --git a/dist/Mesa/src/glsl/glcpp/tests/139-define-without-macro-name.c b/dist/Mesa/src/glsl/glcpp/tests/139-define-without-macro-name.c
deleted file mode 100644
index 30e128db4..000000000
--- a/dist/Mesa/src/glsl/glcpp/tests/139-define-without-macro-name.c
+++ /dev/null
@@ -1,5 +0,0 @@
-#define
-#define
-#define /*...*/
-#define //...
-Errors expected because no macro name is ever given!
diff --git a/dist/Mesa/src/glsl/glcpp/tests/139-define-without-macro-name.c.expected b/dist/Mesa/src/glsl/glcpp/tests/139-define-without-macro-name.c.expected
deleted file mode 100644
index 42b02d1a8..000000000
--- a/dist/Mesa/src/glsl/glcpp/tests/139-define-without-macro-name.c.expected
+++ /dev/null
@@ -1,5 +0,0 @@
-0:1(1): preprocessor error: #define without macro name
-0:2(1): preprocessor error: #define without macro name
-0:3(1): preprocessor error: #define without macro name
-0:4(1): preprocessor error: #define without macro name
-Errors expected because no macro name is ever given!
diff --git a/dist/Mesa/src/glsl/glcpp/tests/140-null-directive.c b/dist/Mesa/src/glsl/glcpp/tests/140-null-directive.c
deleted file mode 100644
index 1dcb26ef8..000000000
--- a/dist/Mesa/src/glsl/glcpp/tests/140-null-directive.c
+++ /dev/null
@@ -1,9 +0,0 @@
-/* GLSL accepts a null directive. Let's test that in several variations: */
-#
- #
-/*....*/#/*....*/
- /*..*/ # /*..*/
-#//...
- # //...
-/*....*/#/**///..
- /*..*/ # /**/ //
diff --git a/dist/Mesa/src/glsl/glcpp/tests/140-null-directive.c.expected b/dist/Mesa/src/glsl/glcpp/tests/140-null-directive.c.expected
deleted file mode 100644
index fa103f60e..000000000
--- a/dist/Mesa/src/glsl/glcpp/tests/140-null-directive.c.expected
+++ /dev/null
@@ -1,9 +0,0 @@
-
-
-
-
-
-
-
-
-
diff --git a/dist/Mesa/src/glsl/glcpp/tests/141-pragma-and-__LINE__.c b/dist/Mesa/src/glsl/glcpp/tests/141-pragma-and-__LINE__.c
deleted file mode 100644
index a93f3ce35..000000000
--- a/dist/Mesa/src/glsl/glcpp/tests/141-pragma-and-__LINE__.c
+++ /dev/null
@@ -1,6 +0,0 @@
-Line 1 /* Test for a bug where #pragma was throwing off the __LINE__ count. */
-Line __LINE__ /* Line 2 */
-#pragma Line 3
-Line __LINE__ /* Line 4 */
-#pragma Line 5
-Line __LINE__ /* Line 6 */
diff --git a/dist/Mesa/src/glsl/glcpp/tests/141-pragma-and-__LINE__.c.expected b/dist/Mesa/src/glsl/glcpp/tests/141-pragma-and-__LINE__.c.expected
deleted file mode 100644
index 330731dc8..000000000
--- a/dist/Mesa/src/glsl/glcpp/tests/141-pragma-and-__LINE__.c.expected
+++ /dev/null
@@ -1,6 +0,0 @@
-Line 1
-Line 2
-#pragma Line 3
-Line 4
-#pragma Line 5
-Line 6
diff --git a/dist/Mesa/src/glsl/glcpp/tests/142-defined-within-macro.c b/dist/Mesa/src/glsl/glcpp/tests/142-defined-within-macro.c
deleted file mode 100644
index b60c04232..000000000
--- a/dist/Mesa/src/glsl/glcpp/tests/142-defined-within-macro.c
+++ /dev/null
@@ -1,94 +0,0 @@
-/* Macro using defined with a hard-coded identifier (no parentheses) */
-#define is_foo_defined defined /*...*/ foo
-#undef foo
-#if is_foo_defined
-failure
-#else
-success
-#endif
-#define foo
-#if is_foo_defined
-success
-#else
-failure
-#endif
-
-/* Macro using defined with a hard-coded identifier within parentheses */
-#define is_foo_defined_parens defined /*...*/ ( /*...*/ foo /*...*/ ) //
-#define foo
-#if is_foo_defined_parens
-success
-#else
-failure
-#endif
-#undef foo
-#if is_foo_defined_parens
-failure
-#else
-success
-#endif
-
-/* Macro using defined with an argument identifier (no parentheses) */
-#define is_defined(arg) defined /*...*/ arg
-#define foo bar
-#undef bar
-#if is_defined(foo)
-failure
-#else
-success
-#endif
-#define bar bar
-#if is_defined(foo)
-success
-#else
-failure
-#endif
-
-/* Macro using defined with an argument identifier within parentheses */
-#define is_defined_parens(arg) defined /*...*/ ( /*...*/ arg /*...*/ ) //
-#define foo bar
-#define bar bar
-#if is_defined_parens(foo)
-success
-#else
-failure
-#endif
-#undef bar
-#if is_defined_parens(foo)
-failure
-#else
-success
-#endif
-
-/* Multiple levels of macro resulting in defined */
-#define X defined A && Y
-#define Y defined B && Z
-#define Z defined C
-#define A
-#define B
-#define C
-#if X
-success
-#else
-failure
-#endif
-#undef A
-#if X
-failure
-#else
-success
-#endif
-#define A
-#undef B
-#if X
-failure
-#else
-success
-#endif
-#define B
-#undef C
-#if X
-failure
-#else
-success
-#endif
diff --git a/dist/Mesa/src/glsl/glcpp/tests/142-defined-within-macro.c.expected b/dist/Mesa/src/glsl/glcpp/tests/142-defined-within-macro.c.expected
deleted file mode 100644
index 4eca90bc3..000000000
--- a/dist/Mesa/src/glsl/glcpp/tests/142-defined-within-macro.c.expected
+++ /dev/null
@@ -1,94 +0,0 @@
-
-
-
-
-
-
-success
-
-
-
-success
-
-
-
-
-
-
-
-
-success
-
-
-
-
-
-
-
-success
-
-
-
-
-
-
-
-
-
-success
-
-
-
-success
-
-
-
-
-
-
-
-
-
-success
-
-
-
-
-
-
-
-success
-
-
-
-
-
-
-
-
-
-
-success
-
-
-
-
-
-
-
-success
-
-
-
-
-
-
-success
-
-
-
-
-
-
-success
-
diff --git a/dist/Mesa/src/glsl/glcpp/tests/glcpp-test b/dist/Mesa/src/glsl/glcpp/tests/glcpp-test
index ea69edfd8..2d2687fc6 100644
--- a/dist/Mesa/src/glsl/glcpp/tests/glcpp-test
+++ b/dist/Mesa/src/glsl/glcpp/tests/glcpp-test
@@ -19,7 +19,6 @@ Run the test suite for mesa's GLSL pre-processor.
Valid options include:
- --testdir=<DIR> Use tests in the given <DIR> (default is ".")
--valgrind Run the test suite a second time under valgrind
EOF
}
@@ -28,29 +27,22 @@ test_specific_args ()
{
test="$1"
- tr "\r" "\n" < "$test" | grep 'glcpp-args:' | sed -e 's,^.*glcpp-args: *,,'
+ grep 'glcpp-args:' "$test" | sed -e 's,^.*glcpp-args: *,,'
}
# Parse command-line options
for option; do
- case "${option}" in
- "--help")
- usage
- exit 0
- ;;
- "--valgrind")
- do_valgrind=yes
- ;;
- "--testdir="*)
- testdir="${option#--testdir=}"
- ;;
- *)
- echo "Unrecognized option: $option" >&2
- echo >&2
- usage
- exit 1
- ;;
- esac
+ if [ "${option}" = '--help' ] ; then
+ usage
+ exit 0
+ elif [ "${option}" = '--valgrind' ] ; then
+ do_valgrind=yes
+ else
+ echo "Unrecognized option: $option" >&2
+ echo >&2
+ usage
+ exit 1
+ fi
done
total=0
@@ -59,7 +51,7 @@ clean=0
echo "====== Testing for correctness ======"
for test in $testdir/*.c; do
- printf "Testing $test..."
+ echo -n "Testing $test..."
$glcpp $(test_specific_args $test) < $test > $test.out 2>&1
total=$((total+1))
if cmp $test.expected $test.out >/dev/null 2>&1; then
@@ -78,7 +70,7 @@ echo ""
if [ "$do_valgrind" = "yes" ]; then
echo "====== Testing for valgrind cleanliness ======"
for test in $testdir/*.c; do
- printf "Testing $test with valgrind..."
+ echo -n "Testing $test with valgrind..."
valgrind --error-exitcode=31 --log-file=$test.valgrind-errors $glcpp $(test_specific_args $test) < $test >/dev/null 2>&1
if [ "$?" = "31" ]; then
echo "ERRORS"
diff --git a/dist/Mesa/src/glsl/glcpp/tests/glcpp-test-cr-lf b/dist/Mesa/src/glsl/glcpp/tests/glcpp-test-cr-lf
deleted file mode 100755
index 7988c0587..000000000
--- a/dist/Mesa/src/glsl/glcpp/tests/glcpp-test-cr-lf
+++ /dev/null
@@ -1,141 +0,0 @@
-#!/bin/sh
-
-# The build system runs this test from a different working directory, and may
-# be in a build directory entirely separate from the source. So if the
-# "srcdir" variable is set, we must use it to locate the test files and the
-# glcpp-test script.
-
-if [ ! -z "$srcdir" ]; then
- testdir="$srcdir/glcpp/tests"
- glcpp_test="$srcdir/glcpp/tests/glcpp-test"
-else
- testdir=.
- glcpp_test=./glcpp-test
-fi
-
-total=0
-pass=0
-
-# This supports a pipe that doesn't destroy the exit status of first command
-#
-# http://unix.stackexchange.com/questions/14270/get-exit-status-of-process-thats-piped-to-another
-stdintoexitstatus() {
- read exitstatus
- return $exitstatus
-}
-
-run_test ()
-{
- cmd="$1"
-
- total=$((total+1))
-
- if [ "$VERBOSE" = "yes" ]; then
- if $cmd; then
- echo "PASS"
- pass=$((pass+1))
- else
- echo "FAIL"
- fi
- else
- # This is "$cmd | tail -2" but with the exit status of "$cmd" not "tail -2"
- if (((($cmd; echo $? >&3) | tail -2 | head -1 >&4) 3>&1) | stdintoexitstatus) 4>&1; then
- echo "PASS"
- pass=$((pass+1))
- else
- echo "FAIL"
- fi
- fi
-}
-
-usage ()
-{
- cat <<EOF
-Usage: glcpp-cr-lf [options...]
-
-Run the entire glcpp-test suite several times, each time with each source
-file transformed to use a non-standard line-termination character. Each
-entire run with a different line-termination character is considered a
-single test.
-
-Valid options include:
-
- -v|--verbose Print all output from the various sub-tests
-EOF
-}
-
-# Parse command-line options
-for option; do
- case "${option}" in
- -v|--verbose)
- VERBOSE=yes;
- ;;
- *)
- echo "Unrecognized option: $option" >&2
- echo >&2
- usage
- exit 1
- ;;
- esac
-done
-
-# All tests depend on the .out files being present. So first do a
-# normal run of the test suite, (silently) just to create the .out
-# files as a side effect.
-rm -rf ./subtest-lf
-mkdir subtest-lf
-for file in "$testdir"/*.c; do
- base=$(basename "$file")
- cp "$file" subtest-lf
-done
-
-${glcpp_test} --testdir=subtest-lf >/dev/null 2>&1
-
-echo "===== Testing with \\\\r line terminators (old Mac format) ====="
-
-# Prepare test files with '\r' instead of '\n'
-rm -rf ./subtest-cr
-mkdir subtest-cr
-for file in "$testdir"/*.c; do
- base=$(basename "$file")
- tr "\n" "\r" < "$file" > subtest-cr/"$base"
- cp subtest-lf/"$base".out subtest-cr/"$base".expected
-done
-
-run_test "${glcpp_test} --testdir=subtest-cr"
-
-echo "===== Testing with \\\\r\\\\n line terminators (DOS format) ====="
-
-# Prepare test files with '\r\n' instead of '\n'
-rm -rf ./subtest-cr-lf
-mkdir subtest-cr-lf
-for file in "$testdir"/*.c; do
- base=$(basename "$file")
- sed -e 's/$/ /' < "$file" > subtest-cr-lf/"$base"
- cp subtest-lf/"$base".out subtest-cr-lf/"$base".expected
-done
-
-run_test "${glcpp_test} --testdir=subtest-cr-lf"
-
-echo "===== Testing with \\\\n\\\\r (bizarre, but allowed by GLSL spec.) ====="
-
-# Prepare test files with '\n\r' instead of '\n'
-rm -rf ./subtest-lf-cr
-mkdir subtest-lf-cr
-for file in "$testdir"/*.c; do
- base=$(basename "$file")
- sed -e 's/$/ /' < "$file" | tr "\n\r" "\r\n" > subtest-lf-cr/"$base"
- cp subtest-lf/"$base".out subtest-lf-cr/"$base".expected
-done
-
-run_test "${glcpp_test} --testdir=subtest-lf-cr"
-
-echo ""
-echo "$pass/$total tests returned correct results"
-echo ""
-
-if [ "$pass" = "$total" ]; then
- exit 0
-else
- exit 1
-fi
diff --git a/dist/Mesa/src/glsl/glsl_lexer.cpp b/dist/Mesa/src/glsl/glsl_lexer.cpp
index 0b9116035..0cd3cd302 100644
--- a/dist/Mesa/src/glsl/glsl_lexer.cpp
+++ b/dist/Mesa/src/glsl/glsl_lexer.cpp
@@ -351,8 +351,8 @@ static void yy_fatal_error (yyconst char msg[] ,yyscan_t yyscanner );
*yy_cp = '\0'; \
yyg->yy_c_buf_p = yy_cp;
-#define YY_NUM_RULES 248
-#define YY_END_OF_BUFFER 249
+#define YY_NUM_RULES 246
+#define YY_END_OF_BUFFER 247
/* This struct is not used in this scanner,
but its presence is necessary. */
struct yy_trans_info
@@ -360,119 +360,119 @@ struct yy_trans_info
flex_int32_t yy_verify;
flex_int32_t yy_nxt;
};
-static yyconst flex_int16_t yy_accept[1009] =
+static yyconst flex_int16_t yy_accept[1008] =
{ 0,
- 0, 0, 16, 16, 0, 0, 249, 247, 1, 22,
- 247, 247, 247, 247, 247, 247, 247, 247, 176, 174,
- 247, 247, 247, 246, 247, 246, 246, 246, 246, 246,
- 246, 246, 246, 246, 246, 246, 246, 246, 246, 246,
- 246, 246, 246, 246, 246, 247, 1, 247, 21, 16,
- 20, 21, 19, 17, 18, 14, 13, 1, 158, 167,
- 159, 170, 164, 153, 166, 154, 173, 178, 165, 179,
- 176, 0, 0, 181, 176, 0, 174, 174, 162, 155,
- 157, 156, 163, 246, 171, 161, 246, 246, 246, 246,
- 246, 246, 246, 246, 246, 246, 246, 246, 31, 246,
-
- 246, 246, 246, 246, 246, 246, 246, 246, 246, 246,
- 246, 246, 35, 246, 246, 62, 246, 246, 246, 246,
- 246, 246, 246, 246, 246, 246, 246, 246, 246, 246,
- 246, 246, 246, 246, 246, 246, 246, 246, 246, 246,
- 246, 246, 246, 246, 246, 246, 246, 246, 246, 246,
- 172, 160, 1, 0, 0, 2, 0, 0, 0, 0,
- 16, 15, 19, 18, 0, 178, 177, 0, 179, 0,
- 180, 175, 168, 169, 246, 184, 246, 246, 246, 246,
- 246, 246, 246, 246, 246, 246, 246, 246, 246, 246,
- 246, 246, 246, 246, 246, 246, 246, 246, 246, 34,
-
- 246, 246, 246, 246, 246, 246, 246, 246, 246, 246,
- 27, 246, 246, 246, 246, 246, 246, 246, 246, 246,
- 246, 246, 63, 246, 246, 246, 246, 246, 246, 246,
- 246, 246, 246, 246, 246, 246, 246, 246, 246, 246,
- 246, 246, 246, 246, 246, 246, 246, 246, 246, 246,
- 246, 246, 246, 246, 246, 246, 246, 246, 0, 0,
- 0, 0, 15, 0, 178, 0, 177, 0, 179, 180,
- 175, 246, 246, 246, 25, 246, 246, 230, 223, 246,
- 246, 246, 246, 246, 246, 246, 246, 246, 246, 33,
- 187, 246, 246, 246, 246, 69, 246, 246, 192, 205,
-
- 246, 246, 246, 246, 246, 246, 246, 246, 246, 246,
- 246, 246, 202, 226, 50, 51, 52, 246, 246, 246,
- 246, 246, 246, 246, 246, 246, 246, 246, 246, 246,
- 246, 246, 246, 246, 246, 246, 246, 246, 246, 246,
- 246, 246, 190, 182, 246, 246, 28, 246, 246, 246,
- 246, 246, 246, 246, 47, 48, 49, 151, 246, 246,
- 246, 0, 0, 0, 0, 0, 177, 246, 246, 246,
- 29, 38, 39, 40, 246, 185, 246, 246, 24, 246,
- 246, 246, 246, 213, 214, 215, 246, 183, 246, 206,
- 26, 216, 217, 218, 228, 210, 211, 212, 246, 246,
-
- 246, 64, 208, 246, 246, 246, 41, 42, 43, 246,
- 246, 246, 246, 246, 246, 246, 246, 246, 246, 246,
- 243, 246, 246, 246, 246, 246, 246, 246, 246, 203,
- 246, 246, 246, 246, 246, 246, 246, 246, 246, 246,
- 246, 186, 246, 246, 225, 44, 45, 46, 246, 246,
- 32, 246, 0, 0, 0, 0, 233, 246, 246, 246,
- 246, 231, 246, 246, 246, 204, 199, 236, 246, 246,
- 246, 246, 246, 246, 195, 246, 246, 246, 152, 53,
- 54, 55, 56, 57, 58, 59, 60, 61, 246, 246,
- 246, 246, 209, 191, 246, 246, 197, 246, 246, 246,
-
- 37, 246, 244, 222, 70, 198, 150, 246, 234, 193,
- 246, 246, 246, 246, 246, 246, 246, 246, 246, 0,
- 0, 0, 0, 246, 246, 246, 246, 246, 194, 36,
- 246, 246, 246, 246, 246, 246, 107, 108, 109, 246,
- 246, 246, 246, 246, 227, 246, 246, 246, 246, 106,
- 246, 246, 246, 246, 246, 246, 246, 246, 188, 246,
- 246, 246, 246, 246, 65, 246, 246, 66, 246, 246,
- 0, 0, 0, 0, 0, 246, 246, 67, 144, 30,
- 200, 118, 119, 120, 246, 246, 246, 246, 246, 246,
- 246, 246, 246, 246, 246, 246, 246, 246, 196, 246,
-
- 246, 246, 147, 242, 146, 246, 246, 246, 246, 246,
- 246, 246, 246, 189, 129, 130, 131, 246, 246, 207,
- 246, 145, 246, 0, 0, 6, 0, 0, 0, 12,
- 3, 246, 23, 246, 246, 246, 246, 246, 246, 246,
- 246, 246, 116, 246, 246, 246, 111, 201, 68, 246,
- 246, 246, 246, 246, 224, 246, 232, 229, 237, 72,
- 73, 74, 246, 246, 246, 246, 246, 246, 246, 246,
- 246, 246, 246, 246, 246, 246, 246, 148, 0, 0,
- 0, 0, 0, 0, 0, 246, 246, 246, 127, 246,
- 246, 122, 246, 246, 246, 246, 246, 246, 246, 246,
-
- 83, 84, 85, 246, 246, 246, 246, 246, 246, 246,
- 246, 246, 246, 246, 246, 246, 245, 246, 246, 138,
- 246, 246, 133, 89, 90, 91, 246, 246, 4, 0,
- 5, 0, 0, 0, 0, 0, 0, 149, 246, 246,
- 246, 246, 246, 246, 246, 246, 246, 246, 110, 246,
- 112, 246, 246, 246, 246, 246, 246, 246, 246, 246,
- 246, 246, 95, 246, 246, 246, 246, 75, 246, 246,
- 246, 246, 246, 246, 246, 246, 246, 246, 246, 246,
- 246, 0, 0, 0, 0, 246, 246, 246, 121, 123,
- 246, 113, 246, 114, 246, 246, 246, 246, 246, 96,
-
- 246, 246, 86, 246, 246, 246, 246, 246, 246, 246,
- 246, 246, 246, 246, 246, 246, 246, 246, 132, 134,
- 246, 246, 246, 97, 246, 246, 92, 0, 0, 0,
- 124, 125, 246, 246, 246, 140, 246, 246, 141, 246,
- 246, 246, 246, 246, 246, 246, 71, 246, 246, 246,
- 246, 219, 246, 220, 235, 246, 246, 246, 135, 136,
- 246, 246, 246, 246, 246, 246, 246, 246, 0, 0,
- 0, 246, 246, 246, 246, 117, 115, 246, 246, 246,
- 238, 240, 246, 76, 246, 77, 246, 246, 246, 246,
- 246, 246, 246, 246, 246, 246, 246, 239, 241, 246,
-
- 0, 0, 0, 0, 128, 126, 246, 246, 87, 88,
- 246, 246, 246, 78, 246, 246, 246, 79, 246, 246,
- 246, 139, 137, 93, 94, 246, 246, 0, 0, 0,
- 0, 246, 246, 246, 246, 246, 246, 98, 246, 101,
- 246, 246, 246, 246, 0, 0, 0, 0, 246, 246,
- 99, 102, 246, 246, 246, 246, 80, 246, 100, 103,
- 0, 0, 0, 7, 0, 0, 142, 143, 246, 246,
- 246, 246, 105, 0, 0, 8, 0, 0, 246, 246,
- 221, 246, 0, 0, 0, 81, 82, 246, 0, 0,
- 0, 9, 246, 0, 0, 10, 104, 0, 0, 0,
-
- 0, 0, 0, 0, 0, 0, 11, 0
+ 0, 0, 16, 16, 0, 0, 247, 245, 1, 21,
+ 245, 245, 245, 245, 245, 245, 245, 245, 174, 172,
+ 245, 245, 245, 244, 245, 244, 244, 244, 244, 244,
+ 244, 244, 244, 244, 244, 244, 244, 244, 244, 244,
+ 244, 244, 244, 244, 244, 245, 1, 245, 246, 16,
+ 20, 246, 19, 17, 18, 14, 13, 1, 156, 165,
+ 157, 168, 162, 151, 164, 152, 171, 176, 163, 177,
+ 174, 0, 0, 179, 174, 0, 172, 172, 160, 153,
+ 155, 154, 161, 244, 169, 159, 244, 244, 244, 244,
+ 244, 244, 244, 244, 244, 244, 244, 244, 30, 244,
+
+ 244, 244, 244, 244, 244, 244, 244, 244, 244, 244,
+ 244, 244, 34, 244, 244, 61, 244, 244, 244, 244,
+ 244, 244, 244, 244, 244, 244, 244, 244, 244, 244,
+ 244, 244, 244, 244, 244, 244, 244, 244, 244, 244,
+ 244, 244, 244, 244, 244, 244, 244, 244, 244, 244,
+ 170, 158, 1, 0, 0, 2, 0, 0, 0, 0,
+ 16, 15, 19, 18, 0, 176, 175, 0, 177, 0,
+ 178, 173, 166, 167, 244, 182, 244, 244, 244, 244,
+ 244, 244, 244, 244, 244, 244, 244, 244, 244, 244,
+ 244, 244, 244, 244, 244, 244, 244, 244, 244, 33,
+
+ 244, 244, 244, 244, 244, 244, 244, 244, 244, 244,
+ 26, 244, 244, 244, 244, 244, 244, 244, 244, 244,
+ 244, 244, 62, 244, 244, 244, 244, 244, 244, 244,
+ 244, 244, 244, 244, 244, 244, 244, 244, 244, 244,
+ 244, 244, 244, 244, 244, 244, 244, 244, 244, 244,
+ 244, 244, 244, 244, 244, 244, 244, 244, 0, 0,
+ 0, 0, 15, 0, 176, 0, 175, 0, 177, 178,
+ 173, 244, 244, 244, 24, 244, 244, 228, 221, 244,
+ 244, 244, 244, 244, 244, 244, 244, 244, 244, 32,
+ 185, 244, 244, 244, 244, 68, 244, 244, 190, 203,
+
+ 244, 244, 244, 244, 244, 244, 244, 244, 244, 244,
+ 244, 244, 200, 224, 49, 50, 51, 244, 244, 244,
+ 244, 244, 244, 244, 244, 244, 244, 244, 244, 244,
+ 244, 244, 244, 244, 244, 244, 244, 244, 244, 244,
+ 244, 244, 188, 180, 244, 244, 27, 244, 244, 244,
+ 244, 244, 244, 244, 46, 47, 48, 149, 244, 244,
+ 244, 0, 0, 0, 0, 0, 175, 244, 244, 244,
+ 28, 37, 38, 39, 244, 183, 244, 244, 23, 244,
+ 244, 244, 244, 211, 212, 213, 244, 181, 244, 204,
+ 25, 214, 215, 216, 226, 208, 209, 210, 244, 244,
+
+ 244, 63, 206, 244, 244, 244, 40, 41, 42, 244,
+ 244, 244, 244, 244, 244, 244, 244, 244, 244, 244,
+ 241, 244, 244, 244, 244, 244, 244, 244, 244, 201,
+ 244, 244, 244, 244, 244, 244, 244, 244, 244, 244,
+ 244, 184, 244, 244, 223, 43, 44, 45, 244, 244,
+ 31, 244, 0, 0, 0, 0, 231, 244, 244, 244,
+ 244, 229, 244, 244, 244, 202, 197, 234, 244, 244,
+ 244, 244, 244, 244, 193, 244, 244, 244, 150, 52,
+ 53, 54, 55, 56, 57, 58, 59, 60, 244, 244,
+ 244, 244, 207, 189, 244, 244, 195, 244, 244, 244,
+
+ 36, 244, 242, 220, 69, 196, 148, 244, 232, 191,
+ 244, 244, 244, 244, 244, 244, 244, 244, 244, 0,
+ 0, 0, 0, 244, 244, 244, 244, 244, 192, 35,
+ 244, 244, 244, 244, 244, 244, 105, 106, 107, 244,
+ 244, 244, 244, 244, 225, 244, 244, 244, 244, 244,
+ 244, 244, 244, 244, 244, 244, 244, 186, 244, 244,
+ 244, 244, 244, 64, 244, 244, 65, 244, 244, 0,
+ 0, 0, 0, 0, 244, 244, 66, 142, 29, 198,
+ 116, 117, 118, 244, 244, 244, 244, 244, 244, 244,
+ 244, 244, 244, 244, 244, 244, 244, 194, 244, 244,
+
+ 244, 145, 240, 144, 244, 244, 244, 244, 244, 244,
+ 244, 244, 187, 127, 128, 129, 244, 244, 205, 244,
+ 143, 244, 0, 0, 6, 0, 0, 0, 12, 3,
+ 244, 22, 244, 244, 244, 244, 244, 244, 244, 244,
+ 244, 114, 244, 244, 244, 109, 199, 67, 244, 244,
+ 244, 244, 244, 222, 244, 230, 227, 235, 71, 72,
+ 73, 244, 244, 244, 244, 244, 244, 244, 244, 244,
+ 244, 244, 244, 244, 244, 244, 146, 0, 0, 0,
+ 0, 0, 0, 0, 244, 244, 244, 125, 244, 244,
+ 120, 244, 244, 244, 244, 244, 244, 244, 244, 82,
+
+ 83, 84, 244, 244, 244, 244, 244, 244, 244, 244,
+ 244, 244, 244, 244, 244, 243, 244, 244, 136, 244,
+ 244, 131, 88, 89, 90, 244, 244, 4, 0, 5,
+ 0, 0, 0, 0, 0, 0, 147, 244, 244, 244,
+ 244, 244, 244, 244, 244, 244, 244, 108, 244, 110,
+ 244, 244, 244, 244, 244, 244, 244, 244, 244, 244,
+ 244, 94, 244, 244, 244, 244, 74, 244, 244, 244,
+ 244, 244, 244, 244, 244, 244, 244, 244, 244, 244,
+ 0, 0, 0, 0, 244, 244, 244, 119, 121, 244,
+ 111, 244, 112, 244, 244, 244, 244, 244, 95, 244,
+
+ 244, 85, 244, 244, 244, 244, 244, 244, 244, 244,
+ 244, 244, 244, 244, 244, 244, 244, 130, 132, 244,
+ 244, 244, 96, 244, 244, 91, 0, 0, 0, 122,
+ 123, 244, 244, 244, 138, 244, 244, 139, 244, 244,
+ 244, 244, 244, 244, 244, 70, 244, 244, 244, 244,
+ 217, 244, 218, 233, 244, 244, 244, 133, 134, 244,
+ 244, 244, 244, 244, 244, 244, 244, 0, 0, 0,
+ 244, 244, 244, 244, 115, 113, 244, 244, 244, 236,
+ 238, 244, 75, 244, 76, 244, 244, 244, 244, 244,
+ 244, 244, 244, 244, 244, 244, 237, 239, 244, 0,
+
+ 0, 0, 0, 126, 124, 244, 244, 86, 87, 244,
+ 244, 244, 77, 244, 244, 244, 78, 244, 244, 244,
+ 137, 135, 92, 93, 244, 244, 0, 0, 0, 0,
+ 244, 244, 244, 244, 244, 244, 97, 244, 100, 244,
+ 244, 244, 244, 0, 0, 0, 0, 244, 244, 98,
+ 101, 244, 244, 244, 244, 79, 244, 99, 102, 0,
+ 0, 0, 7, 0, 0, 140, 141, 244, 244, 244,
+ 244, 104, 0, 0, 8, 0, 0, 244, 244, 219,
+ 244, 0, 0, 0, 80, 81, 244, 0, 0, 0,
+ 9, 244, 0, 0, 10, 103, 0, 0, 0, 0,
+
+ 0, 0, 0, 0, 0, 11, 0
} ;
static yyconst flex_int32_t yy_ec[256] =
@@ -518,239 +518,239 @@ static yyconst flex_int32_t yy_meta[71] =
5, 5, 5, 5, 5, 5, 5, 5, 5, 1
} ;
-static yyconst flex_int16_t yy_base[1019] =
+static yyconst flex_int16_t yy_base[1018] =
{ 0,
- 0, 69, 75, 145, 1378, 1377, 1379, 1382, 70, 1382,
- 1353, 1352, 94, 1351, 91, 92, 90, 1350, 202, 256,
- 89, 1349, 95, 0, 79, 68, 64, 79, 124, 76,
- 131, 1314, 127, 141, 81, 88, 82, 1308, 136, 126,
- 183, 177, 149, 168, 134, 180, 206, 251, 1382, 140,
- 1382, 1356, 239, 1382, 0, 1382, 1382, 228, 1382, 1382,
- 1382, 1382, 1382, 1382, 1382, 1382, 1382, 231, 1382, 233,
- 137, 307, 273, 1382, 1382, 0, 0, 1382, 1345, 1382,
- 1382, 1382, 1344, 0, 1382, 1382, 1305, 1310, 115, 1307,
- 1316, 1315, 1301, 1304, 1316, 244, 1310, 1297, 1294, 1308,
-
- 1294, 1291, 1291, 1297, 126, 180, 1291, 1302, 1287, 1293,
- 1297, 1298, 0, 1289, 1300, 254, 1299, 1294, 1274, 143,
- 1278, 1292, 1282, 188, 1275, 271, 1288, 1290, 285, 1269,
- 1277, 1274, 1263, 1272, 223, 252, 1277, 1272, 1275, 1263,
- 1266, 246, 246, 226, 1276, 1263, 1276, 83, 1269, 1268,
- 1382, 1382, 329, 334, 340, 1382, 1253, 1266, 1257, 1268,
- 342, 0, 333, 0, 346, 1382, 329, 390, 1382, 353,
- 397, 281, 1382, 1382, 1263, 0, 1258, 1253, 1257, 1267,
- 1264, 328, 1247, 1247, 1259, 1250, 278, 1261, 1258, 1258,
- 1256, 1253, 1244, 1251, 1237, 1235, 1248, 1233, 1250, 0,
-
- 1247, 1234, 1242, 1239, 1243, 1244, 1237, 1234, 1222, 1221,
- 1235, 1238, 1225, 1234, 1221, 1228, 1218, 362, 1224, 1227,
- 1217, 1225, 1213, 1217, 1208, 1223, 1222, 1212, 1219, 325,
- 1202, 1221, 1204, 1202, 1213, 1202, 1197, 1195, 1197, 1208,
- 1193, 1195, 1192, 1204, 1203, 1206, 1187, 326, 1196, 1191,
- 1189, 1199, 1177, 402, 1196, 1198, 1186, 1178, 1177, 1181,
- 1193, 1176, 0, 414, 421, 438, 1382, 445, 456, 1382,
- 1382, 1171, 1182, 1181, 0, 1178, 405, 0, 0, 1171,
- 1169, 1169, 1170, 1165, 1174, 1162, 1180, 1168, 408, 0,
- 0, 1162, 1173, 1172, 1172, 0, 1156, 426, 0, 0,
-
- 1158, 450, 1166, 1167, 1157, 1151, 1150, 1151, 1150, 1150,
- 461, 1145, 0, 0, 1141, 1140, 1139, 1141, 1142, 1147,
- 1141, 1137, 1151, 1146, 1146, 1144, 1143, 1136, 1130, 1132,
- 1131, 1134, 1134, 1126, 1129, 1124, 1133, 1138, 1125, 1122,
- 1135, 1125, 0, 0, 1132, 1128, 0, 1119, 1119, 1125,
- 1115, 1123, 464, 1120, 0, 0, 0, 0, 1109, 1122,
- 1121, 1120, 1119, 1116, 1104, 473, 480, 1116, 1117, 1117,
- 0, 0, 0, 0, 1103, 0, 1112, 1102, 0, 1101,
- 1102, 1096, 1107, 0, 0, 0, 1097, 0, 1093, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 1104, 486,
-
- 1103, 0, 0, 1101, 1097, 1093, 0, 0, 0, 1085,
- 467, 489, 498, 1090, 1086, 1092, 1082, 1080, 1094, 1078,
- 0, 1078, 1092, 1080, 1076, 1083, 1077, 1089, 1084, 0,
- 1082, 1079, 1083, 1066, 1064, 1067, 1074, 1080, 1075, 1074,
- 1061, 0, 1063, 1064, 0, 0, 0, 0, 1061, 1065,
- 0, 1058, 1058, 1113, 1057, 1060, 0, 1068, 1047, 1057,
- 1051, 0, 1044, 1044, 1058, 0, 1060, 0, 503, 1074,
- 1073, 1072, 1037, 1036, 0, 1054, 1053, 1048, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 1036, 1050,
- 1036, 1033, 0, 0, 1039, 344, 0, 1035, 1043, 1042,
-
- 0, 1034, 1026, 0, 0, 0, 0, 1023, 0, 0,
- 1022, 1034, 506, 1026, 1033, 1032, 1029, 1023, 1020, 1015,
- 524, 1031, 1016, 1010, 1010, 1024, 1008, 1021, 0, 0,
- 1013, 1038, 1037, 1036, 1001, 1000, 359, 500, 0, 1013,
- 1016, 1014, 1002, 998, 0, 1011, 1008, 1007, 996, 0,
- 995, 985, 1003, 988, 991, 530, 996, 999, 0, 1017,
- 1016, 1015, 980, 979, 0, 994, 980, 0, 991, 983,
- 985, 548, 554, 1035, 978, 982, 985, 0, 0, 0,
- 0, 1006, 550, 0, 982, 985, 969, 977, 967, 988,
- 977, 973, 974, 974, 973, 958, 563, 971, 0, 972,
-
- 960, 959, 0, 0, 0, 955, 985, 984, 983, 948,
- 947, 943, 951, 0, 981, 551, 0, 957, 960, 0,
- 566, 0, 937, 945, 600, 1382, 607, 0, 627, 594,
- 1382, 945, 0, 941, 940, 961, 950, 948, 948, 935,
- 950, 933, 966, 945, 946, 941, 962, 0, 0, 958,
- 957, 956, 921, 920, 0, 920, 0, 0, 0, 365,
- 623, 944, 931, 934, 916, 929, 916, 915, 936, 925,
- 923, 923, 941, 940, 939, 904, 903, 0, 908, 649,
- 655, 446, 925, 915, 903, 899, 900, 899, 932, 911,
- 908, 929, 910, 906, 908, 891, 888, 902, 888, 887,
-
- 920, 570, 0, 896, 899, 891, 882, 890, 880, 901,
- 890, 886, 888, 886, 886, 885, 0, 872, 871, 904,
- 883, 880, 901, 900, 651, 0, 876, 879, 1382, 508,
- 1382, 677, 0, 683, 894, 877, 859, 0, 876, 875,
- 858, 855, 856, 855, 847, 855, 845, 851, 0, 845,
- 0, 821, 820, 819, 840, 829, 827, 827, 810, 813,
- 827, 810, 843, 822, 823, 820, 817, 566, 804, 819,
- 818, 801, 797, 798, 797, 796, 793, 814, 803, 801,
- 24, 526, 198, 173, 189, 199, 241, 254, 0, 0,
- 326, 356, 335, 413, 468, 453, 488, 476, 491, 526,
-
- 507, 506, 533, 513, 518, 531, 553, 538, 537, 553,
- 541, 546, 550, 560, 555, 546, 563, 571, 0, 0,
- 573, 574, 575, 610, 591, 590, 613, 606, 603, 598,
- 0, 0, 611, 615, 611, 0, 612, 613, 0, 614,
- 638, 639, 627, 627, 631, 645, 0, 639, 649, 641,
- 649, 672, 653, 0, 0, 652, 669, 670, 0, 0,
- 672, 673, 674, 675, 660, 659, 662, 663, 723, 724,
- 674, 660, 661, 685, 686, 0, 0, 664, 666, 674,
- 0, 0, 675, 698, 672, 700, 695, 689, 676, 698,
- 696, 689, 678, 679, 680, 681, 689, 0, 0, 690,
-
- 750, 751, 752, 686, 0, 0, 708, 709, 0, 0,
- 713, 714, 709, 0, 710, 695, 719, 0, 697, 707,
- 730, 0, 0, 0, 0, 723, 724, 712, 769, 722,
- 724, 715, 716, 708, 709, 733, 734, 0, 733, 743,
- 717, 753, 717, 718, 722, 738, 787, 789, 724, 726,
- 0, 0, 745, 746, 736, 744, 0, 760, 0, 0,
- 755, 799, 800, 1382, 803, 802, 0, 0, 747, 748,
- 742, 768, 0, 753, 813, 1382, 814, 767, 752, 753,
- 0, 772, 768, 772, 822, 0, 0, 767, 782, 827,
- 828, 1382, 765, 775, 832, 1382, 0, 772, 834, 837,
-
- 838, 839, 788, 789, 845, 846, 1382, 1382, 884, 889,
- 892, 895, 846, 847, 898, 902, 905, 907
+ 0, 69, 75, 145, 1377, 1376, 1378, 1381, 70, 1381,
+ 1352, 1351, 94, 1350, 91, 92, 90, 1349, 202, 256,
+ 89, 1348, 95, 0, 79, 68, 64, 79, 124, 76,
+ 131, 1313, 127, 141, 81, 88, 82, 1307, 136, 126,
+ 183, 177, 149, 168, 134, 180, 206, 251, 1381, 140,
+ 1381, 1355, 239, 1381, 0, 1381, 1381, 228, 1381, 1381,
+ 1381, 1381, 1381, 1381, 1381, 1381, 1381, 231, 1381, 233,
+ 137, 307, 273, 1381, 1381, 0, 0, 1381, 1344, 1381,
+ 1381, 1381, 1343, 0, 1381, 1381, 1304, 1309, 115, 1306,
+ 1315, 1314, 1300, 1303, 1315, 244, 1309, 1296, 1293, 1307,
+
+ 1293, 1290, 1290, 1296, 126, 180, 1290, 1301, 1286, 1292,
+ 1296, 1297, 0, 1288, 1299, 254, 1298, 1293, 1273, 143,
+ 1277, 1291, 1281, 188, 1274, 271, 1287, 1289, 285, 1268,
+ 1276, 1273, 1262, 1271, 223, 252, 1276, 1271, 1274, 1262,
+ 1265, 246, 246, 226, 1275, 1262, 1275, 83, 1268, 1267,
+ 1381, 1381, 329, 334, 340, 1381, 1252, 1265, 1256, 1267,
+ 342, 0, 333, 0, 346, 1381, 329, 390, 1381, 353,
+ 397, 281, 1381, 1381, 1262, 0, 1257, 1252, 1256, 1266,
+ 1263, 328, 1246, 1246, 1258, 1249, 278, 1260, 1257, 1257,
+ 1255, 1252, 1243, 1250, 1236, 1234, 1247, 1232, 1249, 0,
+
+ 1246, 1233, 1241, 1238, 1242, 1243, 1236, 1233, 1221, 1220,
+ 1234, 1237, 1224, 1233, 1220, 1227, 1217, 362, 1223, 1226,
+ 1216, 1224, 1212, 1216, 1207, 1222, 1221, 1211, 1218, 325,
+ 1201, 1220, 1203, 1201, 1212, 1201, 1196, 1194, 1196, 1207,
+ 1192, 1194, 1191, 1203, 1202, 1205, 1186, 326, 1195, 1190,
+ 1188, 1198, 1176, 402, 1195, 1197, 1185, 1177, 1176, 1180,
+ 1192, 1175, 0, 414, 421, 438, 1381, 445, 456, 1381,
+ 1381, 1170, 1181, 1180, 0, 1177, 405, 0, 0, 1170,
+ 1168, 1168, 1169, 1164, 1173, 1161, 1179, 1167, 408, 0,
+ 0, 1161, 1172, 1171, 1171, 0, 1155, 426, 0, 0,
+
+ 1157, 450, 1165, 1166, 1156, 1150, 1149, 1150, 1149, 1149,
+ 461, 1144, 0, 0, 1140, 1139, 1138, 1140, 1141, 1146,
+ 1140, 1136, 1150, 1145, 1145, 1143, 1142, 1135, 1129, 1131,
+ 1130, 1133, 1133, 1125, 1128, 1123, 1132, 1137, 1124, 1121,
+ 1134, 1124, 0, 0, 1131, 1127, 0, 1118, 1118, 1124,
+ 1114, 1122, 464, 1119, 0, 0, 0, 0, 1108, 1121,
+ 1120, 1119, 1118, 1115, 1103, 473, 480, 1115, 1116, 1116,
+ 0, 0, 0, 0, 1102, 0, 1111, 1101, 0, 1100,
+ 1101, 1095, 1106, 0, 0, 0, 1096, 0, 1092, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 1103, 486,
+
+ 1102, 0, 0, 1100, 1096, 1092, 0, 0, 0, 1084,
+ 467, 489, 498, 1089, 1085, 1091, 1081, 1079, 1093, 1077,
+ 0, 1077, 1091, 1079, 1075, 1082, 1076, 1088, 1083, 0,
+ 1081, 1078, 1082, 1065, 1063, 1066, 1073, 1079, 1074, 1073,
+ 1060, 0, 1062, 1063, 0, 0, 0, 0, 1060, 1064,
+ 0, 1057, 1057, 1112, 1056, 1059, 0, 1067, 1046, 1056,
+ 1050, 0, 1043, 1043, 1057, 0, 1059, 0, 503, 1073,
+ 1072, 1071, 1036, 1035, 0, 1053, 1052, 1047, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 1035, 1049,
+ 1035, 1032, 0, 0, 1038, 1037, 0, 1033, 1041, 1040,
+
+ 0, 1032, 1024, 0, 0, 0, 0, 1021, 0, 0,
+ 1020, 1032, 506, 1024, 1031, 1030, 1027, 1021, 1018, 1013,
+ 524, 1029, 1014, 1008, 1008, 1022, 1006, 1019, 0, 0,
+ 1011, 1036, 1035, 1034, 999, 998, 359, 500, 0, 1011,
+ 1014, 1012, 1000, 996, 0, 1009, 1006, 1005, 994, 993,
+ 983, 1001, 986, 989, 530, 994, 997, 0, 1015, 1014,
+ 1013, 978, 977, 0, 992, 978, 0, 989, 981, 983,
+ 548, 554, 1033, 976, 980, 983, 0, 0, 0, 0,
+ 1004, 550, 0, 980, 983, 967, 975, 965, 986, 975,
+ 971, 972, 972, 971, 956, 563, 969, 0, 970, 958,
+
+ 957, 0, 0, 0, 953, 983, 982, 981, 946, 945,
+ 941, 949, 0, 979, 551, 0, 955, 958, 0, 566,
+ 0, 935, 943, 600, 1381, 607, 0, 627, 594, 1381,
+ 943, 0, 939, 938, 959, 948, 946, 946, 933, 948,
+ 931, 964, 943, 944, 939, 960, 0, 0, 956, 955,
+ 954, 919, 918, 0, 918, 0, 0, 0, 365, 623,
+ 942, 929, 932, 914, 927, 914, 913, 934, 923, 921,
+ 921, 939, 938, 937, 902, 901, 0, 906, 649, 655,
+ 446, 923, 913, 901, 897, 898, 897, 930, 909, 906,
+ 927, 908, 904, 906, 889, 886, 900, 886, 885, 918,
+
+ 570, 0, 894, 897, 889, 880, 888, 878, 899, 888,
+ 884, 886, 884, 884, 883, 0, 870, 869, 902, 881,
+ 878, 899, 898, 651, 0, 874, 877, 1381, 508, 1381,
+ 677, 0, 683, 892, 875, 857, 0, 874, 873, 856,
+ 853, 854, 853, 845, 853, 843, 842, 0, 822, 0,
+ 819, 818, 817, 838, 827, 825, 825, 808, 810, 825,
+ 808, 841, 820, 821, 818, 815, 566, 802, 817, 816,
+ 798, 795, 796, 795, 792, 791, 812, 801, 23, 182,
+ 526, 204, 178, 214, 241, 247, 326, 0, 0, 332,
+ 356, 331, 362, 407, 447, 474, 472, 476, 525, 506,
+
+ 505, 528, 511, 517, 515, 534, 537, 536, 552, 538,
+ 543, 546, 559, 554, 545, 546, 570, 0, 0, 571,
+ 573, 574, 609, 590, 589, 612, 605, 590, 597, 0,
+ 0, 610, 611, 608, 0, 611, 596, 0, 613, 637,
+ 638, 623, 625, 629, 631, 0, 638, 648, 640, 648,
+ 671, 652, 0, 0, 651, 668, 669, 0, 0, 670,
+ 672, 673, 674, 659, 658, 661, 662, 722, 723, 673,
+ 659, 660, 684, 685, 0, 0, 663, 665, 673, 0,
+ 0, 674, 697, 671, 699, 694, 688, 675, 697, 695,
+ 688, 677, 678, 679, 680, 688, 0, 0, 689, 749,
+
+ 750, 751, 685, 0, 0, 707, 708, 0, 0, 712,
+ 713, 708, 0, 709, 694, 718, 0, 696, 706, 729,
+ 0, 0, 0, 0, 722, 723, 711, 768, 721, 723,
+ 714, 715, 707, 708, 732, 733, 0, 732, 742, 716,
+ 752, 716, 717, 721, 737, 786, 788, 723, 725, 0,
+ 0, 744, 745, 735, 743, 0, 759, 0, 0, 754,
+ 798, 799, 1381, 802, 801, 0, 0, 746, 747, 741,
+ 767, 0, 752, 812, 1381, 813, 766, 751, 752, 0,
+ 771, 767, 771, 821, 0, 0, 766, 781, 826, 827,
+ 1381, 764, 774, 831, 1381, 0, 771, 833, 836, 837,
+
+ 838, 787, 788, 844, 845, 1381, 1381, 883, 888, 891,
+ 894, 845, 846, 897, 901, 904, 906
} ;
-static yyconst flex_int16_t yy_def[1019] =
+static yyconst flex_int16_t yy_def[1018] =
{ 0,
- 1008, 1, 1009, 1009, 1010, 1010, 1008, 1008, 1008, 1008,
- 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008,
- 1008, 1008, 1008, 1011, 1008, 1011, 1011, 1011, 1011, 1011,
- 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011,
- 1011, 1011, 1011, 1011, 1011, 1008, 1008, 1008, 1008, 1008,
- 1008, 1008, 1008, 1008, 1012, 1008, 1008, 1008, 1008, 1008,
- 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1013, 1008, 1014,
- 19, 1008, 1008, 1008, 1008, 1015, 20, 1008, 1008, 1008,
- 1008, 1008, 1008, 1011, 1008, 1008, 1011, 1011, 1011, 1011,
- 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011,
-
- 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011,
- 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011,
- 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011,
- 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011,
- 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011,
- 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008,
- 1008, 1016, 1008, 1012, 1008, 1008, 1014, 1008, 1008, 1008,
- 1008, 1015, 1008, 1008, 1011, 1011, 1011, 1011, 1011, 1011,
- 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011,
- 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011,
-
- 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011,
- 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011,
- 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011,
- 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011,
- 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011,
- 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1008, 1008,
- 1008, 1008, 1016, 1008, 1008, 1008, 1008, 1008, 1008, 1008,
- 1008, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011,
- 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011,
- 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011,
-
- 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011,
- 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011,
- 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011,
- 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011,
- 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011,
- 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011,
- 1011, 1008, 1008, 1008, 1008, 1008, 1008, 1011, 1011, 1011,
- 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011,
- 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011,
- 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011,
-
- 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011,
- 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011,
- 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011,
- 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011,
- 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011,
- 1011, 1011, 1008, 1008, 1008, 1008, 1011, 1011, 1011, 1011,
- 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011,
- 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011,
- 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011,
- 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011,
-
- 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011,
- 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1008,
- 1008, 1008, 1008, 1011, 1011, 1011, 1011, 1011, 1011, 1011,
- 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011,
- 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011,
- 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011,
- 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011,
- 1008, 1008, 1008, 1008, 1008, 1011, 1011, 1011, 1011, 1011,
- 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011,
- 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011,
-
- 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011,
- 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011,
- 1011, 1011, 1011, 1008, 1008, 1008, 1008, 1017, 1008, 1008,
- 1008, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011,
- 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011,
- 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011,
- 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011,
- 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1008, 1008,
- 1008, 1017, 1008, 1008, 1008, 1011, 1011, 1011, 1011, 1011,
- 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011,
-
- 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011,
- 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011,
- 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1008, 1008,
- 1008, 1008, 1018, 1008, 1008, 1008, 1008, 1011, 1011, 1011,
- 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011,
- 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011,
- 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011,
- 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011,
- 1011, 1018, 1008, 1008, 1008, 1011, 1011, 1011, 1011, 1011,
- 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011,
-
- 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011,
- 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011,
- 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1008, 1008, 1008,
- 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011,
- 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011,
- 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011,
- 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1008, 1008,
- 1008, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011,
- 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011,
- 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011,
-
- 1008, 1008, 1008, 1008, 1011, 1011, 1011, 1011, 1011, 1011,
- 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011,
- 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1008, 1008, 1008,
- 1008, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011,
- 1011, 1011, 1011, 1011, 1008, 1008, 1008, 1008, 1011, 1011,
- 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011,
- 1008, 1008, 1008, 1008, 1008, 1008, 1011, 1011, 1011, 1011,
- 1011, 1011, 1011, 1008, 1008, 1008, 1008, 1008, 1011, 1011,
- 1011, 1011, 1008, 1008, 1008, 1011, 1011, 1011, 1008, 1008,
- 1008, 1008, 1011, 1008, 1008, 1008, 1011, 1008, 1008, 1008,
-
- 1008, 1008, 1008, 1008, 1008, 1008, 1008, 0, 1008, 1008,
- 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008
+ 1007, 1, 1008, 1008, 1009, 1009, 1007, 1007, 1007, 1007,
+ 1007, 1007, 1007, 1007, 1007, 1007, 1007, 1007, 1007, 1007,
+ 1007, 1007, 1007, 1010, 1007, 1010, 1010, 1010, 1010, 1010,
+ 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010,
+ 1010, 1010, 1010, 1010, 1010, 1007, 1007, 1007, 1007, 1007,
+ 1007, 1007, 1007, 1007, 1011, 1007, 1007, 1007, 1007, 1007,
+ 1007, 1007, 1007, 1007, 1007, 1007, 1007, 1012, 1007, 1013,
+ 19, 1007, 1007, 1007, 1007, 1014, 20, 1007, 1007, 1007,
+ 1007, 1007, 1007, 1010, 1007, 1007, 1010, 1010, 1010, 1010,
+ 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010,
+
+ 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010,
+ 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010,
+ 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010,
+ 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010,
+ 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010,
+ 1007, 1007, 1007, 1007, 1007, 1007, 1007, 1007, 1007, 1007,
+ 1007, 1015, 1007, 1011, 1007, 1007, 1013, 1007, 1007, 1007,
+ 1007, 1014, 1007, 1007, 1010, 1010, 1010, 1010, 1010, 1010,
+ 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010,
+ 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010,
+
+ 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010,
+ 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010,
+ 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010,
+ 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010,
+ 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010,
+ 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1007, 1007,
+ 1007, 1007, 1015, 1007, 1007, 1007, 1007, 1007, 1007, 1007,
+ 1007, 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010,
+ 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010,
+ 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010,
+
+ 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010,
+ 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010,
+ 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010,
+ 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010,
+ 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010,
+ 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010,
+ 1010, 1007, 1007, 1007, 1007, 1007, 1007, 1010, 1010, 1010,
+ 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010,
+ 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010,
+ 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010,
+
+ 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010,
+ 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010,
+ 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010,
+ 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010,
+ 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010,
+ 1010, 1010, 1007, 1007, 1007, 1007, 1010, 1010, 1010, 1010,
+ 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010,
+ 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010,
+ 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010,
+ 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010,
+
+ 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010,
+ 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1007,
+ 1007, 1007, 1007, 1010, 1010, 1010, 1010, 1010, 1010, 1010,
+ 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010,
+ 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010,
+ 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010,
+ 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1007,
+ 1007, 1007, 1007, 1007, 1010, 1010, 1010, 1010, 1010, 1010,
+ 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010,
+ 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010,
+
+ 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010,
+ 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010,
+ 1010, 1010, 1007, 1007, 1007, 1007, 1016, 1007, 1007, 1007,
+ 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010,
+ 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010,
+ 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010,
+ 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010,
+ 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1007, 1007, 1007,
+ 1016, 1007, 1007, 1007, 1010, 1010, 1010, 1010, 1010, 1010,
+ 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010,
+
+ 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010,
+ 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010,
+ 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1007, 1007, 1007,
+ 1007, 1017, 1007, 1007, 1007, 1007, 1010, 1010, 1010, 1010,
+ 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010,
+ 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010,
+ 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010,
+ 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010,
+ 1017, 1007, 1007, 1007, 1010, 1010, 1010, 1010, 1010, 1010,
+ 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010,
+
+ 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010,
+ 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010,
+ 1010, 1010, 1010, 1010, 1010, 1010, 1007, 1007, 1007, 1010,
+ 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010,
+ 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010,
+ 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010,
+ 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1007, 1007, 1007,
+ 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010,
+ 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010,
+ 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1007,
+
+ 1007, 1007, 1007, 1010, 1010, 1010, 1010, 1010, 1010, 1010,
+ 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010,
+ 1010, 1010, 1010, 1010, 1010, 1010, 1007, 1007, 1007, 1007,
+ 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010,
+ 1010, 1010, 1010, 1007, 1007, 1007, 1007, 1010, 1010, 1010,
+ 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1007,
+ 1007, 1007, 1007, 1007, 1007, 1010, 1010, 1010, 1010, 1010,
+ 1010, 1010, 1007, 1007, 1007, 1007, 1007, 1010, 1010, 1010,
+ 1010, 1007, 1007, 1007, 1010, 1010, 1010, 1007, 1007, 1007,
+ 1007, 1010, 1007, 1007, 1007, 1010, 1007, 1007, 1007, 1007,
+
+ 1007, 1007, 1007, 1007, 1007, 1007, 0, 1007, 1007, 1007,
+ 1007, 1007, 1007, 1007, 1007, 1007, 1007
} ;
-static yyconst flex_int16_t yy_nxt[1453] =
+static yyconst flex_int16_t yy_nxt[1452] =
{ 0,
8, 9, 10, 9, 11, 8, 12, 13, 8, 8,
14, 15, 16, 17, 18, 19, 20, 20, 20, 20,
@@ -759,7 +759,7 @@ static yyconst flex_int16_t yy_nxt[1453] =
24, 24, 25, 24, 26, 27, 28, 29, 30, 31,
32, 33, 34, 24, 24, 35, 36, 37, 38, 39,
40, 41, 42, 43, 44, 45, 24, 24, 24, 46,
- 47, 58, 827, 58, 48, 49, 50, 51, 50, 49,
+ 47, 58, 825, 58, 48, 49, 50, 51, 50, 49,
49, 49, 49, 49, 49, 49, 49, 49, 49, 52,
49, 53, 53, 53, 53, 53, 53, 54, 49, 49,
@@ -770,151 +770,151 @@ static yyconst flex_int16_t yy_nxt[1453] =
124, 161, 103, 161, 49, 49, 50, 51, 50, 49,
49, 49, 49, 49, 49, 49, 49, 49, 49, 52,
49, 53, 53, 53, 53, 53, 53, 54, 49, 49,
- 49, 110, 97, 177, 129, 104, 98, 178, 1008, 111,
+ 49, 110, 97, 177, 129, 104, 98, 178, 1007, 111,
126, 196, 99, 105, 130, 149, 106, 49, 100, 107,
113, 112, 197, 114, 150, 108, 127, 115, 116, 128,
- 216, 142, 117, 1008, 151, 118, 143, 153, 217, 58,
+ 216, 142, 117, 1007, 151, 118, 143, 153, 217, 58,
144, 154, 146, 145, 49, 70, 147, 71, 71, 71,
71, 71, 71, 72, 198, 138, 148, 131, 139, 58,
- 828, 58, 73, 74, 132, 133, 829, 140, 199, 134,
- 221, 830, 75, 76, 141, 135, 136, 222, 137, 152,
+ 826, 58, 73, 74, 132, 133, 827, 140, 199, 134,
+ 221, 828, 75, 76, 141, 135, 136, 222, 137, 152,
73, 74, 155, 156, 163, 163, 163, 163, 163, 163,
- 163, 165, 166, 168, 169, 75, 831, 237, 76, 70,
+ 163, 165, 166, 168, 169, 75, 829, 237, 76, 70,
250, 77, 77, 77, 77, 77, 77, 77, 251, 165,
166, 168, 169, 238, 170, 170, 73, 74, 171, 171,
171, 171, 171, 171, 171, 185, 78, 239, 248, 157,
- 186, 187, 246, 247, 73, 74, 158, 249, 832, 208,
- 159, 240, 209, 210, 833, 160, 211, 224, 212, 78,
+ 186, 187, 246, 247, 73, 74, 158, 249, 830, 208,
+ 159, 240, 209, 210, 831, 160, 211, 224, 212, 78,
70, 271, 72, 72, 72, 72, 72, 72, 72, 229,
153, 225, 58, 226, 154, 155, 156, 73, 74, 284,
285, 155, 156, 161, 271, 161, 230, 231, 163, 163,
163, 163, 163, 163, 163, 73, 74, 264, 264, 266,
267, 265, 265, 265, 265, 265, 265, 265, 171, 171,
171, 171, 171, 171, 171, 348, 278, 266, 267, 315,
- 316, 317, 157, 329, 349, 587, 834, 330, 157, 158,
- 279, 707, 550, 159, 835, 158, 551, 588, 160, 159,
+ 316, 317, 157, 329, 349, 586, 832, 330, 157, 158,
+ 279, 706, 833, 159, 834, 158, 835, 587, 160, 159,
- 836, 268, 268, 708, 160, 269, 269, 269, 269, 269,
+ 836, 268, 268, 707, 160, 269, 269, 269, 269, 269,
269, 269, 171, 171, 171, 171, 171, 171, 171, 355,
356, 357, 372, 373, 374, 384, 385, 386, 270, 265,
265, 265, 265, 265, 265, 265, 265, 265, 265, 265,
- 265, 265, 265, 392, 393, 394, 270, 625, 626, 366,
+ 265, 265, 265, 392, 393, 394, 270, 624, 625, 366,
366, 837, 166, 367, 367, 367, 367, 367, 367, 367,
269, 269, 269, 269, 269, 269, 269, 396, 397, 398,
166, 269, 269, 269, 269, 269, 269, 269, 407, 408,
409, 446, 447, 448, 480, 481, 482, 169, 367, 367,
367, 367, 367, 367, 367, 367, 367, 367, 367, 367,
- 367, 367, 470, 471, 472, 169, 483, 484, 485, 730,
- 731, 267, 838, 473, 474, 486, 487, 488, 839, 532,
- 533, 534, 560, 561, 562, 521, 589, 730, 731, 267,
- 535, 536, 840, 563, 564, 590, 841, 591, 592, 572,
- 573, 573, 573, 573, 573, 573, 607, 608, 609, 625,
- 626, 842, 843, 844, 845, 625, 626, 610, 611, 846,
- 612, 847, 848, 627, 627, 627, 627, 627, 627, 629,
- 629, 629, 629, 629, 629, 629, 635, 668, 849, 650,
- 651, 652, 673, 674, 675, 636, 669, 637, 670, 628,
- 653, 654, 813, 676, 677, 630, 754, 850, 851, 852,
-
- 853, 625, 626, 854, 814, 755, 855, 756, 625, 626,
- 856, 857, 858, 859, 628, 680, 681, 681, 681, 681,
- 681, 681, 627, 627, 627, 627, 627, 627, 625, 626,
- 860, 861, 683, 862, 863, 864, 865, 866, 867, 868,
- 869, 684, 629, 629, 629, 629, 629, 629, 629, 709,
- 730, 731, 685, 870, 871, 872, 730, 731, 710, 873,
- 711, 712, 874, 875, 732, 732, 732, 732, 732, 732,
- 734, 734, 734, 734, 734, 734, 734, 777, 730, 731,
- 876, 877, 878, 879, 730, 731, 778, 880, 779, 881,
- 733, 882, 732, 732, 732, 732, 732, 732, 734, 734,
-
- 734, 734, 734, 734, 734, 883, 884, 885, 886, 887,
- 888, 889, 890, 891, 892, 733, 893, 894, 895, 896,
- 897, 898, 899, 900, 901, 902, 904, 905, 906, 907,
- 908, 909, 903, 910, 911, 912, 913, 914, 915, 916,
+ 367, 367, 470, 471, 472, 169, 483, 484, 485, 729,
+ 730, 267, 838, 473, 474, 486, 487, 488, 839, 532,
+ 533, 534, 559, 560, 561, 521, 588, 729, 730, 267,
+ 535, 536, 840, 562, 563, 589, 841, 590, 591, 571,
+ 572, 572, 572, 572, 572, 572, 606, 607, 608, 624,
+ 625, 842, 843, 844, 845, 624, 625, 609, 610, 846,
+ 611, 847, 848, 626, 626, 626, 626, 626, 626, 628,
+ 628, 628, 628, 628, 628, 628, 634, 667, 849, 649,
+ 650, 651, 672, 673, 674, 635, 668, 636, 669, 627,
+ 652, 653, 812, 675, 676, 629, 753, 850, 851, 852,
+
+ 853, 624, 625, 854, 813, 754, 855, 755, 624, 625,
+ 856, 857, 858, 859, 627, 679, 680, 680, 680, 680,
+ 680, 680, 626, 626, 626, 626, 626, 626, 624, 625,
+ 860, 861, 682, 862, 863, 864, 865, 866, 867, 868,
+ 869, 683, 628, 628, 628, 628, 628, 628, 628, 708,
+ 729, 730, 684, 870, 871, 872, 729, 730, 709, 873,
+ 710, 711, 874, 875, 731, 731, 731, 731, 731, 731,
+ 733, 733, 733, 733, 733, 733, 733, 776, 729, 730,
+ 876, 877, 878, 879, 729, 730, 777, 880, 778, 881,
+ 732, 882, 731, 731, 731, 731, 731, 731, 733, 733,
+
+ 733, 733, 733, 733, 733, 883, 884, 885, 886, 887,
+ 888, 889, 890, 891, 892, 732, 893, 894, 895, 896,
+ 897, 898, 899, 900, 901, 903, 904, 905, 906, 907,
+ 908, 902, 909, 910, 911, 912, 913, 914, 915, 916,
917, 918, 919, 920, 921, 922, 923, 924, 925, 926,
- 927, 901, 902, 929, 931, 932, 933, 934, 935, 903,
- 936, 937, 938, 939, 940, 941, 942, 943, 944, 945,
- 929, 946, 948, 949, 950, 951, 952, 953, 954, 947,
- 955, 956, 957, 958, 959, 960, 961, 962, 963, 967,
- 965, 968, 969, 970, 971, 972, 964, 966, 973, 974,
-
- 975, 963, 928, 977, 965, 979, 980, 981, 976, 964,
- 930, 966, 982, 983, 975, 977, 984, 986, 987, 988,
- 989, 990, 976, 991, 985, 993, 994, 930, 995, 991,
- 997, 992, 998, 995, 999, 1000, 996, 992, 1000, 1002,
- 1002, 996, 1001, 1004, 1005, 1001, 1006, 1006, 68, 167,
- 826, 825, 824, 823, 1007, 1007, 822, 821, 820, 819,
- 978, 818, 817, 816, 815, 812, 811, 810, 809, 808,
- 807, 806, 978, 805, 804, 803, 802, 801, 800, 799,
- 798, 797, 1003, 1003, 55, 55, 55, 55, 55, 56,
- 56, 56, 56, 56, 84, 84, 84, 164, 164, 164,
-
- 172, 172, 263, 796, 263, 263, 263, 682, 682, 782,
- 782, 795, 794, 793, 792, 791, 790, 789, 788, 787,
- 786, 785, 784, 783, 781, 780, 776, 775, 774, 773,
- 772, 771, 770, 769, 768, 767, 766, 765, 764, 763,
- 762, 761, 760, 759, 758, 757, 753, 752, 751, 750,
- 749, 748, 747, 746, 745, 744, 743, 742, 741, 740,
- 739, 738, 737, 736, 735, 729, 728, 727, 726, 725,
- 724, 723, 722, 721, 720, 719, 718, 717, 716, 715,
- 714, 713, 706, 705, 704, 703, 702, 701, 700, 699,
- 698, 697, 696, 695, 694, 693, 692, 691, 690, 689,
-
- 688, 687, 686, 679, 678, 672, 671, 667, 666, 665,
- 664, 663, 662, 661, 660, 659, 658, 657, 656, 655,
- 649, 648, 647, 646, 645, 644, 643, 642, 641, 640,
- 639, 638, 634, 633, 632, 631, 630, 624, 623, 622,
- 621, 620, 619, 618, 617, 616, 615, 614, 613, 606,
- 605, 604, 603, 602, 601, 600, 599, 598, 597, 596,
- 595, 594, 593, 586, 585, 584, 583, 582, 581, 580,
- 579, 578, 577, 576, 575, 574, 571, 570, 569, 568,
- 567, 566, 565, 559, 558, 557, 556, 555, 554, 553,
- 552, 549, 548, 547, 546, 545, 544, 543, 542, 541,
-
- 540, 539, 538, 537, 531, 530, 529, 528, 527, 526,
- 525, 524, 523, 522, 521, 520, 519, 518, 517, 516,
- 515, 514, 513, 512, 511, 510, 509, 508, 507, 506,
- 505, 504, 503, 502, 501, 500, 499, 498, 497, 496,
- 495, 494, 493, 492, 491, 490, 489, 479, 478, 477,
- 476, 475, 469, 468, 467, 466, 465, 464, 463, 462,
- 461, 460, 459, 458, 457, 456, 455, 454, 453, 452,
- 451, 450, 449, 445, 444, 443, 442, 441, 440, 439,
- 438, 437, 436, 435, 434, 433, 432, 431, 430, 429,
- 428, 427, 426, 425, 424, 423, 422, 421, 420, 419,
-
- 418, 417, 416, 415, 414, 413, 412, 411, 410, 406,
- 405, 404, 403, 402, 401, 400, 399, 395, 391, 390,
- 389, 388, 387, 383, 382, 381, 380, 379, 378, 377,
- 376, 375, 371, 370, 369, 368, 365, 364, 363, 362,
- 361, 360, 359, 358, 354, 353, 352, 351, 350, 347,
- 346, 345, 344, 343, 342, 341, 340, 339, 338, 337,
- 336, 335, 334, 333, 332, 331, 328, 327, 326, 325,
- 324, 323, 322, 321, 320, 319, 318, 314, 313, 312,
- 311, 310, 309, 308, 307, 306, 305, 304, 303, 302,
- 301, 300, 299, 298, 297, 296, 295, 294, 293, 292,
-
- 291, 290, 289, 288, 287, 286, 283, 282, 281, 280,
- 277, 276, 275, 274, 273, 272, 262, 261, 260, 259,
- 258, 257, 254, 253, 252, 245, 244, 243, 242, 241,
- 236, 235, 234, 233, 232, 228, 227, 223, 220, 219,
- 218, 215, 214, 213, 207, 206, 205, 204, 203, 202,
- 201, 200, 195, 194, 193, 192, 191, 190, 189, 188,
- 184, 183, 182, 181, 180, 179, 176, 175, 174, 173,
- 162, 125, 109, 81, 69, 63, 60, 59, 1008, 57,
- 57, 7, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008,
- 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008,
-
- 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008,
- 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008,
- 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008,
- 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008,
- 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008,
- 1008, 1008
+ 900, 901, 928, 930, 931, 932, 933, 934, 902, 935,
+ 936, 937, 938, 939, 940, 941, 942, 943, 944, 928,
+ 945, 947, 948, 949, 950, 951, 952, 953, 946, 954,
+ 955, 956, 957, 958, 959, 960, 961, 962, 966, 964,
+ 967, 968, 969, 970, 971, 963, 965, 972, 973, 974,
+
+ 962, 927, 976, 964, 978, 979, 980, 975, 963, 929,
+ 965, 981, 982, 974, 976, 983, 985, 986, 987, 988,
+ 989, 975, 990, 984, 992, 993, 929, 994, 990, 996,
+ 991, 997, 994, 998, 999, 995, 991, 999, 1001, 1001,
+ 995, 1000, 1003, 1004, 1000, 1005, 1005, 68, 167, 824,
+ 823, 822, 821, 1006, 1006, 820, 819, 818, 817, 977,
+ 816, 815, 814, 811, 810, 809, 808, 807, 806, 805,
+ 804, 977, 803, 802, 801, 800, 799, 798, 797, 796,
+ 795, 1002, 1002, 55, 55, 55, 55, 55, 56, 56,
+ 56, 56, 56, 84, 84, 84, 164, 164, 164, 172,
+
+ 172, 263, 794, 263, 263, 263, 681, 681, 781, 781,
+ 793, 792, 791, 790, 789, 788, 787, 786, 785, 784,
+ 783, 782, 780, 779, 775, 774, 773, 772, 771, 770,
+ 769, 768, 767, 766, 765, 764, 763, 762, 761, 760,
+ 759, 758, 757, 756, 752, 751, 750, 749, 748, 747,
+ 746, 745, 744, 743, 742, 741, 740, 739, 738, 737,
+ 736, 735, 734, 728, 727, 726, 725, 724, 723, 722,
+ 721, 720, 719, 718, 717, 716, 715, 714, 713, 712,
+ 705, 704, 703, 702, 701, 700, 699, 698, 697, 696,
+ 695, 694, 693, 692, 691, 690, 689, 688, 687, 686,
+
+ 685, 678, 677, 671, 670, 666, 665, 664, 663, 662,
+ 661, 660, 659, 658, 657, 656, 655, 654, 648, 647,
+ 646, 645, 644, 643, 642, 641, 640, 639, 638, 637,
+ 633, 632, 631, 630, 629, 623, 622, 621, 620, 619,
+ 618, 617, 616, 615, 614, 613, 612, 605, 604, 603,
+ 602, 601, 600, 599, 598, 597, 596, 595, 594, 593,
+ 592, 585, 584, 583, 582, 581, 580, 579, 578, 577,
+ 576, 575, 574, 573, 570, 569, 568, 567, 566, 565,
+ 564, 558, 557, 556, 555, 554, 553, 552, 551, 550,
+ 549, 548, 547, 546, 545, 544, 543, 542, 541, 540,
+
+ 539, 538, 537, 531, 530, 529, 528, 527, 526, 525,
+ 524, 523, 522, 521, 520, 519, 518, 517, 516, 515,
+ 514, 513, 512, 511, 510, 509, 508, 507, 506, 505,
+ 504, 503, 502, 501, 500, 499, 498, 497, 496, 495,
+ 494, 493, 492, 491, 490, 489, 479, 478, 477, 476,
+ 475, 469, 468, 467, 466, 465, 464, 463, 462, 461,
+ 460, 459, 458, 457, 456, 455, 454, 453, 452, 451,
+ 450, 449, 445, 444, 443, 442, 441, 440, 439, 438,
+ 437, 436, 435, 434, 433, 432, 431, 430, 429, 428,
+ 427, 426, 425, 424, 423, 422, 421, 420, 419, 418,
+
+ 417, 416, 415, 414, 413, 412, 411, 410, 406, 405,
+ 404, 403, 402, 401, 400, 399, 395, 391, 390, 389,
+ 388, 387, 383, 382, 381, 380, 379, 378, 377, 376,
+ 375, 371, 370, 369, 368, 365, 364, 363, 362, 361,
+ 360, 359, 358, 354, 353, 352, 351, 350, 347, 346,
+ 345, 344, 343, 342, 341, 340, 339, 338, 337, 336,
+ 335, 334, 333, 332, 331, 328, 327, 326, 325, 324,
+ 323, 322, 321, 320, 319, 318, 314, 313, 312, 311,
+ 310, 309, 308, 307, 306, 305, 304, 303, 302, 301,
+ 300, 299, 298, 297, 296, 295, 294, 293, 292, 291,
+
+ 290, 289, 288, 287, 286, 283, 282, 281, 280, 277,
+ 276, 275, 274, 273, 272, 262, 261, 260, 259, 258,
+ 257, 254, 253, 252, 245, 244, 243, 242, 241, 236,
+ 235, 234, 233, 232, 228, 227, 223, 220, 219, 218,
+ 215, 214, 213, 207, 206, 205, 204, 203, 202, 201,
+ 200, 195, 194, 193, 192, 191, 190, 189, 188, 184,
+ 183, 182, 181, 180, 179, 176, 175, 174, 173, 162,
+ 125, 109, 81, 69, 63, 60, 59, 1007, 57, 57,
+ 7, 1007, 1007, 1007, 1007, 1007, 1007, 1007, 1007, 1007,
+ 1007, 1007, 1007, 1007, 1007, 1007, 1007, 1007, 1007, 1007,
+
+ 1007, 1007, 1007, 1007, 1007, 1007, 1007, 1007, 1007, 1007,
+ 1007, 1007, 1007, 1007, 1007, 1007, 1007, 1007, 1007, 1007,
+ 1007, 1007, 1007, 1007, 1007, 1007, 1007, 1007, 1007, 1007,
+ 1007, 1007, 1007, 1007, 1007, 1007, 1007, 1007, 1007, 1007,
+ 1007, 1007, 1007, 1007, 1007, 1007, 1007, 1007, 1007, 1007,
+ 1007
} ;
-static yyconst flex_int16_t yy_chk[1453] =
+static yyconst flex_int16_t yy_chk[1452] =
{ 0,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
@@ -923,7 +923,7 @@ static yyconst flex_int16_t yy_chk[1453] =
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 2, 9, 781, 9, 2, 3, 3, 3, 3, 3,
+ 2, 9, 779, 9, 2, 3, 3, 3, 3, 3,
3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
@@ -941,141 +941,141 @@ static yyconst flex_int16_t yy_chk[1453] =
120, 43, 34, 71, 46, 34, 43, 47, 120, 47,
43, 47, 44, 43, 4, 19, 44, 19, 19, 19,
19, 19, 19, 19, 106, 42, 44, 41, 42, 58,
- 783, 58, 19, 19, 41, 41, 784, 42, 106, 41,
- 124, 785, 19, 19, 42, 41, 41, 124, 41, 46,
+ 780, 58, 19, 19, 41, 41, 782, 42, 106, 41,
+ 124, 783, 19, 19, 42, 41, 41, 124, 41, 46,
19, 19, 48, 48, 53, 53, 53, 53, 53, 53,
- 53, 68, 68, 70, 70, 19, 786, 135, 19, 20,
+ 53, 68, 68, 70, 70, 19, 784, 135, 19, 20,
144, 20, 20, 20, 20, 20, 20, 20, 144, 68,
68, 70, 70, 135, 73, 73, 20, 20, 73, 73,
73, 73, 73, 73, 73, 96, 20, 136, 143, 48,
- 96, 96, 142, 142, 20, 20, 48, 143, 787, 116,
- 48, 136, 116, 116, 788, 48, 116, 126, 116, 20,
+ 96, 96, 142, 142, 20, 20, 48, 143, 785, 116,
+ 48, 136, 116, 116, 786, 48, 116, 126, 116, 20,
72, 172, 72, 72, 72, 72, 72, 72, 72, 129,
153, 126, 153, 126, 153, 154, 154, 72, 72, 187,
187, 155, 155, 161, 172, 161, 129, 129, 163, 163,
163, 163, 163, 163, 163, 72, 72, 165, 165, 167,
167, 165, 165, 165, 165, 165, 165, 165, 170, 170,
170, 170, 170, 170, 170, 248, 182, 167, 167, 218,
- 218, 218, 154, 230, 248, 537, 791, 230, 155, 154,
- 182, 660, 496, 154, 792, 155, 496, 537, 154, 155,
+ 218, 218, 154, 230, 248, 537, 787, 230, 155, 154,
+ 182, 659, 790, 154, 791, 155, 792, 537, 154, 155,
- 793, 168, 168, 660, 155, 168, 168, 168, 168, 168,
+ 793, 168, 168, 659, 155, 168, 168, 168, 168, 168,
168, 168, 171, 171, 171, 171, 171, 171, 171, 254,
254, 254, 277, 277, 277, 289, 289, 289, 171, 264,
264, 264, 264, 264, 264, 264, 265, 265, 265, 265,
- 265, 265, 265, 298, 298, 298, 171, 682, 682, 266,
+ 265, 265, 265, 298, 298, 298, 171, 681, 681, 266,
266, 794, 265, 266, 266, 266, 266, 266, 266, 266,
268, 268, 268, 268, 268, 268, 268, 302, 302, 302,
265, 269, 269, 269, 269, 269, 269, 269, 311, 311,
311, 353, 353, 353, 411, 411, 411, 269, 366, 366,
366, 366, 366, 366, 366, 367, 367, 367, 367, 367,
- 367, 367, 400, 400, 400, 269, 412, 412, 412, 730,
- 730, 367, 795, 400, 400, 413, 413, 413, 796, 469,
- 469, 469, 513, 513, 513, 521, 538, 782, 782, 367,
+ 367, 367, 400, 400, 400, 269, 412, 412, 412, 729,
+ 729, 367, 795, 400, 400, 413, 413, 413, 796, 469,
+ 469, 469, 513, 513, 513, 521, 538, 781, 781, 367,
469, 469, 797, 513, 513, 538, 798, 538, 538, 521,
- 521, 521, 521, 521, 521, 521, 556, 556, 556, 572,
- 572, 799, 800, 801, 802, 573, 573, 556, 556, 803,
- 556, 804, 805, 572, 572, 572, 572, 572, 572, 573,
- 573, 573, 573, 573, 573, 573, 583, 616, 806, 597,
- 597, 597, 621, 621, 621, 583, 616, 583, 616, 572,
- 597, 597, 768, 621, 621, 630, 702, 807, 808, 809,
-
- 810, 625, 625, 811, 768, 702, 812, 702, 627, 627,
- 813, 814, 815, 816, 572, 625, 625, 625, 625, 625,
- 625, 625, 627, 627, 627, 627, 627, 627, 629, 629,
- 817, 818, 630, 821, 822, 823, 824, 825, 826, 827,
- 828, 630, 629, 629, 629, 629, 629, 629, 629, 661,
- 680, 680, 630, 829, 830, 833, 681, 681, 661, 834,
- 661, 661, 835, 837, 680, 680, 680, 680, 680, 680,
- 681, 681, 681, 681, 681, 681, 681, 725, 732, 732,
- 838, 840, 841, 842, 734, 734, 725, 843, 725, 844,
- 680, 845, 732, 732, 732, 732, 732, 732, 734, 734,
-
- 734, 734, 734, 734, 734, 846, 848, 849, 850, 851,
- 852, 853, 856, 857, 858, 680, 861, 862, 863, 864,
+ 521, 521, 521, 521, 521, 521, 555, 555, 555, 571,
+ 571, 799, 800, 801, 802, 572, 572, 555, 555, 803,
+ 555, 804, 805, 571, 571, 571, 571, 571, 571, 572,
+ 572, 572, 572, 572, 572, 572, 582, 615, 806, 596,
+ 596, 596, 620, 620, 620, 582, 615, 582, 615, 571,
+ 596, 596, 767, 620, 620, 629, 701, 807, 808, 809,
+
+ 810, 624, 624, 811, 767, 701, 812, 701, 626, 626,
+ 813, 814, 815, 816, 571, 624, 624, 624, 624, 624,
+ 624, 624, 626, 626, 626, 626, 626, 626, 628, 628,
+ 817, 820, 629, 821, 822, 823, 824, 825, 826, 827,
+ 828, 629, 628, 628, 628, 628, 628, 628, 628, 660,
+ 679, 679, 629, 829, 832, 833, 680, 680, 660, 834,
+ 660, 660, 836, 837, 679, 679, 679, 679, 679, 679,
+ 680, 680, 680, 680, 680, 680, 680, 724, 731, 731,
+ 839, 840, 841, 842, 733, 733, 724, 843, 724, 844,
+ 679, 845, 731, 731, 731, 731, 731, 731, 733, 733,
+
+ 733, 733, 733, 733, 733, 847, 848, 849, 850, 851,
+ 852, 855, 856, 857, 860, 679, 861, 862, 863, 864,
865, 866, 867, 868, 869, 870, 871, 872, 873, 874,
- 875, 878, 870, 879, 880, 883, 884, 885, 886, 887,
- 888, 889, 890, 891, 892, 893, 894, 895, 896, 897,
- 900, 901, 902, 903, 904, 907, 908, 911, 912, 902,
- 913, 915, 916, 917, 919, 920, 921, 926, 927, 928,
- 929, 930, 931, 932, 933, 934, 935, 936, 937, 930,
- 939, 940, 941, 942, 943, 944, 945, 946, 947, 949,
- 948, 950, 953, 954, 955, 956, 947, 948, 958, 961,
-
- 962, 963, 901, 966, 965, 969, 970, 971, 962, 963,
- 903, 965, 972, 974, 975, 977, 978, 979, 980, 982,
- 983, 984, 975, 985, 978, 988, 989, 929, 990, 991,
- 993, 985, 994, 995, 998, 999, 990, 991, 1000, 1001,
- 1002, 995, 999, 1003, 1004, 1000, 1005, 1006, 1013, 1014,
- 780, 779, 778, 777, 1005, 1006, 776, 775, 774, 773,
- 966, 772, 771, 770, 769, 767, 766, 765, 764, 763,
- 762, 761, 977, 760, 759, 758, 757, 756, 755, 754,
- 753, 752, 1001, 1002, 1009, 1009, 1009, 1009, 1009, 1010,
- 1010, 1010, 1010, 1010, 1011, 1011, 1011, 1012, 1012, 1012,
-
- 1015, 1015, 1016, 750, 1016, 1016, 1016, 1017, 1017, 1018,
- 1018, 748, 747, 746, 745, 744, 743, 742, 741, 740,
- 739, 737, 736, 735, 728, 727, 724, 723, 722, 721,
- 720, 719, 718, 716, 715, 714, 713, 712, 711, 710,
- 709, 708, 707, 706, 705, 704, 701, 700, 699, 698,
- 697, 696, 695, 694, 693, 692, 691, 690, 689, 688,
- 687, 686, 685, 684, 683, 679, 677, 676, 675, 674,
- 673, 672, 671, 670, 669, 668, 667, 666, 665, 664,
- 663, 662, 656, 654, 653, 652, 651, 650, 647, 646,
- 645, 644, 643, 642, 641, 640, 639, 638, 637, 636,
-
- 635, 634, 632, 624, 623, 619, 618, 615, 613, 612,
- 611, 610, 609, 608, 607, 606, 602, 601, 600, 598,
- 596, 595, 594, 593, 592, 591, 590, 589, 588, 587,
- 586, 585, 582, 577, 576, 575, 574, 571, 570, 569,
- 567, 566, 564, 563, 562, 561, 560, 558, 557, 555,
- 554, 553, 552, 551, 549, 548, 547, 546, 544, 543,
- 542, 541, 540, 536, 535, 534, 533, 532, 531, 528,
- 527, 526, 525, 524, 523, 522, 520, 519, 518, 517,
- 516, 515, 514, 512, 511, 508, 503, 502, 500, 499,
- 498, 495, 492, 491, 490, 489, 478, 477, 476, 474,
-
- 473, 472, 471, 470, 467, 465, 464, 463, 461, 460,
- 459, 458, 456, 455, 454, 453, 452, 450, 449, 444,
- 443, 441, 440, 439, 438, 437, 436, 435, 434, 433,
- 432, 431, 429, 428, 427, 426, 425, 424, 423, 422,
- 420, 419, 418, 417, 416, 415, 414, 410, 406, 405,
- 404, 401, 399, 389, 387, 383, 382, 381, 380, 378,
- 377, 375, 370, 369, 368, 365, 364, 363, 362, 361,
- 360, 359, 354, 352, 351, 350, 349, 348, 346, 345,
- 342, 341, 340, 339, 338, 337, 336, 335, 334, 333,
- 332, 331, 330, 329, 328, 327, 326, 325, 324, 323,
-
- 322, 321, 320, 319, 318, 317, 316, 315, 312, 310,
- 309, 308, 307, 306, 305, 304, 303, 301, 297, 295,
- 294, 293, 292, 288, 287, 286, 285, 284, 283, 282,
- 281, 280, 276, 274, 273, 272, 262, 261, 260, 259,
- 258, 257, 256, 255, 253, 252, 251, 250, 249, 247,
- 246, 245, 244, 243, 242, 241, 240, 239, 238, 237,
- 236, 235, 234, 233, 232, 231, 229, 228, 227, 226,
- 225, 224, 223, 222, 221, 220, 219, 217, 216, 215,
- 214, 213, 212, 211, 210, 209, 208, 207, 206, 205,
- 204, 203, 202, 201, 199, 198, 197, 196, 195, 194,
-
- 193, 192, 191, 190, 189, 188, 186, 185, 184, 183,
- 181, 180, 179, 178, 177, 175, 160, 159, 158, 157,
- 150, 149, 147, 146, 145, 141, 140, 139, 138, 137,
- 134, 133, 132, 131, 130, 128, 127, 125, 123, 122,
- 121, 119, 118, 117, 115, 114, 112, 111, 110, 109,
- 108, 107, 104, 103, 102, 101, 100, 99, 98, 97,
- 95, 94, 93, 92, 91, 90, 88, 87, 83, 79,
- 52, 38, 32, 22, 18, 14, 12, 11, 7, 6,
- 5, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008,
- 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008,
-
- 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008,
- 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008,
- 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008,
- 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008,
- 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008,
- 1008, 1008
+ 877, 869, 878, 879, 882, 883, 884, 885, 886, 887,
+ 888, 889, 890, 891, 892, 893, 894, 895, 896, 899,
+ 900, 901, 902, 903, 906, 907, 910, 911, 901, 912,
+ 914, 915, 916, 918, 919, 920, 925, 926, 927, 928,
+ 929, 930, 931, 932, 933, 934, 935, 936, 929, 938,
+ 939, 940, 941, 942, 943, 944, 945, 946, 948, 947,
+ 949, 952, 953, 954, 955, 946, 947, 957, 960, 961,
+
+ 962, 900, 965, 964, 968, 969, 970, 961, 962, 902,
+ 964, 971, 973, 974, 976, 977, 978, 979, 981, 982,
+ 983, 974, 984, 977, 987, 988, 928, 989, 990, 992,
+ 984, 993, 994, 997, 998, 989, 990, 999, 1000, 1001,
+ 994, 998, 1002, 1003, 999, 1004, 1005, 1012, 1013, 778,
+ 777, 776, 775, 1004, 1005, 774, 773, 772, 771, 965,
+ 770, 769, 768, 766, 765, 764, 763, 762, 761, 760,
+ 759, 976, 758, 757, 756, 755, 754, 753, 752, 751,
+ 749, 1000, 1001, 1008, 1008, 1008, 1008, 1008, 1009, 1009,
+ 1009, 1009, 1009, 1010, 1010, 1010, 1011, 1011, 1011, 1014,
+
+ 1014, 1015, 747, 1015, 1015, 1015, 1016, 1016, 1017, 1017,
+ 746, 745, 744, 743, 742, 741, 740, 739, 738, 736,
+ 735, 734, 727, 726, 723, 722, 721, 720, 719, 718,
+ 717, 715, 714, 713, 712, 711, 710, 709, 708, 707,
+ 706, 705, 704, 703, 700, 699, 698, 697, 696, 695,
+ 694, 693, 692, 691, 690, 689, 688, 687, 686, 685,
+ 684, 683, 682, 678, 676, 675, 674, 673, 672, 671,
+ 670, 669, 668, 667, 666, 665, 664, 663, 662, 661,
+ 655, 653, 652, 651, 650, 649, 646, 645, 644, 643,
+ 642, 641, 640, 639, 638, 637, 636, 635, 634, 633,
+
+ 631, 623, 622, 618, 617, 614, 612, 611, 610, 609,
+ 608, 607, 606, 605, 601, 600, 599, 597, 595, 594,
+ 593, 592, 591, 590, 589, 588, 587, 586, 585, 584,
+ 581, 576, 575, 574, 573, 570, 569, 568, 566, 565,
+ 563, 562, 561, 560, 559, 557, 556, 554, 553, 552,
+ 551, 550, 549, 548, 547, 546, 544, 543, 542, 541,
+ 540, 536, 535, 534, 533, 532, 531, 528, 527, 526,
+ 525, 524, 523, 522, 520, 519, 518, 517, 516, 515,
+ 514, 512, 511, 508, 503, 502, 500, 499, 498, 496,
+ 495, 492, 491, 490, 489, 478, 477, 476, 474, 473,
+
+ 472, 471, 470, 467, 465, 464, 463, 461, 460, 459,
+ 458, 456, 455, 454, 453, 452, 450, 449, 444, 443,
+ 441, 440, 439, 438, 437, 436, 435, 434, 433, 432,
+ 431, 429, 428, 427, 426, 425, 424, 423, 422, 420,
+ 419, 418, 417, 416, 415, 414, 410, 406, 405, 404,
+ 401, 399, 389, 387, 383, 382, 381, 380, 378, 377,
+ 375, 370, 369, 368, 365, 364, 363, 362, 361, 360,
+ 359, 354, 352, 351, 350, 349, 348, 346, 345, 342,
+ 341, 340, 339, 338, 337, 336, 335, 334, 333, 332,
+ 331, 330, 329, 328, 327, 326, 325, 324, 323, 322,
+
+ 321, 320, 319, 318, 317, 316, 315, 312, 310, 309,
+ 308, 307, 306, 305, 304, 303, 301, 297, 295, 294,
+ 293, 292, 288, 287, 286, 285, 284, 283, 282, 281,
+ 280, 276, 274, 273, 272, 262, 261, 260, 259, 258,
+ 257, 256, 255, 253, 252, 251, 250, 249, 247, 246,
+ 245, 244, 243, 242, 241, 240, 239, 238, 237, 236,
+ 235, 234, 233, 232, 231, 229, 228, 227, 226, 225,
+ 224, 223, 222, 221, 220, 219, 217, 216, 215, 214,
+ 213, 212, 211, 210, 209, 208, 207, 206, 205, 204,
+ 203, 202, 201, 199, 198, 197, 196, 195, 194, 193,
+
+ 192, 191, 190, 189, 188, 186, 185, 184, 183, 181,
+ 180, 179, 178, 177, 175, 160, 159, 158, 157, 150,
+ 149, 147, 146, 145, 141, 140, 139, 138, 137, 134,
+ 133, 132, 131, 130, 128, 127, 125, 123, 122, 121,
+ 119, 118, 117, 115, 114, 112, 111, 110, 109, 108,
+ 107, 104, 103, 102, 101, 100, 99, 98, 97, 95,
+ 94, 93, 92, 91, 90, 88, 87, 83, 79, 52,
+ 38, 32, 22, 18, 14, 12, 11, 7, 6, 5,
+ 1007, 1007, 1007, 1007, 1007, 1007, 1007, 1007, 1007, 1007,
+ 1007, 1007, 1007, 1007, 1007, 1007, 1007, 1007, 1007, 1007,
+
+ 1007, 1007, 1007, 1007, 1007, 1007, 1007, 1007, 1007, 1007,
+ 1007, 1007, 1007, 1007, 1007, 1007, 1007, 1007, 1007, 1007,
+ 1007, 1007, 1007, 1007, 1007, 1007, 1007, 1007, 1007, 1007,
+ 1007, 1007, 1007, 1007, 1007, 1007, 1007, 1007, 1007, 1007,
+ 1007, 1007, 1007, 1007, 1007, 1007, 1007, 1007, 1007, 1007,
+ 1007
} ;
/* The intent behind this definition is that it'll catch
@@ -1111,7 +1111,7 @@ static yyconst flex_int16_t yy_chk[1453] =
*/
#include <ctype.h>
#include <limits.h>
-#include "util/strtod.h"
+#include "strtod.h"
#include "ast.h"
#include "glsl_parser_extras.h"
#include "glsl_parser.h"
@@ -1169,8 +1169,7 @@ 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); \
+ yylval->identifier = strdup(yytext); \
return classify_identifier(yyextra, yytext); \
} \
} while (0)
@@ -1234,11 +1233,8 @@ literal_integer(char *text, int len, struct _mesa_glsl_parse_state *state,
#define LITERAL_INTEGER(base) \
literal_integer(yytext, yyleng, yyextra, yylval, yylloc, base)
-/* Note: When adding any start conditions to this list, you must also
-* update the "Internal compiler error" catch-all rule near the end of
-* this file. */
-#line 1242 "glsl_lexer.cpp"
+#line 1238 "glsl_lexer.cpp"
#define INITIAL 0
#define PP 1
@@ -1515,10 +1511,10 @@ YY_DECL
}
{
-#line 170 "glsl_lexer.ll"
+#line 165 "glsl_lexer.ll"
-#line 1522 "glsl_lexer.cpp"
+#line 1518 "glsl_lexer.cpp"
while ( 1 ) /* loops until end-of-file is reached */
{
@@ -1546,13 +1542,13 @@ yy_match:
while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
{
yy_current_state = (int) yy_def[yy_current_state];
- if ( yy_current_state >= 1009 )
+ if ( yy_current_state >= 1008 )
yy_c = yy_meta[(unsigned int) yy_c];
}
yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
++yy_cp;
}
- while ( yy_current_state != 1008 );
+ while ( yy_current_state != 1007 );
yy_cp = yyg->yy_last_accepting_cpos;
yy_current_state = yyg->yy_last_accepting_state;
@@ -1574,7 +1570,7 @@ do_action: /* This label is used only to access EOF actions. */
case 1:
YY_RULE_SETUP
-#line 172 "glsl_lexer.ll"
+#line 167 "glsl_lexer.ll"
;
YY_BREAK
/* Preprocessor tokens. */
@@ -1583,17 +1579,17 @@ case 2:
yyg->yy_c_buf_p = yy_cp -= 1;
YY_DO_BEFORE_ACTION; /* set up yytext again */
YY_RULE_SETUP
-#line 175 "glsl_lexer.ll"
+#line 170 "glsl_lexer.ll"
;
YY_BREAK
case 3:
YY_RULE_SETUP
-#line 176 "glsl_lexer.ll"
+#line 171 "glsl_lexer.ll"
{ BEGIN PP; return VERSION_TOK; }
YY_BREAK
case 4:
YY_RULE_SETUP
-#line 177 "glsl_lexer.ll"
+#line 172 "glsl_lexer.ll"
{ BEGIN PP; return EXTENSION; }
YY_BREAK
case 5:
@@ -1601,7 +1597,7 @@ case 5:
yyg->yy_c_buf_p = yy_cp -= 1;
YY_DO_BEFORE_ACTION; /* set up yytext again */
YY_RULE_SETUP
-#line 178 "glsl_lexer.ll"
+#line 173 "glsl_lexer.ll"
{
/* Eat characters until the first digit is
* encountered
@@ -1623,7 +1619,7 @@ case 6:
yyg->yy_c_buf_p = yy_cp -= 1;
YY_DO_BEFORE_ACTION; /* set up yytext again */
YY_RULE_SETUP
-#line 193 "glsl_lexer.ll"
+#line 188 "glsl_lexer.ll"
{
/* Eat characters until the first digit is
* encountered
@@ -1641,7 +1637,7 @@ YY_RULE_SETUP
YY_BREAK
case 7:
YY_RULE_SETUP
-#line 207 "glsl_lexer.ll"
+#line 202 "glsl_lexer.ll"
{
BEGIN PP;
return PRAGMA_DEBUG_ON;
@@ -1649,7 +1645,7 @@ YY_RULE_SETUP
YY_BREAK
case 8:
YY_RULE_SETUP
-#line 211 "glsl_lexer.ll"
+#line 206 "glsl_lexer.ll"
{
BEGIN PP;
return PRAGMA_DEBUG_OFF;
@@ -1657,7 +1653,7 @@ YY_RULE_SETUP
YY_BREAK
case 9:
YY_RULE_SETUP
-#line 215 "glsl_lexer.ll"
+#line 210 "glsl_lexer.ll"
{
BEGIN PP;
return PRAGMA_OPTIMIZE_ON;
@@ -1665,7 +1661,7 @@ YY_RULE_SETUP
YY_BREAK
case 10:
YY_RULE_SETUP
-#line 219 "glsl_lexer.ll"
+#line 214 "glsl_lexer.ll"
{
BEGIN PP;
return PRAGMA_OPTIMIZE_OFF;
@@ -1673,7 +1669,7 @@ YY_RULE_SETUP
YY_BREAK
case 11:
YY_RULE_SETUP
-#line 223 "glsl_lexer.ll"
+#line 218 "glsl_lexer.ll"
{
BEGIN PP;
return PRAGMA_INVARIANT_ALL;
@@ -1681,47 +1677,46 @@ YY_RULE_SETUP
YY_BREAK
case 12:
YY_RULE_SETUP
-#line 227 "glsl_lexer.ll"
+#line 222 "glsl_lexer.ll"
{ BEGIN PRAGMA; }
YY_BREAK
case 13:
/* rule 13 can match eol */
YY_RULE_SETUP
-#line 229 "glsl_lexer.ll"
+#line 224 "glsl_lexer.ll"
{ BEGIN 0; yylineno++; yycolumn = 0; }
YY_BREAK
case 14:
YY_RULE_SETUP
-#line 230 "glsl_lexer.ll"
+#line 225 "glsl_lexer.ll"
{ }
YY_BREAK
case 15:
YY_RULE_SETUP
-#line 232 "glsl_lexer.ll"
+#line 227 "glsl_lexer.ll"
{ }
YY_BREAK
case 16:
YY_RULE_SETUP
-#line 233 "glsl_lexer.ll"
+#line 228 "glsl_lexer.ll"
{ }
YY_BREAK
case 17:
YY_RULE_SETUP
-#line 234 "glsl_lexer.ll"
+#line 229 "glsl_lexer.ll"
return COLON;
YY_BREAK
case 18:
YY_RULE_SETUP
-#line 235 "glsl_lexer.ll"
+#line 230 "glsl_lexer.ll"
{
- void *mem_ctx = yyextra;
- yylval->identifier = ralloc_strdup(mem_ctx, yytext);
+ yylval->identifier = strdup(yytext);
return IDENTIFIER;
}
YY_BREAK
case 19:
YY_RULE_SETUP
-#line 240 "glsl_lexer.ll"
+#line 234 "glsl_lexer.ll"
{
yylval->n = strtol(yytext, NULL, 10);
return INTCONSTANT;
@@ -1730,436 +1725,431 @@ YY_RULE_SETUP
case 20:
/* rule 20 can match eol */
YY_RULE_SETUP
-#line 244 "glsl_lexer.ll"
+#line 238 "glsl_lexer.ll"
{ BEGIN 0; yylineno++; yycolumn = 0; return EOL; }
YY_BREAK
case 21:
+/* rule 21 can match eol */
YY_RULE_SETUP
-#line 245 "glsl_lexer.ll"
-{ return yytext[0]; }
- YY_BREAK
-case 22:
-/* rule 22 can match eol */
-YY_RULE_SETUP
-#line 247 "glsl_lexer.ll"
+#line 240 "glsl_lexer.ll"
{ yylineno++; yycolumn = 0; }
YY_BREAK
-case 23:
+case 22:
YY_RULE_SETUP
-#line 249 "glsl_lexer.ll"
+#line 242 "glsl_lexer.ll"
DEPRECATED_ES_KEYWORD(ATTRIBUTE);
YY_BREAK
-case 24:
+case 23:
YY_RULE_SETUP
-#line 250 "glsl_lexer.ll"
+#line 243 "glsl_lexer.ll"
return CONST_TOK;
YY_BREAK
-case 25:
+case 24:
YY_RULE_SETUP
-#line 251 "glsl_lexer.ll"
+#line 244 "glsl_lexer.ll"
return BOOL_TOK;
YY_BREAK
-case 26:
+case 25:
YY_RULE_SETUP
-#line 252 "glsl_lexer.ll"
+#line 245 "glsl_lexer.ll"
return FLOAT_TOK;
YY_BREAK
-case 27:
+case 26:
YY_RULE_SETUP
-#line 253 "glsl_lexer.ll"
+#line 246 "glsl_lexer.ll"
return INT_TOK;
YY_BREAK
-case 28:
+case 27:
YY_RULE_SETUP
-#line 254 "glsl_lexer.ll"
+#line 247 "glsl_lexer.ll"
KEYWORD(130, 300, 130, 300, UINT_TOK);
YY_BREAK
-case 29:
+case 28:
YY_RULE_SETUP
-#line 256 "glsl_lexer.ll"
+#line 249 "glsl_lexer.ll"
return BREAK;
YY_BREAK
-case 30:
+case 29:
YY_RULE_SETUP
-#line 257 "glsl_lexer.ll"
+#line 250 "glsl_lexer.ll"
return CONTINUE;
YY_BREAK
-case 31:
+case 30:
YY_RULE_SETUP
-#line 258 "glsl_lexer.ll"
+#line 251 "glsl_lexer.ll"
return DO;
YY_BREAK
-case 32:
+case 31:
YY_RULE_SETUP
-#line 259 "glsl_lexer.ll"
+#line 252 "glsl_lexer.ll"
return WHILE;
YY_BREAK
-case 33:
+case 32:
YY_RULE_SETUP
-#line 260 "glsl_lexer.ll"
+#line 253 "glsl_lexer.ll"
return ELSE;
YY_BREAK
-case 34:
+case 33:
YY_RULE_SETUP
-#line 261 "glsl_lexer.ll"
+#line 254 "glsl_lexer.ll"
return FOR;
YY_BREAK
-case 35:
+case 34:
YY_RULE_SETUP
-#line 262 "glsl_lexer.ll"
+#line 255 "glsl_lexer.ll"
return IF;
YY_BREAK
-case 36:
+case 35:
YY_RULE_SETUP
-#line 263 "glsl_lexer.ll"
+#line 256 "glsl_lexer.ll"
return DISCARD;
YY_BREAK
-case 37:
+case 36:
YY_RULE_SETUP
-#line 264 "glsl_lexer.ll"
+#line 257 "glsl_lexer.ll"
return RETURN;
YY_BREAK
-case 38:
+case 37:
YY_RULE_SETUP
-#line 266 "glsl_lexer.ll"
+#line 259 "glsl_lexer.ll"
return BVEC2;
YY_BREAK
-case 39:
+case 38:
YY_RULE_SETUP
-#line 267 "glsl_lexer.ll"
+#line 260 "glsl_lexer.ll"
return BVEC3;
YY_BREAK
-case 40:
+case 39:
YY_RULE_SETUP
-#line 268 "glsl_lexer.ll"
+#line 261 "glsl_lexer.ll"
return BVEC4;
YY_BREAK
-case 41:
+case 40:
YY_RULE_SETUP
-#line 269 "glsl_lexer.ll"
+#line 262 "glsl_lexer.ll"
return IVEC2;
YY_BREAK
-case 42:
+case 41:
YY_RULE_SETUP
-#line 270 "glsl_lexer.ll"
+#line 263 "glsl_lexer.ll"
return IVEC3;
YY_BREAK
-case 43:
+case 42:
YY_RULE_SETUP
-#line 271 "glsl_lexer.ll"
+#line 264 "glsl_lexer.ll"
return IVEC4;
YY_BREAK
-case 44:
+case 43:
YY_RULE_SETUP
-#line 272 "glsl_lexer.ll"
+#line 265 "glsl_lexer.ll"
KEYWORD(130, 300, 130, 300, UVEC2);
YY_BREAK
-case 45:
+case 44:
YY_RULE_SETUP
-#line 273 "glsl_lexer.ll"
+#line 266 "glsl_lexer.ll"
KEYWORD(130, 300, 130, 300, UVEC3);
YY_BREAK
-case 46:
+case 45:
YY_RULE_SETUP
-#line 274 "glsl_lexer.ll"
+#line 267 "glsl_lexer.ll"
KEYWORD(130, 300, 130, 300, UVEC4);
YY_BREAK
-case 47:
+case 46:
YY_RULE_SETUP
-#line 275 "glsl_lexer.ll"
+#line 268 "glsl_lexer.ll"
return VEC2;
YY_BREAK
-case 48:
+case 47:
YY_RULE_SETUP
-#line 276 "glsl_lexer.ll"
+#line 269 "glsl_lexer.ll"
return VEC3;
YY_BREAK
-case 49:
+case 48:
YY_RULE_SETUP
-#line 277 "glsl_lexer.ll"
+#line 270 "glsl_lexer.ll"
return VEC4;
YY_BREAK
-case 50:
+case 49:
YY_RULE_SETUP
-#line 278 "glsl_lexer.ll"
+#line 271 "glsl_lexer.ll"
return MAT2X2;
YY_BREAK
-case 51:
+case 50:
YY_RULE_SETUP
-#line 279 "glsl_lexer.ll"
+#line 272 "glsl_lexer.ll"
return MAT3X3;
YY_BREAK
-case 52:
+case 51:
YY_RULE_SETUP
-#line 280 "glsl_lexer.ll"
+#line 273 "glsl_lexer.ll"
return MAT4X4;
YY_BREAK
-case 53:
+case 52:
YY_RULE_SETUP
-#line 281 "glsl_lexer.ll"
+#line 274 "glsl_lexer.ll"
KEYWORD(120, 300, 120, 300, MAT2X2);
YY_BREAK
-case 54:
+case 53:
YY_RULE_SETUP
-#line 282 "glsl_lexer.ll"
+#line 275 "glsl_lexer.ll"
KEYWORD(120, 300, 120, 300, MAT2X3);
YY_BREAK
-case 55:
+case 54:
YY_RULE_SETUP
-#line 283 "glsl_lexer.ll"
+#line 276 "glsl_lexer.ll"
KEYWORD(120, 300, 120, 300, MAT2X4);
YY_BREAK
-case 56:
+case 55:
YY_RULE_SETUP
-#line 284 "glsl_lexer.ll"
+#line 277 "glsl_lexer.ll"
KEYWORD(120, 300, 120, 300, MAT3X2);
YY_BREAK
-case 57:
+case 56:
YY_RULE_SETUP
-#line 285 "glsl_lexer.ll"
+#line 278 "glsl_lexer.ll"
KEYWORD(120, 300, 120, 300, MAT3X3);
YY_BREAK
-case 58:
+case 57:
YY_RULE_SETUP
-#line 286 "glsl_lexer.ll"
+#line 279 "glsl_lexer.ll"
KEYWORD(120, 300, 120, 300, MAT3X4);
YY_BREAK
-case 59:
+case 58:
YY_RULE_SETUP
-#line 287 "glsl_lexer.ll"
+#line 280 "glsl_lexer.ll"
KEYWORD(120, 300, 120, 300, MAT4X2);
YY_BREAK
-case 60:
+case 59:
YY_RULE_SETUP
-#line 288 "glsl_lexer.ll"
+#line 281 "glsl_lexer.ll"
KEYWORD(120, 300, 120, 300, MAT4X3);
YY_BREAK
-case 61:
+case 60:
YY_RULE_SETUP
-#line 289 "glsl_lexer.ll"
+#line 282 "glsl_lexer.ll"
KEYWORD(120, 300, 120, 300, MAT4X4);
YY_BREAK
-case 62:
+case 61:
YY_RULE_SETUP
-#line 291 "glsl_lexer.ll"
+#line 284 "glsl_lexer.ll"
return IN_TOK;
YY_BREAK
-case 63:
+case 62:
YY_RULE_SETUP
-#line 292 "glsl_lexer.ll"
+#line 285 "glsl_lexer.ll"
return OUT_TOK;
YY_BREAK
-case 64:
+case 63:
YY_RULE_SETUP
-#line 293 "glsl_lexer.ll"
+#line 286 "glsl_lexer.ll"
return INOUT_TOK;
YY_BREAK
-case 65:
+case 64:
YY_RULE_SETUP
-#line 294 "glsl_lexer.ll"
+#line 287 "glsl_lexer.ll"
return UNIFORM;
YY_BREAK
-case 66:
+case 65:
YY_RULE_SETUP
-#line 295 "glsl_lexer.ll"
+#line 288 "glsl_lexer.ll"
DEPRECATED_ES_KEYWORD(VARYING);
YY_BREAK
-case 67:
+case 66:
YY_RULE_SETUP
-#line 296 "glsl_lexer.ll"
+#line 289 "glsl_lexer.ll"
KEYWORD(120, 300, 120, 300, CENTROID);
YY_BREAK
-case 68:
+case 67:
YY_RULE_SETUP
-#line 297 "glsl_lexer.ll"
+#line 290 "glsl_lexer.ll"
KEYWORD(120, 100, 120, 100, INVARIANT);
YY_BREAK
-case 69:
+case 68:
YY_RULE_SETUP
-#line 298 "glsl_lexer.ll"
+#line 291 "glsl_lexer.ll"
KEYWORD(130, 100, 130, 300, FLAT);
YY_BREAK
-case 70:
+case 69:
YY_RULE_SETUP
-#line 299 "glsl_lexer.ll"
+#line 292 "glsl_lexer.ll"
KEYWORD(130, 300, 130, 300, SMOOTH);
YY_BREAK
-case 71:
+case 70:
YY_RULE_SETUP
-#line 300 "glsl_lexer.ll"
+#line 293 "glsl_lexer.ll"
KEYWORD(130, 300, 130, 0, NOPERSPECTIVE);
YY_BREAK
-case 72:
+case 71:
YY_RULE_SETUP
-#line 302 "glsl_lexer.ll"
+#line 295 "glsl_lexer.ll"
DEPRECATED_ES_KEYWORD(SAMPLER1D);
YY_BREAK
-case 73:
+case 72:
YY_RULE_SETUP
-#line 303 "glsl_lexer.ll"
+#line 296 "glsl_lexer.ll"
return SAMPLER2D;
YY_BREAK
-case 74:
+case 73:
YY_RULE_SETUP
-#line 304 "glsl_lexer.ll"
+#line 297 "glsl_lexer.ll"
return SAMPLER3D;
YY_BREAK
-case 75:
+case 74:
YY_RULE_SETUP
-#line 305 "glsl_lexer.ll"
+#line 298 "glsl_lexer.ll"
return SAMPLERCUBE;
YY_BREAK
-case 76:
+case 75:
YY_RULE_SETUP
-#line 306 "glsl_lexer.ll"
+#line 299 "glsl_lexer.ll"
KEYWORD(130, 300, 130, 0, SAMPLER1DARRAY);
YY_BREAK
-case 77:
+case 76:
YY_RULE_SETUP
-#line 307 "glsl_lexer.ll"
+#line 300 "glsl_lexer.ll"
KEYWORD(130, 300, 130, 300, SAMPLER2DARRAY);
YY_BREAK
-case 78:
+case 77:
YY_RULE_SETUP
-#line 308 "glsl_lexer.ll"
+#line 301 "glsl_lexer.ll"
DEPRECATED_ES_KEYWORD(SAMPLER1DSHADOW);
YY_BREAK
-case 79:
+case 78:
YY_RULE_SETUP
-#line 309 "glsl_lexer.ll"
+#line 302 "glsl_lexer.ll"
return SAMPLER2DSHADOW;
YY_BREAK
-case 80:
+case 79:
YY_RULE_SETUP
-#line 310 "glsl_lexer.ll"
+#line 303 "glsl_lexer.ll"
KEYWORD(130, 300, 130, 300, SAMPLERCUBESHADOW);
YY_BREAK
-case 81:
+case 80:
YY_RULE_SETUP
-#line 311 "glsl_lexer.ll"
+#line 304 "glsl_lexer.ll"
KEYWORD(130, 300, 130, 0, SAMPLER1DARRAYSHADOW);
YY_BREAK
-case 82:
+case 81:
YY_RULE_SETUP
-#line 312 "glsl_lexer.ll"
+#line 305 "glsl_lexer.ll"
KEYWORD(130, 300, 130, 300, SAMPLER2DARRAYSHADOW);
YY_BREAK
-case 83:
+case 82:
YY_RULE_SETUP
-#line 313 "glsl_lexer.ll"
+#line 306 "glsl_lexer.ll"
KEYWORD(130, 300, 130, 0, ISAMPLER1D);
YY_BREAK
-case 84:
+case 83:
YY_RULE_SETUP
-#line 314 "glsl_lexer.ll"
+#line 307 "glsl_lexer.ll"
KEYWORD(130, 300, 130, 300, ISAMPLER2D);
YY_BREAK
-case 85:
+case 84:
YY_RULE_SETUP
-#line 315 "glsl_lexer.ll"
+#line 308 "glsl_lexer.ll"
KEYWORD(130, 300, 130, 300, ISAMPLER3D);
YY_BREAK
-case 86:
+case 85:
YY_RULE_SETUP
-#line 316 "glsl_lexer.ll"
+#line 309 "glsl_lexer.ll"
KEYWORD(130, 300, 130, 300, ISAMPLERCUBE);
YY_BREAK
-case 87:
+case 86:
YY_RULE_SETUP
-#line 317 "glsl_lexer.ll"
+#line 310 "glsl_lexer.ll"
KEYWORD(130, 300, 130, 0, ISAMPLER1DARRAY);
YY_BREAK
-case 88:
+case 87:
YY_RULE_SETUP
-#line 318 "glsl_lexer.ll"
+#line 311 "glsl_lexer.ll"
KEYWORD(130, 300, 130, 300, ISAMPLER2DARRAY);
YY_BREAK
-case 89:
+case 88:
YY_RULE_SETUP
-#line 319 "glsl_lexer.ll"
+#line 312 "glsl_lexer.ll"
KEYWORD(130, 300, 130, 0, USAMPLER1D);
YY_BREAK
-case 90:
+case 89:
YY_RULE_SETUP
-#line 320 "glsl_lexer.ll"
+#line 313 "glsl_lexer.ll"
KEYWORD(130, 300, 130, 300, USAMPLER2D);
YY_BREAK
-case 91:
+case 90:
YY_RULE_SETUP
-#line 321 "glsl_lexer.ll"
+#line 314 "glsl_lexer.ll"
KEYWORD(130, 300, 130, 300, USAMPLER3D);
YY_BREAK
-case 92:
+case 91:
YY_RULE_SETUP
-#line 322 "glsl_lexer.ll"
+#line 315 "glsl_lexer.ll"
KEYWORD(130, 300, 130, 300, USAMPLERCUBE);
YY_BREAK
-case 93:
+case 92:
YY_RULE_SETUP
-#line 323 "glsl_lexer.ll"
+#line 316 "glsl_lexer.ll"
KEYWORD(130, 300, 130, 0, USAMPLER1DARRAY);
YY_BREAK
-case 94:
+case 93:
YY_RULE_SETUP
-#line 324 "glsl_lexer.ll"
+#line 317 "glsl_lexer.ll"
KEYWORD(130, 300, 130, 300, USAMPLER2DARRAY);
YY_BREAK
/* additional keywords in ARB_texture_multisample, included in GLSL 1.50 */
/* these are reserved but not defined in GLSL 3.00 */
-case 95:
+case 94:
YY_RULE_SETUP
-#line 328 "glsl_lexer.ll"
+#line 321 "glsl_lexer.ll"
KEYWORD_WITH_ALT(150, 300, 150, 0, yyextra->ARB_texture_multisample_enable, SAMPLER2DMS);
YY_BREAK
-case 96:
+case 95:
YY_RULE_SETUP
-#line 329 "glsl_lexer.ll"
+#line 322 "glsl_lexer.ll"
KEYWORD_WITH_ALT(150, 300, 150, 0, yyextra->ARB_texture_multisample_enable, ISAMPLER2DMS);
YY_BREAK
-case 97:
+case 96:
YY_RULE_SETUP
-#line 330 "glsl_lexer.ll"
+#line 323 "glsl_lexer.ll"
KEYWORD_WITH_ALT(150, 300, 150, 0, yyextra->ARB_texture_multisample_enable, USAMPLER2DMS);
YY_BREAK
-case 98:
+case 97:
YY_RULE_SETUP
-#line 331 "glsl_lexer.ll"
+#line 324 "glsl_lexer.ll"
KEYWORD_WITH_ALT(150, 300, 150, 0, yyextra->ARB_texture_multisample_enable, SAMPLER2DMSARRAY);
YY_BREAK
-case 99:
+case 98:
YY_RULE_SETUP
-#line 332 "glsl_lexer.ll"
+#line 325 "glsl_lexer.ll"
KEYWORD_WITH_ALT(150, 300, 150, 0, yyextra->ARB_texture_multisample_enable, ISAMPLER2DMSARRAY);
YY_BREAK
-case 100:
+case 99:
YY_RULE_SETUP
-#line 333 "glsl_lexer.ll"
+#line 326 "glsl_lexer.ll"
KEYWORD_WITH_ALT(150, 300, 150, 0, yyextra->ARB_texture_multisample_enable, USAMPLER2DMSARRAY);
YY_BREAK
/* keywords available with ARB_texture_cube_map_array_enable extension on desktop GLSL */
-case 101:
+case 100:
YY_RULE_SETUP
-#line 336 "glsl_lexer.ll"
+#line 329 "glsl_lexer.ll"
KEYWORD_WITH_ALT(400, 0, 400, 0, yyextra->ARB_texture_cube_map_array_enable, SAMPLERCUBEARRAY);
YY_BREAK
-case 102:
+case 101:
YY_RULE_SETUP
-#line 337 "glsl_lexer.ll"
+#line 330 "glsl_lexer.ll"
KEYWORD_WITH_ALT(400, 0, 400, 0, yyextra->ARB_texture_cube_map_array_enable, ISAMPLERCUBEARRAY);
YY_BREAK
-case 103:
+case 102:
YY_RULE_SETUP
-#line 338 "glsl_lexer.ll"
+#line 331 "glsl_lexer.ll"
KEYWORD_WITH_ALT(400, 0, 400, 0, yyextra->ARB_texture_cube_map_array_enable, USAMPLERCUBEARRAY);
YY_BREAK
-case 104:
+case 103:
YY_RULE_SETUP
-#line 339 "glsl_lexer.ll"
+#line 332 "glsl_lexer.ll"
KEYWORD_WITH_ALT(400, 0, 400, 0, yyextra->ARB_texture_cube_map_array_enable, SAMPLERCUBEARRAYSHADOW);
YY_BREAK
-case 105:
+case 104:
YY_RULE_SETUP
-#line 341 "glsl_lexer.ll"
+#line 334 "glsl_lexer.ll"
{
if (yyextra->OES_EGL_image_external_enable)
return SAMPLEREXTERNALOES;
@@ -2167,247 +2157,240 @@ YY_RULE_SETUP
return IDENTIFIER;
}
YY_BREAK
-/* keywords available with ARB_gpu_shader5 */
-case 106:
-YY_RULE_SETUP
-#line 349 "glsl_lexer.ll"
-KEYWORD_WITH_ALT(400, 0, 400, 0, yyextra->ARB_gpu_shader5_enable, PRECISE);
- YY_BREAK
/* keywords available with ARB_shader_image_load_store */
-case 107:
+case 105:
YY_RULE_SETUP
-#line 352 "glsl_lexer.ll"
+#line 342 "glsl_lexer.ll"
KEYWORD_WITH_ALT(130, 300, 420, 0, yyextra->ARB_shader_image_load_store_enable, IMAGE1D);
YY_BREAK
-case 108:
+case 106:
YY_RULE_SETUP
-#line 353 "glsl_lexer.ll"
+#line 343 "glsl_lexer.ll"
KEYWORD_WITH_ALT(130, 300, 420, 0, yyextra->ARB_shader_image_load_store_enable, IMAGE2D);
YY_BREAK
-case 109:
+case 107:
YY_RULE_SETUP
-#line 354 "glsl_lexer.ll"
+#line 344 "glsl_lexer.ll"
KEYWORD_WITH_ALT(130, 300, 420, 0, yyextra->ARB_shader_image_load_store_enable, IMAGE3D);
YY_BREAK
-case 110:
+case 108:
YY_RULE_SETUP
-#line 355 "glsl_lexer.ll"
+#line 345 "glsl_lexer.ll"
KEYWORD_WITH_ALT(130, 300, 420, 0, yyextra->ARB_shader_image_load_store_enable, IMAGE2DRECT);
YY_BREAK
-case 111:
+case 109:
YY_RULE_SETUP
-#line 356 "glsl_lexer.ll"
+#line 346 "glsl_lexer.ll"
KEYWORD_WITH_ALT(130, 300, 420, 0, yyextra->ARB_shader_image_load_store_enable, IMAGECUBE);
YY_BREAK
-case 112:
+case 110:
YY_RULE_SETUP
-#line 357 "glsl_lexer.ll"
+#line 347 "glsl_lexer.ll"
KEYWORD_WITH_ALT(130, 300, 420, 0, yyextra->ARB_shader_image_load_store_enable, IMAGEBUFFER);
YY_BREAK
-case 113:
+case 111:
YY_RULE_SETUP
-#line 358 "glsl_lexer.ll"
+#line 348 "glsl_lexer.ll"
KEYWORD_WITH_ALT(130, 300, 420, 0, yyextra->ARB_shader_image_load_store_enable, IMAGE1DARRAY);
YY_BREAK
-case 114:
+case 112:
YY_RULE_SETUP
-#line 359 "glsl_lexer.ll"
+#line 349 "glsl_lexer.ll"
KEYWORD_WITH_ALT(130, 300, 420, 0, yyextra->ARB_shader_image_load_store_enable, IMAGE2DARRAY);
YY_BREAK
-case 115:
+case 113:
YY_RULE_SETUP
-#line 360 "glsl_lexer.ll"
+#line 350 "glsl_lexer.ll"
KEYWORD_WITH_ALT(130, 300, 420, 0, yyextra->ARB_shader_image_load_store_enable, IMAGECUBEARRAY);
YY_BREAK
-case 116:
+case 114:
YY_RULE_SETUP
-#line 361 "glsl_lexer.ll"
+#line 351 "glsl_lexer.ll"
KEYWORD_WITH_ALT(130, 300, 420, 0, yyextra->ARB_shader_image_load_store_enable, IMAGE2DMS);
YY_BREAK
-case 117:
+case 115:
YY_RULE_SETUP
-#line 362 "glsl_lexer.ll"
+#line 352 "glsl_lexer.ll"
KEYWORD_WITH_ALT(130, 300, 420, 0, yyextra->ARB_shader_image_load_store_enable, IMAGE2DMSARRAY);
YY_BREAK
-case 118:
+case 116:
YY_RULE_SETUP
-#line 363 "glsl_lexer.ll"
+#line 353 "glsl_lexer.ll"
KEYWORD_WITH_ALT(130, 300, 420, 0, yyextra->ARB_shader_image_load_store_enable, IIMAGE1D);
YY_BREAK
-case 119:
+case 117:
YY_RULE_SETUP
-#line 364 "glsl_lexer.ll"
+#line 354 "glsl_lexer.ll"
KEYWORD_WITH_ALT(130, 300, 420, 0, yyextra->ARB_shader_image_load_store_enable, IIMAGE2D);
YY_BREAK
-case 120:
+case 118:
YY_RULE_SETUP
-#line 365 "glsl_lexer.ll"
+#line 355 "glsl_lexer.ll"
KEYWORD_WITH_ALT(130, 300, 420, 0, yyextra->ARB_shader_image_load_store_enable, IIMAGE3D);
YY_BREAK
-case 121:
+case 119:
YY_RULE_SETUP
-#line 366 "glsl_lexer.ll"
+#line 356 "glsl_lexer.ll"
KEYWORD_WITH_ALT(130, 300, 420, 0, yyextra->ARB_shader_image_load_store_enable, IIMAGE2DRECT);
YY_BREAK
-case 122:
+case 120:
YY_RULE_SETUP
-#line 367 "glsl_lexer.ll"
+#line 357 "glsl_lexer.ll"
KEYWORD_WITH_ALT(130, 300, 420, 0, yyextra->ARB_shader_image_load_store_enable, IIMAGECUBE);
YY_BREAK
-case 123:
+case 121:
YY_RULE_SETUP
-#line 368 "glsl_lexer.ll"
+#line 358 "glsl_lexer.ll"
KEYWORD_WITH_ALT(130, 300, 420, 0, yyextra->ARB_shader_image_load_store_enable, IIMAGEBUFFER);
YY_BREAK
-case 124:
+case 122:
YY_RULE_SETUP
-#line 369 "glsl_lexer.ll"
+#line 359 "glsl_lexer.ll"
KEYWORD_WITH_ALT(130, 300, 420, 0, yyextra->ARB_shader_image_load_store_enable, IIMAGE1DARRAY);
YY_BREAK
-case 125:
+case 123:
YY_RULE_SETUP
-#line 370 "glsl_lexer.ll"
+#line 360 "glsl_lexer.ll"
KEYWORD_WITH_ALT(130, 300, 420, 0, yyextra->ARB_shader_image_load_store_enable, IIMAGE2DARRAY);
YY_BREAK
-case 126:
+case 124:
YY_RULE_SETUP
-#line 371 "glsl_lexer.ll"
+#line 361 "glsl_lexer.ll"
KEYWORD_WITH_ALT(130, 300, 420, 0, yyextra->ARB_shader_image_load_store_enable, IIMAGECUBEARRAY);
YY_BREAK
-case 127:
+case 125:
YY_RULE_SETUP
-#line 372 "glsl_lexer.ll"
+#line 362 "glsl_lexer.ll"
KEYWORD_WITH_ALT(130, 300, 420, 0, yyextra->ARB_shader_image_load_store_enable, IIMAGE2DMS);
YY_BREAK
-case 128:
+case 126:
YY_RULE_SETUP
-#line 373 "glsl_lexer.ll"
+#line 363 "glsl_lexer.ll"
KEYWORD_WITH_ALT(130, 300, 420, 0, yyextra->ARB_shader_image_load_store_enable, IIMAGE2DMSARRAY);
YY_BREAK
-case 129:
+case 127:
YY_RULE_SETUP
-#line 374 "glsl_lexer.ll"
+#line 364 "glsl_lexer.ll"
KEYWORD_WITH_ALT(130, 300, 420, 0, yyextra->ARB_shader_image_load_store_enable, UIMAGE1D);
YY_BREAK
-case 130:
+case 128:
YY_RULE_SETUP
-#line 375 "glsl_lexer.ll"
+#line 365 "glsl_lexer.ll"
KEYWORD_WITH_ALT(130, 300, 420, 0, yyextra->ARB_shader_image_load_store_enable, UIMAGE2D);
YY_BREAK
-case 131:
+case 129:
YY_RULE_SETUP
-#line 376 "glsl_lexer.ll"
+#line 366 "glsl_lexer.ll"
KEYWORD_WITH_ALT(130, 300, 420, 0, yyextra->ARB_shader_image_load_store_enable, UIMAGE3D);
YY_BREAK
-case 132:
+case 130:
YY_RULE_SETUP
-#line 377 "glsl_lexer.ll"
+#line 367 "glsl_lexer.ll"
KEYWORD_WITH_ALT(130, 300, 420, 0, yyextra->ARB_shader_image_load_store_enable, UIMAGE2DRECT);
YY_BREAK
-case 133:
+case 131:
YY_RULE_SETUP
-#line 378 "glsl_lexer.ll"
+#line 368 "glsl_lexer.ll"
KEYWORD_WITH_ALT(130, 300, 420, 0, yyextra->ARB_shader_image_load_store_enable, UIMAGECUBE);
YY_BREAK
-case 134:
+case 132:
YY_RULE_SETUP
-#line 379 "glsl_lexer.ll"
+#line 369 "glsl_lexer.ll"
KEYWORD_WITH_ALT(130, 300, 420, 0, yyextra->ARB_shader_image_load_store_enable, UIMAGEBUFFER);
YY_BREAK
-case 135:
+case 133:
YY_RULE_SETUP
-#line 380 "glsl_lexer.ll"
+#line 370 "glsl_lexer.ll"
KEYWORD_WITH_ALT(130, 300, 420, 0, yyextra->ARB_shader_image_load_store_enable, UIMAGE1DARRAY);
YY_BREAK
-case 136:
+case 134:
YY_RULE_SETUP
-#line 381 "glsl_lexer.ll"
+#line 371 "glsl_lexer.ll"
KEYWORD_WITH_ALT(130, 300, 420, 0, yyextra->ARB_shader_image_load_store_enable, UIMAGE2DARRAY);
YY_BREAK
-case 137:
+case 135:
YY_RULE_SETUP
-#line 382 "glsl_lexer.ll"
+#line 372 "glsl_lexer.ll"
KEYWORD_WITH_ALT(130, 300, 420, 0, yyextra->ARB_shader_image_load_store_enable, UIMAGECUBEARRAY);
YY_BREAK
-case 138:
+case 136:
YY_RULE_SETUP
-#line 383 "glsl_lexer.ll"
+#line 373 "glsl_lexer.ll"
KEYWORD_WITH_ALT(130, 300, 420, 0, yyextra->ARB_shader_image_load_store_enable, UIMAGE2DMS);
YY_BREAK
-case 139:
+case 137:
YY_RULE_SETUP
-#line 384 "glsl_lexer.ll"
+#line 374 "glsl_lexer.ll"
KEYWORD_WITH_ALT(130, 300, 420, 0, yyextra->ARB_shader_image_load_store_enable, UIMAGE2DMSARRAY);
YY_BREAK
-case 140:
+case 138:
YY_RULE_SETUP
-#line 385 "glsl_lexer.ll"
+#line 375 "glsl_lexer.ll"
KEYWORD(130, 300, 0, 0, IMAGE1DSHADOW);
YY_BREAK
-case 141:
+case 139:
YY_RULE_SETUP
-#line 386 "glsl_lexer.ll"
+#line 376 "glsl_lexer.ll"
KEYWORD(130, 300, 0, 0, IMAGE2DSHADOW);
YY_BREAK
-case 142:
+case 140:
YY_RULE_SETUP
-#line 387 "glsl_lexer.ll"
+#line 377 "glsl_lexer.ll"
KEYWORD(130, 300, 0, 0, IMAGE1DARRAYSHADOW);
YY_BREAK
-case 143:
+case 141:
YY_RULE_SETUP
-#line 388 "glsl_lexer.ll"
+#line 378 "glsl_lexer.ll"
KEYWORD(130, 300, 0, 0, IMAGE2DARRAYSHADOW);
YY_BREAK
-case 144:
+case 142:
YY_RULE_SETUP
-#line 390 "glsl_lexer.ll"
+#line 380 "glsl_lexer.ll"
KEYWORD_WITH_ALT(420, 300, 420, 0, yyextra->ARB_shader_image_load_store_enable, COHERENT);
YY_BREAK
-case 145:
+case 143:
YY_RULE_SETUP
-#line 391 "glsl_lexer.ll"
+#line 381 "glsl_lexer.ll"
KEYWORD_WITH_ALT(110, 100, 420, 0, yyextra->ARB_shader_image_load_store_enable, VOLATILE);
YY_BREAK
-case 146:
+case 144:
YY_RULE_SETUP
-#line 392 "glsl_lexer.ll"
+#line 382 "glsl_lexer.ll"
KEYWORD_WITH_ALT(420, 300, 420, 0, yyextra->ARB_shader_image_load_store_enable, RESTRICT);
YY_BREAK
-case 147:
+case 145:
YY_RULE_SETUP
-#line 393 "glsl_lexer.ll"
+#line 383 "glsl_lexer.ll"
KEYWORD_WITH_ALT(420, 300, 420, 0, yyextra->ARB_shader_image_load_store_enable, READONLY);
YY_BREAK
-case 148:
+case 146:
YY_RULE_SETUP
-#line 394 "glsl_lexer.ll"
+#line 384 "glsl_lexer.ll"
KEYWORD_WITH_ALT(420, 300, 420, 0, yyextra->ARB_shader_image_load_store_enable, WRITEONLY);
YY_BREAK
-case 149:
+case 147:
YY_RULE_SETUP
-#line 396 "glsl_lexer.ll"
+#line 386 "glsl_lexer.ll"
KEYWORD_WITH_ALT(420, 300, 420, 0, yyextra->ARB_shader_atomic_counters_enable, ATOMIC_UINT);
YY_BREAK
-case 150:
+case 148:
YY_RULE_SETUP
-#line 398 "glsl_lexer.ll"
+#line 388 "glsl_lexer.ll"
return STRUCT;
YY_BREAK
-case 151:
+case 149:
YY_RULE_SETUP
-#line 399 "glsl_lexer.ll"
+#line 389 "glsl_lexer.ll"
return VOID_TOK;
YY_BREAK
-case 152:
+case 150:
YY_RULE_SETUP
-#line 401 "glsl_lexer.ll"
+#line 391 "glsl_lexer.ll"
{
if ((yyextra->is_version(140, 300))
|| yyextra->AMD_conservative_depth_enable
|| yyextra->ARB_conservative_depth_enable
|| yyextra->ARB_explicit_attrib_location_enable
- || yyextra->ARB_explicit_uniform_location_enable
|| yyextra->has_separate_shader_objects()
|| yyextra->ARB_uniform_buffer_object_enable
|| yyextra->ARB_fragment_coord_conventions_enable
@@ -2415,512 +2398,511 @@ YY_RULE_SETUP
|| yyextra->ARB_compute_shader_enable) {
return LAYOUT_TOK;
} else {
- void *mem_ctx = yyextra;
- yylval->identifier = ralloc_strdup(mem_ctx, yytext);
+ yylval->identifier = strdup(yytext);
return classify_identifier(yyextra, yytext);
}
}
YY_BREAK
-case 153:
+case 151:
YY_RULE_SETUP
-#line 420 "glsl_lexer.ll"
+#line 408 "glsl_lexer.ll"
return INC_OP;
YY_BREAK
-case 154:
+case 152:
YY_RULE_SETUP
-#line 421 "glsl_lexer.ll"
+#line 409 "glsl_lexer.ll"
return DEC_OP;
YY_BREAK
-case 155:
+case 153:
YY_RULE_SETUP
-#line 422 "glsl_lexer.ll"
+#line 410 "glsl_lexer.ll"
return LE_OP;
YY_BREAK
-case 156:
+case 154:
YY_RULE_SETUP
-#line 423 "glsl_lexer.ll"
+#line 411 "glsl_lexer.ll"
return GE_OP;
YY_BREAK
-case 157:
+case 155:
YY_RULE_SETUP
-#line 424 "glsl_lexer.ll"
+#line 412 "glsl_lexer.ll"
return EQ_OP;
YY_BREAK
-case 158:
+case 156:
YY_RULE_SETUP
-#line 425 "glsl_lexer.ll"
+#line 413 "glsl_lexer.ll"
return NE_OP;
YY_BREAK
-case 159:
+case 157:
YY_RULE_SETUP
-#line 426 "glsl_lexer.ll"
+#line 414 "glsl_lexer.ll"
return AND_OP;
YY_BREAK
-case 160:
+case 158:
YY_RULE_SETUP
-#line 427 "glsl_lexer.ll"
+#line 415 "glsl_lexer.ll"
return OR_OP;
YY_BREAK
-case 161:
+case 159:
YY_RULE_SETUP
-#line 428 "glsl_lexer.ll"
+#line 416 "glsl_lexer.ll"
return XOR_OP;
YY_BREAK
-case 162:
+case 160:
YY_RULE_SETUP
-#line 429 "glsl_lexer.ll"
+#line 417 "glsl_lexer.ll"
return LEFT_OP;
YY_BREAK
-case 163:
+case 161:
YY_RULE_SETUP
-#line 430 "glsl_lexer.ll"
+#line 418 "glsl_lexer.ll"
return RIGHT_OP;
YY_BREAK
-case 164:
+case 162:
YY_RULE_SETUP
-#line 432 "glsl_lexer.ll"
+#line 420 "glsl_lexer.ll"
return MUL_ASSIGN;
YY_BREAK
-case 165:
+case 163:
YY_RULE_SETUP
-#line 433 "glsl_lexer.ll"
+#line 421 "glsl_lexer.ll"
return DIV_ASSIGN;
YY_BREAK
-case 166:
+case 164:
YY_RULE_SETUP
-#line 434 "glsl_lexer.ll"
+#line 422 "glsl_lexer.ll"
return ADD_ASSIGN;
YY_BREAK
-case 167:
+case 165:
YY_RULE_SETUP
-#line 435 "glsl_lexer.ll"
+#line 423 "glsl_lexer.ll"
return MOD_ASSIGN;
YY_BREAK
-case 168:
+case 166:
YY_RULE_SETUP
-#line 436 "glsl_lexer.ll"
+#line 424 "glsl_lexer.ll"
return LEFT_ASSIGN;
YY_BREAK
-case 169:
+case 167:
YY_RULE_SETUP
-#line 437 "glsl_lexer.ll"
+#line 425 "glsl_lexer.ll"
return RIGHT_ASSIGN;
YY_BREAK
-case 170:
+case 168:
YY_RULE_SETUP
-#line 438 "glsl_lexer.ll"
+#line 426 "glsl_lexer.ll"
return AND_ASSIGN;
YY_BREAK
-case 171:
+case 169:
YY_RULE_SETUP
-#line 439 "glsl_lexer.ll"
+#line 427 "glsl_lexer.ll"
return XOR_ASSIGN;
YY_BREAK
-case 172:
+case 170:
YY_RULE_SETUP
-#line 440 "glsl_lexer.ll"
+#line 428 "glsl_lexer.ll"
return OR_ASSIGN;
YY_BREAK
-case 173:
+case 171:
YY_RULE_SETUP
-#line 441 "glsl_lexer.ll"
+#line 429 "glsl_lexer.ll"
return SUB_ASSIGN;
YY_BREAK
-case 174:
+case 172:
YY_RULE_SETUP
-#line 443 "glsl_lexer.ll"
+#line 431 "glsl_lexer.ll"
{
return LITERAL_INTEGER(10);
}
YY_BREAK
-case 175:
+case 173:
YY_RULE_SETUP
-#line 446 "glsl_lexer.ll"
+#line 434 "glsl_lexer.ll"
{
return LITERAL_INTEGER(16);
}
YY_BREAK
-case 176:
+case 174:
YY_RULE_SETUP
-#line 449 "glsl_lexer.ll"
+#line 437 "glsl_lexer.ll"
{
return LITERAL_INTEGER(8);
}
YY_BREAK
-case 177:
+case 175:
YY_RULE_SETUP
-#line 453 "glsl_lexer.ll"
+#line 441 "glsl_lexer.ll"
{
- yylval->real = _mesa_strtof(yytext, NULL);
+ yylval->real = glsl_strtof(yytext, NULL);
return FLOATCONSTANT;
}
YY_BREAK
-case 178:
+case 176:
YY_RULE_SETUP
-#line 457 "glsl_lexer.ll"
+#line 445 "glsl_lexer.ll"
{
- yylval->real = _mesa_strtof(yytext, NULL);
+ yylval->real = glsl_strtof(yytext, NULL);
return FLOATCONSTANT;
}
YY_BREAK
-case 179:
+case 177:
YY_RULE_SETUP
-#line 461 "glsl_lexer.ll"
+#line 449 "glsl_lexer.ll"
{
- yylval->real = _mesa_strtof(yytext, NULL);
+ yylval->real = glsl_strtof(yytext, NULL);
return FLOATCONSTANT;
}
YY_BREAK
-case 180:
+case 178:
YY_RULE_SETUP
-#line 465 "glsl_lexer.ll"
+#line 453 "glsl_lexer.ll"
{
- yylval->real = _mesa_strtof(yytext, NULL);
+ yylval->real = glsl_strtof(yytext, NULL);
return FLOATCONSTANT;
}
YY_BREAK
-case 181:
+case 179:
YY_RULE_SETUP
-#line 469 "glsl_lexer.ll"
+#line 457 "glsl_lexer.ll"
{
- yylval->real = _mesa_strtof(yytext, NULL);
+ yylval->real = glsl_strtof(yytext, NULL);
return FLOATCONSTANT;
}
YY_BREAK
-case 182:
+case 180:
YY_RULE_SETUP
-#line 474 "glsl_lexer.ll"
+#line 462 "glsl_lexer.ll"
{
yylval->n = 1;
return BOOLCONSTANT;
}
YY_BREAK
-case 183:
+case 181:
YY_RULE_SETUP
-#line 478 "glsl_lexer.ll"
+#line 466 "glsl_lexer.ll"
{
yylval->n = 0;
return BOOLCONSTANT;
}
YY_BREAK
/* Reserved words in GLSL 1.10. */
-case 184:
+case 182:
YY_RULE_SETUP
-#line 485 "glsl_lexer.ll"
+#line 473 "glsl_lexer.ll"
KEYWORD(110, 100, 0, 0, ASM);
YY_BREAK
-case 185:
+case 183:
YY_RULE_SETUP
-#line 486 "glsl_lexer.ll"
+#line 474 "glsl_lexer.ll"
KEYWORD(110, 100, 0, 0, CLASS);
YY_BREAK
-case 186:
+case 184:
YY_RULE_SETUP
-#line 487 "glsl_lexer.ll"
+#line 475 "glsl_lexer.ll"
KEYWORD(110, 100, 0, 0, UNION);
YY_BREAK
-case 187:
+case 185:
YY_RULE_SETUP
-#line 488 "glsl_lexer.ll"
+#line 476 "glsl_lexer.ll"
KEYWORD(110, 100, 0, 0, ENUM);
YY_BREAK
-case 188:
+case 186:
YY_RULE_SETUP
-#line 489 "glsl_lexer.ll"
+#line 477 "glsl_lexer.ll"
KEYWORD(110, 100, 0, 0, TYPEDEF);
YY_BREAK
-case 189:
+case 187:
YY_RULE_SETUP
-#line 490 "glsl_lexer.ll"
+#line 478 "glsl_lexer.ll"
KEYWORD(110, 100, 0, 0, TEMPLATE);
YY_BREAK
-case 190:
+case 188:
YY_RULE_SETUP
-#line 491 "glsl_lexer.ll"
+#line 479 "glsl_lexer.ll"
KEYWORD(110, 100, 0, 0, THIS);
YY_BREAK
-case 191:
+case 189:
YY_RULE_SETUP
-#line 492 "glsl_lexer.ll"
+#line 480 "glsl_lexer.ll"
KEYWORD_WITH_ALT(110, 100, 140, 300, yyextra->ARB_uniform_buffer_object_enable, PACKED_TOK);
YY_BREAK
-case 192:
+case 190:
YY_RULE_SETUP
-#line 493 "glsl_lexer.ll"
+#line 481 "glsl_lexer.ll"
KEYWORD(110, 100, 0, 0, GOTO);
YY_BREAK
-case 193:
+case 191:
YY_RULE_SETUP
-#line 494 "glsl_lexer.ll"
+#line 482 "glsl_lexer.ll"
KEYWORD(110, 100, 130, 300, SWITCH);
YY_BREAK
-case 194:
+case 192:
YY_RULE_SETUP
-#line 495 "glsl_lexer.ll"
+#line 483 "glsl_lexer.ll"
KEYWORD(110, 100, 130, 300, DEFAULT);
YY_BREAK
-case 195:
+case 193:
YY_RULE_SETUP
-#line 496 "glsl_lexer.ll"
+#line 484 "glsl_lexer.ll"
KEYWORD(110, 100, 0, 0, INLINE_TOK);
YY_BREAK
-case 196:
+case 194:
YY_RULE_SETUP
-#line 497 "glsl_lexer.ll"
+#line 485 "glsl_lexer.ll"
KEYWORD(110, 100, 0, 0, NOINLINE);
YY_BREAK
-case 197:
+case 195:
YY_RULE_SETUP
-#line 498 "glsl_lexer.ll"
+#line 486 "glsl_lexer.ll"
KEYWORD(110, 100, 0, 0, PUBLIC_TOK);
YY_BREAK
-case 198:
+case 196:
YY_RULE_SETUP
-#line 499 "glsl_lexer.ll"
+#line 487 "glsl_lexer.ll"
KEYWORD(110, 100, 0, 0, STATIC);
YY_BREAK
-case 199:
+case 197:
YY_RULE_SETUP
-#line 500 "glsl_lexer.ll"
+#line 488 "glsl_lexer.ll"
KEYWORD(110, 100, 0, 0, EXTERN);
YY_BREAK
-case 200:
+case 198:
YY_RULE_SETUP
-#line 501 "glsl_lexer.ll"
+#line 489 "glsl_lexer.ll"
KEYWORD(110, 100, 0, 0, EXTERNAL);
YY_BREAK
-case 201:
+case 199:
YY_RULE_SETUP
-#line 502 "glsl_lexer.ll"
+#line 490 "glsl_lexer.ll"
KEYWORD(110, 100, 0, 0, INTERFACE);
YY_BREAK
-case 202:
+case 200:
YY_RULE_SETUP
-#line 503 "glsl_lexer.ll"
+#line 491 "glsl_lexer.ll"
KEYWORD(110, 100, 0, 0, LONG_TOK);
YY_BREAK
-case 203:
+case 201:
YY_RULE_SETUP
-#line 504 "glsl_lexer.ll"
+#line 492 "glsl_lexer.ll"
KEYWORD(110, 100, 0, 0, SHORT_TOK);
YY_BREAK
-case 204:
+case 202:
YY_RULE_SETUP
-#line 505 "glsl_lexer.ll"
+#line 493 "glsl_lexer.ll"
KEYWORD(110, 100, 400, 0, DOUBLE_TOK);
YY_BREAK
-case 205:
+case 203:
YY_RULE_SETUP
-#line 506 "glsl_lexer.ll"
+#line 494 "glsl_lexer.ll"
KEYWORD(110, 100, 0, 0, HALF);
YY_BREAK
-case 206:
+case 204:
YY_RULE_SETUP
-#line 507 "glsl_lexer.ll"
+#line 495 "glsl_lexer.ll"
KEYWORD(110, 100, 0, 0, FIXED_TOK);
YY_BREAK
-case 207:
+case 205:
YY_RULE_SETUP
-#line 508 "glsl_lexer.ll"
+#line 496 "glsl_lexer.ll"
KEYWORD(110, 100, 0, 0, UNSIGNED);
YY_BREAK
-case 208:
+case 206:
YY_RULE_SETUP
-#line 509 "glsl_lexer.ll"
+#line 497 "glsl_lexer.ll"
KEYWORD(110, 100, 0, 0, INPUT_TOK);
YY_BREAK
-case 209:
+case 207:
YY_RULE_SETUP
-#line 510 "glsl_lexer.ll"
+#line 498 "glsl_lexer.ll"
KEYWORD(110, 100, 0, 0, OUTPUT);
YY_BREAK
-case 210:
+case 208:
YY_RULE_SETUP
-#line 511 "glsl_lexer.ll"
+#line 499 "glsl_lexer.ll"
KEYWORD(110, 100, 0, 0, HVEC2);
YY_BREAK
-case 211:
+case 209:
YY_RULE_SETUP
-#line 512 "glsl_lexer.ll"
+#line 500 "glsl_lexer.ll"
KEYWORD(110, 100, 0, 0, HVEC3);
YY_BREAK
-case 212:
+case 210:
YY_RULE_SETUP
-#line 513 "glsl_lexer.ll"
+#line 501 "glsl_lexer.ll"
KEYWORD(110, 100, 0, 0, HVEC4);
YY_BREAK
-case 213:
+case 211:
YY_RULE_SETUP
-#line 514 "glsl_lexer.ll"
+#line 502 "glsl_lexer.ll"
KEYWORD(110, 100, 400, 0, DVEC2);
YY_BREAK
-case 214:
+case 212:
YY_RULE_SETUP
-#line 515 "glsl_lexer.ll"
+#line 503 "glsl_lexer.ll"
KEYWORD(110, 100, 400, 0, DVEC3);
YY_BREAK
-case 215:
+case 213:
YY_RULE_SETUP
-#line 516 "glsl_lexer.ll"
+#line 504 "glsl_lexer.ll"
KEYWORD(110, 100, 400, 0, DVEC4);
YY_BREAK
-case 216:
+case 214:
YY_RULE_SETUP
-#line 517 "glsl_lexer.ll"
+#line 505 "glsl_lexer.ll"
KEYWORD(110, 100, 0, 0, FVEC2);
YY_BREAK
-case 217:
+case 215:
YY_RULE_SETUP
-#line 518 "glsl_lexer.ll"
+#line 506 "glsl_lexer.ll"
KEYWORD(110, 100, 0, 0, FVEC3);
YY_BREAK
-case 218:
+case 216:
YY_RULE_SETUP
-#line 519 "glsl_lexer.ll"
+#line 507 "glsl_lexer.ll"
KEYWORD(110, 100, 0, 0, FVEC4);
YY_BREAK
-case 219:
+case 217:
YY_RULE_SETUP
-#line 520 "glsl_lexer.ll"
+#line 508 "glsl_lexer.ll"
DEPRECATED_ES_KEYWORD(SAMPLER2DRECT);
YY_BREAK
-case 220:
+case 218:
YY_RULE_SETUP
-#line 521 "glsl_lexer.ll"
+#line 509 "glsl_lexer.ll"
KEYWORD(110, 100, 0, 0, SAMPLER3DRECT);
YY_BREAK
-case 221:
+case 219:
YY_RULE_SETUP
-#line 522 "glsl_lexer.ll"
+#line 510 "glsl_lexer.ll"
DEPRECATED_ES_KEYWORD(SAMPLER2DRECTSHADOW);
YY_BREAK
-case 222:
+case 220:
YY_RULE_SETUP
-#line 523 "glsl_lexer.ll"
+#line 511 "glsl_lexer.ll"
KEYWORD(110, 100, 0, 0, SIZEOF);
YY_BREAK
-case 223:
+case 221:
YY_RULE_SETUP
-#line 524 "glsl_lexer.ll"
+#line 512 "glsl_lexer.ll"
KEYWORD(110, 100, 0, 0, CAST);
YY_BREAK
-case 224:
+case 222:
YY_RULE_SETUP
-#line 525 "glsl_lexer.ll"
+#line 513 "glsl_lexer.ll"
KEYWORD(110, 100, 0, 0, NAMESPACE);
YY_BREAK
-case 225:
+case 223:
YY_RULE_SETUP
-#line 526 "glsl_lexer.ll"
+#line 514 "glsl_lexer.ll"
KEYWORD(110, 100, 0, 0, USING);
YY_BREAK
/* Additional reserved words in GLSL 1.20. */
-case 226:
+case 224:
YY_RULE_SETUP
-#line 529 "glsl_lexer.ll"
+#line 517 "glsl_lexer.ll"
KEYWORD(120, 100, 130, 100, LOWP);
YY_BREAK
-case 227:
+case 225:
YY_RULE_SETUP
-#line 530 "glsl_lexer.ll"
+#line 518 "glsl_lexer.ll"
KEYWORD(120, 100, 130, 100, MEDIUMP);
YY_BREAK
-case 228:
+case 226:
YY_RULE_SETUP
-#line 531 "glsl_lexer.ll"
+#line 519 "glsl_lexer.ll"
KEYWORD(120, 100, 130, 100, HIGHP);
YY_BREAK
-case 229:
+case 227:
YY_RULE_SETUP
-#line 532 "glsl_lexer.ll"
+#line 520 "glsl_lexer.ll"
KEYWORD(120, 100, 130, 100, PRECISION);
YY_BREAK
/* Additional reserved words in GLSL 1.30. */
-case 230:
+case 228:
YY_RULE_SETUP
-#line 535 "glsl_lexer.ll"
+#line 523 "glsl_lexer.ll"
KEYWORD(130, 300, 130, 300, CASE);
YY_BREAK
-case 231:
+case 229:
YY_RULE_SETUP
-#line 536 "glsl_lexer.ll"
+#line 524 "glsl_lexer.ll"
KEYWORD(130, 300, 0, 0, COMMON);
YY_BREAK
-case 232:
+case 230:
YY_RULE_SETUP
-#line 537 "glsl_lexer.ll"
+#line 525 "glsl_lexer.ll"
KEYWORD(130, 300, 0, 0, PARTITION);
YY_BREAK
-case 233:
+case 231:
YY_RULE_SETUP
-#line 538 "glsl_lexer.ll"
+#line 526 "glsl_lexer.ll"
KEYWORD(130, 300, 0, 0, ACTIVE);
YY_BREAK
-case 234:
+case 232:
YY_RULE_SETUP
-#line 539 "glsl_lexer.ll"
+#line 527 "glsl_lexer.ll"
KEYWORD(130, 100, 0, 0, SUPERP);
YY_BREAK
-case 235:
+case 233:
YY_RULE_SETUP
-#line 540 "glsl_lexer.ll"
+#line 528 "glsl_lexer.ll"
KEYWORD(130, 300, 140, 0, SAMPLERBUFFER);
YY_BREAK
-case 236:
+case 234:
YY_RULE_SETUP
-#line 541 "glsl_lexer.ll"
+#line 529 "glsl_lexer.ll"
KEYWORD(130, 300, 0, 0, FILTER);
YY_BREAK
-case 237:
+case 235:
YY_RULE_SETUP
-#line 542 "glsl_lexer.ll"
+#line 530 "glsl_lexer.ll"
KEYWORD_WITH_ALT(130, 0, 140, 0, yyextra->ARB_uniform_buffer_object_enable && !yyextra->es_shader, ROW_MAJOR);
YY_BREAK
/* Additional reserved words in GLSL 1.40 */
-case 238:
+case 236:
YY_RULE_SETUP
-#line 545 "glsl_lexer.ll"
+#line 533 "glsl_lexer.ll"
KEYWORD(140, 300, 140, 0, ISAMPLER2DRECT);
YY_BREAK
-case 239:
+case 237:
YY_RULE_SETUP
-#line 546 "glsl_lexer.ll"
+#line 534 "glsl_lexer.ll"
KEYWORD(140, 300, 140, 0, USAMPLER2DRECT);
YY_BREAK
-case 240:
+case 238:
YY_RULE_SETUP
-#line 547 "glsl_lexer.ll"
+#line 535 "glsl_lexer.ll"
KEYWORD(140, 300, 140, 0, ISAMPLERBUFFER);
YY_BREAK
-case 241:
+case 239:
YY_RULE_SETUP
-#line 548 "glsl_lexer.ll"
+#line 536 "glsl_lexer.ll"
KEYWORD(140, 300, 140, 0, USAMPLERBUFFER);
YY_BREAK
/* Additional reserved words in GLSL ES 3.00 */
-case 242:
+case 240:
YY_RULE_SETUP
-#line 551 "glsl_lexer.ll"
+#line 539 "glsl_lexer.ll"
KEYWORD(0, 300, 0, 0, RESOURCE);
YY_BREAK
-case 243:
+case 241:
YY_RULE_SETUP
-#line 552 "glsl_lexer.ll"
+#line 540 "glsl_lexer.ll"
KEYWORD(0, 300, 0, 0, PATCH);
YY_BREAK
-case 244:
+case 242:
YY_RULE_SETUP
-#line 553 "glsl_lexer.ll"
+#line 541 "glsl_lexer.ll"
KEYWORD_WITH_ALT(400, 300, 400, 0, yyextra->ARB_gpu_shader5_enable, SAMPLE);
YY_BREAK
-case 245:
+case 243:
YY_RULE_SETUP
-#line 554 "glsl_lexer.ll"
+#line 542 "glsl_lexer.ll"
KEYWORD(0, 300, 0, 0, SUBROUTINE);
YY_BREAK
-case 246:
+case 244:
YY_RULE_SETUP
-#line 557 "glsl_lexer.ll"
+#line 545 "glsl_lexer.ll"
{
struct _mesa_glsl_parse_state *state = yyextra;
void *ctx = state;
@@ -2928,17 +2910,17 @@ YY_RULE_SETUP
return classify_identifier(state, yytext);
}
YY_BREAK
-case 247:
+case 245:
YY_RULE_SETUP
-#line 564 "glsl_lexer.ll"
+#line 552 "glsl_lexer.ll"
{ return yytext[0]; }
YY_BREAK
-case 248:
+case 246:
YY_RULE_SETUP
-#line 566 "glsl_lexer.ll"
-YY_FATAL_ERROR( "flex scanner jammed" );
+#line 554 "glsl_lexer.ll"
+ECHO;
YY_BREAK
-#line 2942 "glsl_lexer.cpp"
+#line 2924 "glsl_lexer.cpp"
case YY_STATE_EOF(INITIAL):
case YY_STATE_EOF(PP):
case YY_STATE_EOF(PRAGMA):
@@ -3237,7 +3219,7 @@ static int yy_get_next_buffer (yyscan_t yyscanner)
while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
{
yy_current_state = (int) yy_def[yy_current_state];
- if ( yy_current_state >= 1009 )
+ if ( yy_current_state >= 1008 )
yy_c = yy_meta[(unsigned int) yy_c];
}
yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
@@ -3266,11 +3248,11 @@ static int yy_get_next_buffer (yyscan_t yyscanner)
while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
{
yy_current_state = (int) yy_def[yy_current_state];
- if ( yy_current_state >= 1009 )
+ if ( yy_current_state >= 1008 )
yy_c = yy_meta[(unsigned int) yy_c];
}
yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
- yy_is_jam = (yy_current_state == 1008);
+ yy_is_jam = (yy_current_state == 1007);
(void)yyg;
return yy_is_jam ? 0 : yy_current_state;
@@ -4083,7 +4065,7 @@ void _mesa_glsl_lexer_free (void * ptr , yyscan_t yyscanner)
#define YYTABLES_NAME "yytables"
-#line 566 "glsl_lexer.ll"
+#line 554 "glsl_lexer.ll"
diff --git a/dist/Mesa/src/glsl/glsl_lexer.ll b/dist/Mesa/src/glsl/glsl_lexer.ll
index ad6d32f9b..760235127 100644
--- a/dist/Mesa/src/glsl/glsl_lexer.ll
+++ b/dist/Mesa/src/glsl/glsl_lexer.ll
@@ -23,7 +23,7 @@
*/
#include <ctype.h>
#include <limits.h>
-#include "util/strtod.h"
+#include "strtod.h"
#include "ast.h"
#include "glsl_parser_extras.h"
#include "glsl_parser.h"
@@ -81,8 +81,7 @@ 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); \
+ yylval->identifier = strdup(yytext); \
return classify_identifier(yyextra, yytext); \
} \
} while (0)
@@ -153,11 +152,7 @@ literal_integer(char *text, int len, struct _mesa_glsl_parse_state *state,
%option never-interactive
%option prefix="_mesa_glsl_lexer_"
%option extra-type="struct _mesa_glsl_parse_state *"
-%option warn nodefault
- /* Note: When adding any start conditions to this list, you must also
- * update the "Internal compiler error" catch-all rule near the end of
- * this file. */
%x PP PRAGMA
DEC_INT [1-9][0-9]*
@@ -233,8 +228,7 @@ 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);
+ yylval->identifier = strdup(yytext);
return IDENTIFIER;
}
<PP>[1-9][0-9]* {
@@ -242,7 +236,6 @@ HASH ^{SPC}#{SPC}
return INTCONSTANT;
}
<PP>\n { BEGIN 0; yylineno++; yycolumn = 0; return EOL; }
-<PP>. { return yytext[0]; }
\n { yylineno++; yycolumn = 0; }
@@ -345,9 +338,6 @@ samplerExternalOES {
return IDENTIFIER;
}
- /* keywords available with ARB_gpu_shader5 */
-precise KEYWORD_WITH_ALT(400, 0, 400, 0, yyextra->ARB_gpu_shader5_enable, PRECISE);
-
/* keywords available with ARB_shader_image_load_store */
image1D KEYWORD_WITH_ALT(130, 300, 420, 0, yyextra->ARB_shader_image_load_store_enable, IMAGE1D);
image2D KEYWORD_WITH_ALT(130, 300, 420, 0, yyextra->ARB_shader_image_load_store_enable, IMAGE2D);
@@ -403,7 +393,6 @@ layout {
|| yyextra->AMD_conservative_depth_enable
|| yyextra->ARB_conservative_depth_enable
|| yyextra->ARB_explicit_attrib_location_enable
- || yyextra->ARB_explicit_uniform_location_enable
|| yyextra->has_separate_shader_objects()
|| yyextra->ARB_uniform_buffer_object_enable
|| yyextra->ARB_fragment_coord_conventions_enable
@@ -411,8 +400,7 @@ layout {
|| yyextra->ARB_compute_shader_enable) {
return LAYOUT_TOK;
} else {
- void *mem_ctx = yyextra;
- yylval->identifier = ralloc_strdup(mem_ctx, yytext);
+ yylval->identifier = strdup(yytext);
return classify_identifier(yyextra, yytext);
}
}
@@ -451,23 +439,23 @@ layout {
}
[0-9]+\.[0-9]+([eE][+-]?[0-9]+)?[fF]? {
- yylval->real = _mesa_strtof(yytext, NULL);
+ yylval->real = glsl_strtof(yytext, NULL);
return FLOATCONSTANT;
}
\.[0-9]+([eE][+-]?[0-9]+)?[fF]? {
- yylval->real = _mesa_strtof(yytext, NULL);
+ yylval->real = glsl_strtof(yytext, NULL);
return FLOATCONSTANT;
}
[0-9]+\.([eE][+-]?[0-9]+)?[fF]? {
- yylval->real = _mesa_strtof(yytext, NULL);
+ yylval->real = glsl_strtof(yytext, NULL);
return FLOATCONSTANT;
}
[0-9]+[eE][+-]?[0-9]+[fF]? {
- yylval->real = _mesa_strtof(yytext, NULL);
+ yylval->real = glsl_strtof(yytext, NULL);
return FLOATCONSTANT;
}
[0-9]+[fF] {
- yylval->real = _mesa_strtof(yytext, NULL);
+ yylval->real = glsl_strtof(yytext, NULL);
return FLOATCONSTANT;
}
diff --git a/dist/Mesa/src/glsl/glsl_parser.cpp b/dist/Mesa/src/glsl/glsl_parser.cpp
index 6addb7990..940c82c0e 100644
--- a/dist/Mesa/src/glsl/glsl_parser.cpp
+++ b/dist/Mesa/src/glsl/glsl_parser.cpp
@@ -95,9 +95,6 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-#ifndef _MSC_VER
-#include <strings.h>
-#endif
#include <assert.h>
#include "ast.h"
@@ -144,7 +141,7 @@ static bool match_layout_qualifier(const char *s1, const char *s2,
return strcasecmp(s1, s2);
}
-#line 148 "glsl_parser.cpp" /* yacc.c:339 */
+#line 145 "glsl_parser.cpp" /* yacc.c:339 */
# ifndef YY_NULLPTR
# if defined __cplusplus && 201103L <= __cplusplus
@@ -214,193 +211,193 @@ extern int _mesa_glsl_debug;
INOUT_TOK = 290,
UNIFORM = 291,
VARYING = 292,
- SAMPLE = 293,
- NOPERSPECTIVE = 294,
- FLAT = 295,
- SMOOTH = 296,
- MAT2X2 = 297,
- MAT2X3 = 298,
- MAT2X4 = 299,
- MAT3X2 = 300,
- MAT3X3 = 301,
- MAT3X4 = 302,
- MAT4X2 = 303,
- MAT4X3 = 304,
- MAT4X4 = 305,
- SAMPLER1D = 306,
- SAMPLER2D = 307,
- SAMPLER3D = 308,
- SAMPLERCUBE = 309,
- SAMPLER1DSHADOW = 310,
- SAMPLER2DSHADOW = 311,
- SAMPLERCUBESHADOW = 312,
- SAMPLER1DARRAY = 313,
- SAMPLER2DARRAY = 314,
- SAMPLER1DARRAYSHADOW = 315,
- SAMPLER2DARRAYSHADOW = 316,
- SAMPLERCUBEARRAY = 317,
- SAMPLERCUBEARRAYSHADOW = 318,
- ISAMPLER1D = 319,
- ISAMPLER2D = 320,
- ISAMPLER3D = 321,
- ISAMPLERCUBE = 322,
- ISAMPLER1DARRAY = 323,
- ISAMPLER2DARRAY = 324,
- ISAMPLERCUBEARRAY = 325,
- USAMPLER1D = 326,
- USAMPLER2D = 327,
- USAMPLER3D = 328,
- USAMPLERCUBE = 329,
- USAMPLER1DARRAY = 330,
- USAMPLER2DARRAY = 331,
- USAMPLERCUBEARRAY = 332,
- SAMPLER2DRECT = 333,
- ISAMPLER2DRECT = 334,
- USAMPLER2DRECT = 335,
- SAMPLER2DRECTSHADOW = 336,
- SAMPLERBUFFER = 337,
- ISAMPLERBUFFER = 338,
- USAMPLERBUFFER = 339,
- SAMPLER2DMS = 340,
- ISAMPLER2DMS = 341,
- USAMPLER2DMS = 342,
- SAMPLER2DMSARRAY = 343,
- ISAMPLER2DMSARRAY = 344,
- USAMPLER2DMSARRAY = 345,
- SAMPLEREXTERNALOES = 346,
- IMAGE1D = 347,
- IMAGE2D = 348,
- IMAGE3D = 349,
- IMAGE2DRECT = 350,
- IMAGECUBE = 351,
- IMAGEBUFFER = 352,
- IMAGE1DARRAY = 353,
- IMAGE2DARRAY = 354,
- IMAGECUBEARRAY = 355,
- IMAGE2DMS = 356,
- IMAGE2DMSARRAY = 357,
- IIMAGE1D = 358,
- IIMAGE2D = 359,
- IIMAGE3D = 360,
- IIMAGE2DRECT = 361,
- IIMAGECUBE = 362,
- IIMAGEBUFFER = 363,
- IIMAGE1DARRAY = 364,
- IIMAGE2DARRAY = 365,
- IIMAGECUBEARRAY = 366,
- IIMAGE2DMS = 367,
- IIMAGE2DMSARRAY = 368,
- UIMAGE1D = 369,
- UIMAGE2D = 370,
- UIMAGE3D = 371,
- UIMAGE2DRECT = 372,
- UIMAGECUBE = 373,
- UIMAGEBUFFER = 374,
- UIMAGE1DARRAY = 375,
- UIMAGE2DARRAY = 376,
- UIMAGECUBEARRAY = 377,
- UIMAGE2DMS = 378,
- UIMAGE2DMSARRAY = 379,
- IMAGE1DSHADOW = 380,
- IMAGE2DSHADOW = 381,
- IMAGE1DARRAYSHADOW = 382,
- IMAGE2DARRAYSHADOW = 383,
- COHERENT = 384,
- VOLATILE = 385,
- RESTRICT = 386,
- READONLY = 387,
- WRITEONLY = 388,
- ATOMIC_UINT = 389,
- STRUCT = 390,
- VOID_TOK = 391,
- WHILE = 392,
- IDENTIFIER = 393,
- TYPE_IDENTIFIER = 394,
- NEW_IDENTIFIER = 395,
- FLOATCONSTANT = 396,
- INTCONSTANT = 397,
- UINTCONSTANT = 398,
- BOOLCONSTANT = 399,
- FIELD_SELECTION = 400,
- LEFT_OP = 401,
- RIGHT_OP = 402,
- INC_OP = 403,
- DEC_OP = 404,
- LE_OP = 405,
- GE_OP = 406,
- EQ_OP = 407,
- NE_OP = 408,
- AND_OP = 409,
- OR_OP = 410,
- XOR_OP = 411,
- MUL_ASSIGN = 412,
- DIV_ASSIGN = 413,
- ADD_ASSIGN = 414,
- MOD_ASSIGN = 415,
- LEFT_ASSIGN = 416,
- RIGHT_ASSIGN = 417,
- AND_ASSIGN = 418,
- XOR_ASSIGN = 419,
- OR_ASSIGN = 420,
- SUB_ASSIGN = 421,
- INVARIANT = 422,
- PRECISE = 423,
- LOWP = 424,
- MEDIUMP = 425,
- HIGHP = 426,
- SUPERP = 427,
- PRECISION = 428,
- VERSION_TOK = 429,
- EXTENSION = 430,
- LINE = 431,
- COLON = 432,
- EOL = 433,
- INTERFACE = 434,
- OUTPUT = 435,
- PRAGMA_DEBUG_ON = 436,
- PRAGMA_DEBUG_OFF = 437,
- PRAGMA_OPTIMIZE_ON = 438,
- PRAGMA_OPTIMIZE_OFF = 439,
- PRAGMA_INVARIANT_ALL = 440,
- LAYOUT_TOK = 441,
- ASM = 442,
- CLASS = 443,
- UNION = 444,
- ENUM = 445,
- TYPEDEF = 446,
- TEMPLATE = 447,
- THIS = 448,
- PACKED_TOK = 449,
- GOTO = 450,
- INLINE_TOK = 451,
- NOINLINE = 452,
- PUBLIC_TOK = 453,
- STATIC = 454,
- EXTERN = 455,
- EXTERNAL = 456,
- LONG_TOK = 457,
- SHORT_TOK = 458,
- DOUBLE_TOK = 459,
- HALF = 460,
- FIXED_TOK = 461,
- UNSIGNED = 462,
- INPUT_TOK = 463,
- HVEC2 = 464,
- HVEC3 = 465,
- HVEC4 = 466,
- DVEC2 = 467,
- DVEC3 = 468,
- DVEC4 = 469,
- FVEC2 = 470,
- FVEC3 = 471,
- FVEC4 = 472,
- SAMPLER3DRECT = 473,
- SIZEOF = 474,
- CAST = 475,
- NAMESPACE = 476,
- USING = 477,
- RESOURCE = 478,
- PATCH = 479,
+ NOPERSPECTIVE = 293,
+ FLAT = 294,
+ SMOOTH = 295,
+ MAT2X2 = 296,
+ MAT2X3 = 297,
+ MAT2X4 = 298,
+ MAT3X2 = 299,
+ MAT3X3 = 300,
+ MAT3X4 = 301,
+ MAT4X2 = 302,
+ MAT4X3 = 303,
+ MAT4X4 = 304,
+ SAMPLER1D = 305,
+ SAMPLER2D = 306,
+ SAMPLER3D = 307,
+ SAMPLERCUBE = 308,
+ SAMPLER1DSHADOW = 309,
+ SAMPLER2DSHADOW = 310,
+ SAMPLERCUBESHADOW = 311,
+ SAMPLER1DARRAY = 312,
+ SAMPLER2DARRAY = 313,
+ SAMPLER1DARRAYSHADOW = 314,
+ SAMPLER2DARRAYSHADOW = 315,
+ SAMPLERCUBEARRAY = 316,
+ SAMPLERCUBEARRAYSHADOW = 317,
+ ISAMPLER1D = 318,
+ ISAMPLER2D = 319,
+ ISAMPLER3D = 320,
+ ISAMPLERCUBE = 321,
+ ISAMPLER1DARRAY = 322,
+ ISAMPLER2DARRAY = 323,
+ ISAMPLERCUBEARRAY = 324,
+ USAMPLER1D = 325,
+ USAMPLER2D = 326,
+ USAMPLER3D = 327,
+ USAMPLERCUBE = 328,
+ USAMPLER1DARRAY = 329,
+ USAMPLER2DARRAY = 330,
+ USAMPLERCUBEARRAY = 331,
+ SAMPLER2DRECT = 332,
+ ISAMPLER2DRECT = 333,
+ USAMPLER2DRECT = 334,
+ SAMPLER2DRECTSHADOW = 335,
+ SAMPLERBUFFER = 336,
+ ISAMPLERBUFFER = 337,
+ USAMPLERBUFFER = 338,
+ SAMPLER2DMS = 339,
+ ISAMPLER2DMS = 340,
+ USAMPLER2DMS = 341,
+ SAMPLER2DMSARRAY = 342,
+ ISAMPLER2DMSARRAY = 343,
+ USAMPLER2DMSARRAY = 344,
+ SAMPLEREXTERNALOES = 345,
+ IMAGE1D = 346,
+ IMAGE2D = 347,
+ IMAGE3D = 348,
+ IMAGE2DRECT = 349,
+ IMAGECUBE = 350,
+ IMAGEBUFFER = 351,
+ IMAGE1DARRAY = 352,
+ IMAGE2DARRAY = 353,
+ IMAGECUBEARRAY = 354,
+ IMAGE2DMS = 355,
+ IMAGE2DMSARRAY = 356,
+ IIMAGE1D = 357,
+ IIMAGE2D = 358,
+ IIMAGE3D = 359,
+ IIMAGE2DRECT = 360,
+ IIMAGECUBE = 361,
+ IIMAGEBUFFER = 362,
+ IIMAGE1DARRAY = 363,
+ IIMAGE2DARRAY = 364,
+ IIMAGECUBEARRAY = 365,
+ IIMAGE2DMS = 366,
+ IIMAGE2DMSARRAY = 367,
+ UIMAGE1D = 368,
+ UIMAGE2D = 369,
+ UIMAGE3D = 370,
+ UIMAGE2DRECT = 371,
+ UIMAGECUBE = 372,
+ UIMAGEBUFFER = 373,
+ UIMAGE1DARRAY = 374,
+ UIMAGE2DARRAY = 375,
+ UIMAGECUBEARRAY = 376,
+ UIMAGE2DMS = 377,
+ UIMAGE2DMSARRAY = 378,
+ IMAGE1DSHADOW = 379,
+ IMAGE2DSHADOW = 380,
+ IMAGE1DARRAYSHADOW = 381,
+ IMAGE2DARRAYSHADOW = 382,
+ COHERENT = 383,
+ VOLATILE = 384,
+ RESTRICT = 385,
+ READONLY = 386,
+ WRITEONLY = 387,
+ ATOMIC_UINT = 388,
+ STRUCT = 389,
+ VOID_TOK = 390,
+ WHILE = 391,
+ IDENTIFIER = 392,
+ TYPE_IDENTIFIER = 393,
+ NEW_IDENTIFIER = 394,
+ FLOATCONSTANT = 395,
+ INTCONSTANT = 396,
+ UINTCONSTANT = 397,
+ BOOLCONSTANT = 398,
+ FIELD_SELECTION = 399,
+ LEFT_OP = 400,
+ RIGHT_OP = 401,
+ INC_OP = 402,
+ DEC_OP = 403,
+ LE_OP = 404,
+ GE_OP = 405,
+ EQ_OP = 406,
+ NE_OP = 407,
+ AND_OP = 408,
+ OR_OP = 409,
+ XOR_OP = 410,
+ MUL_ASSIGN = 411,
+ DIV_ASSIGN = 412,
+ ADD_ASSIGN = 413,
+ MOD_ASSIGN = 414,
+ LEFT_ASSIGN = 415,
+ RIGHT_ASSIGN = 416,
+ AND_ASSIGN = 417,
+ XOR_ASSIGN = 418,
+ OR_ASSIGN = 419,
+ SUB_ASSIGN = 420,
+ INVARIANT = 421,
+ LOWP = 422,
+ MEDIUMP = 423,
+ HIGHP = 424,
+ SUPERP = 425,
+ PRECISION = 426,
+ VERSION_TOK = 427,
+ EXTENSION = 428,
+ LINE = 429,
+ COLON = 430,
+ EOL = 431,
+ INTERFACE = 432,
+ OUTPUT = 433,
+ PRAGMA_DEBUG_ON = 434,
+ PRAGMA_DEBUG_OFF = 435,
+ PRAGMA_OPTIMIZE_ON = 436,
+ PRAGMA_OPTIMIZE_OFF = 437,
+ PRAGMA_INVARIANT_ALL = 438,
+ LAYOUT_TOK = 439,
+ ASM = 440,
+ CLASS = 441,
+ UNION = 442,
+ ENUM = 443,
+ TYPEDEF = 444,
+ TEMPLATE = 445,
+ THIS = 446,
+ PACKED_TOK = 447,
+ GOTO = 448,
+ INLINE_TOK = 449,
+ NOINLINE = 450,
+ PUBLIC_TOK = 451,
+ STATIC = 452,
+ EXTERN = 453,
+ EXTERNAL = 454,
+ LONG_TOK = 455,
+ SHORT_TOK = 456,
+ DOUBLE_TOK = 457,
+ HALF = 458,
+ FIXED_TOK = 459,
+ UNSIGNED = 460,
+ INPUT_TOK = 461,
+ OUPTUT = 462,
+ HVEC2 = 463,
+ HVEC3 = 464,
+ HVEC4 = 465,
+ DVEC2 = 466,
+ DVEC3 = 467,
+ DVEC4 = 468,
+ FVEC2 = 469,
+ FVEC3 = 470,
+ FVEC4 = 471,
+ SAMPLER3DRECT = 472,
+ SIZEOF = 473,
+ CAST = 474,
+ NAMESPACE = 475,
+ USING = 476,
+ RESOURCE = 477,
+ PATCH = 478,
+ SAMPLE = 479,
SUBROUTINE = 480,
ERROR_TOK = 481,
COMMON = 482,
@@ -417,7 +414,7 @@ extern int _mesa_glsl_debug;
typedef union YYSTYPE YYSTYPE;
union YYSTYPE
{
-#line 94 "glsl_parser.yy" /* yacc.c:355 */
+#line 91 "glsl_parser.yy" /* yacc.c:355 */
int n;
float real;
@@ -454,7 +451,7 @@ union YYSTYPE
ast_node *else_statement;
} selection_rest_statement;
-#line 458 "glsl_parser.cpp" /* yacc.c:355 */
+#line 455 "glsl_parser.cpp" /* yacc.c:355 */
};
# define YYSTYPE_IS_TRIVIAL 1
# define YYSTYPE_IS_DECLARED 1
@@ -482,7 +479,7 @@ int _mesa_glsl_parse (struct _mesa_glsl_parse_state *state);
/* Copy the second part of user declarations. */
-#line 486 "glsl_parser.cpp" /* yacc.c:358 */
+#line 483 "glsl_parser.cpp" /* yacc.c:358 */
#ifdef short
# undef short
@@ -726,16 +723,16 @@ union yyalloc
/* YYFINAL -- State number of the termination state. */
#define YYFINAL 5
/* YYLAST -- Last index in YYTABLE. */
-#define YYLAST 5400
+#define YYLAST 5407
/* YYNTOKENS -- Number of terminals. */
#define YYNTOKENS 257
/* YYNNTS -- Number of nonterminals. */
#define YYNNTS 108
/* YYNRULES -- Number of rules. */
-#define YYNRULES 385
+#define YYNRULES 380
/* YYNSTATES -- Number of states. */
-#define YYNSTATES 539
+#define YYNSTATES 532
/* YYTRANSLATE[YYX] -- Symbol number corresponding to YYX as returned
by yylex, with out-of-bounds checking. */
@@ -804,45 +801,45 @@ static const yytype_uint16 yytranslate[] =
/* YYRLINE[YYN] -- Source line where rule number YYN was defined. */
static const yytype_uint16 yyrline[] =
{
- 0, 298, 298, 297, 309, 311, 318, 328, 329, 330,
- 331, 332, 345, 347, 351, 352, 353, 357, 366, 374,
- 382, 393, 394, 398, 405, 412, 419, 426, 433, 440,
- 441, 447, 451, 458, 464, 473, 477, 481, 482, 491,
- 492, 496, 497, 501, 507, 519, 523, 529, 537, 548,
- 549, 553, 554, 558, 564, 576, 588, 589, 595, 601,
- 611, 612, 613, 614, 618, 619, 625, 631, 640, 641,
- 647, 656, 657, 663, 672, 673, 679, 685, 691, 700,
- 701, 707, 716, 717, 726, 727, 736, 737, 746, 747,
- 756, 757, 766, 767, 776, 777, 786, 787, 796, 797,
- 798, 799, 800, 801, 802, 803, 804, 805, 806, 810,
- 814, 830, 834, 839, 843, 848, 855, 859, 860, 864,
- 869, 877, 891, 901, 915, 920, 934, 937, 945, 953,
- 965, 978, 983, 988, 997, 1001, 1002, 1012, 1022, 1032,
- 1046, 1053, 1063, 1073, 1083, 1093, 1105, 1120, 1127, 1138,
- 1145, 1146, 1156, 1157, 1161, 1346, 1485, 1511, 1516, 1524,
- 1529, 1534, 1543, 1548, 1553, 1554, 1555, 1556, 1557, 1575,
- 1583, 1595, 1619, 1636, 1652, 1672, 1686, 1691, 1699, 1704,
- 1709, 1714, 1719, 1738, 1743, 1748, 1753, 1759, 1764, 1772,
- 1778, 1784, 1798, 1813, 1814, 1822, 1828, 1834, 1843, 1844,
- 1845, 1846, 1847, 1848, 1849, 1850, 1851, 1852, 1853, 1854,
- 1855, 1856, 1857, 1858, 1859, 1860, 1861, 1862, 1863, 1864,
- 1865, 1866, 1867, 1868, 1869, 1870, 1871, 1872, 1873, 1874,
- 1875, 1876, 1877, 1878, 1879, 1880, 1881, 1882, 1883, 1884,
- 1885, 1886, 1887, 1888, 1889, 1890, 1891, 1892, 1893, 1894,
- 1895, 1896, 1897, 1898, 1899, 1900, 1901, 1902, 1903, 1904,
- 1905, 1906, 1907, 1908, 1909, 1910, 1911, 1912, 1913, 1914,
- 1915, 1916, 1917, 1918, 1919, 1920, 1921, 1922, 1923, 1924,
- 1925, 1926, 1927, 1928, 1929, 1930, 1931, 1932, 1933, 1934,
- 1935, 1936, 1937, 1938, 1939, 1940, 1941, 1942, 1943, 1947,
- 1952, 1957, 1965, 1972, 1981, 1986, 1994, 2013, 2018, 2026,
- 2032, 2041, 2042, 2046, 2053, 2060, 2067, 2073, 2074, 2078,
- 2079, 2080, 2081, 2082, 2083, 2087, 2094, 2093, 2107, 2108,
- 2112, 2118, 2127, 2137, 2149, 2155, 2164, 2173, 2178, 2186,
- 2190, 2208, 2216, 2221, 2229, 2234, 2242, 2250, 2258, 2266,
- 2274, 2282, 2290, 2297, 2304, 2314, 2315, 2319, 2321, 2327,
- 2332, 2341, 2347, 2353, 2359, 2365, 2374, 2375, 2376, 2377,
- 2381, 2395, 2399, 2422, 2527, 2532, 2537, 2546, 2550, 2556,
- 2565, 2570, 2578, 2602, 2610, 2618
+ 0, 295, 295, 294, 306, 308, 315, 325, 326, 327,
+ 328, 329, 342, 344, 348, 349, 350, 354, 363, 371,
+ 382, 383, 387, 394, 401, 408, 415, 422, 429, 430,
+ 436, 440, 447, 453, 462, 466, 470, 471, 480, 481,
+ 485, 486, 490, 496, 508, 512, 518, 526, 537, 538,
+ 542, 543, 547, 553, 565, 577, 578, 584, 590, 600,
+ 601, 602, 603, 607, 608, 614, 620, 629, 630, 636,
+ 645, 646, 652, 661, 662, 668, 674, 680, 689, 690,
+ 696, 705, 706, 715, 716, 725, 726, 735, 736, 745,
+ 746, 755, 756, 765, 766, 775, 776, 785, 786, 787,
+ 788, 789, 790, 791, 792, 793, 794, 795, 799, 803,
+ 819, 823, 828, 832, 837, 844, 848, 849, 853, 858,
+ 866, 880, 890, 904, 909, 923, 926, 934, 946, 959,
+ 964, 969, 978, 982, 983, 993, 1003, 1013, 1027, 1034,
+ 1044, 1054, 1064, 1074, 1089, 1096, 1107, 1114, 1115, 1125,
+ 1126, 1130, 1315, 1438, 1464, 1469, 1477, 1482, 1487, 1496,
+ 1501, 1502, 1503, 1504, 1505, 1523, 1536, 1564, 1587, 1602,
+ 1622, 1636, 1641, 1649, 1654, 1659, 1664, 1669, 1674, 1679,
+ 1684, 1689, 1695, 1700, 1708, 1714, 1720, 1734, 1749, 1750,
+ 1758, 1764, 1770, 1779, 1780, 1781, 1782, 1783, 1784, 1785,
+ 1786, 1787, 1788, 1789, 1790, 1791, 1792, 1793, 1794, 1795,
+ 1796, 1797, 1798, 1799, 1800, 1801, 1802, 1803, 1804, 1805,
+ 1806, 1807, 1808, 1809, 1810, 1811, 1812, 1813, 1814, 1815,
+ 1816, 1817, 1818, 1819, 1820, 1821, 1822, 1823, 1824, 1825,
+ 1826, 1827, 1828, 1829, 1830, 1831, 1832, 1833, 1834, 1835,
+ 1836, 1837, 1838, 1839, 1840, 1841, 1842, 1843, 1844, 1845,
+ 1846, 1847, 1848, 1849, 1850, 1851, 1852, 1853, 1854, 1855,
+ 1856, 1857, 1858, 1859, 1860, 1861, 1862, 1863, 1864, 1865,
+ 1866, 1867, 1868, 1869, 1870, 1871, 1872, 1873, 1874, 1875,
+ 1876, 1877, 1878, 1879, 1883, 1888, 1893, 1901, 1908, 1917,
+ 1922, 1930, 1949, 1954, 1962, 1968, 1977, 1978, 1982, 1989,
+ 1996, 2003, 2009, 2010, 2014, 2015, 2016, 2017, 2018, 2019,
+ 2023, 2030, 2029, 2043, 2044, 2048, 2054, 2063, 2073, 2085,
+ 2091, 2100, 2109, 2114, 2122, 2126, 2144, 2152, 2157, 2165,
+ 2170, 2178, 2186, 2194, 2202, 2210, 2218, 2226, 2233, 2240,
+ 2250, 2251, 2255, 2257, 2263, 2268, 2277, 2283, 2289, 2295,
+ 2301, 2310, 2311, 2312, 2313, 2317, 2331, 2335, 2346, 2443,
+ 2448, 2453, 2462, 2466, 2472, 2481, 2486, 2494, 2518, 2526,
+ 2534
};
#endif
@@ -856,9 +853,9 @@ static const char *const yytname[] =
"FOR", "IF", "DISCARD", "RETURN", "SWITCH", "CASE", "DEFAULT", "BVEC2",
"BVEC3", "BVEC4", "IVEC2", "IVEC3", "IVEC4", "UVEC2", "UVEC3", "UVEC4",
"VEC2", "VEC3", "VEC4", "CENTROID", "IN_TOK", "OUT_TOK", "INOUT_TOK",
- "UNIFORM", "VARYING", "SAMPLE", "NOPERSPECTIVE", "FLAT", "SMOOTH",
- "MAT2X2", "MAT2X3", "MAT2X4", "MAT3X2", "MAT3X3", "MAT3X4", "MAT4X2",
- "MAT4X3", "MAT4X4", "SAMPLER1D", "SAMPLER2D", "SAMPLER3D", "SAMPLERCUBE",
+ "UNIFORM", "VARYING", "NOPERSPECTIVE", "FLAT", "SMOOTH", "MAT2X2",
+ "MAT2X3", "MAT2X4", "MAT3X2", "MAT3X3", "MAT3X4", "MAT4X2", "MAT4X3",
+ "MAT4X4", "SAMPLER1D", "SAMPLER2D", "SAMPLER3D", "SAMPLERCUBE",
"SAMPLER1DSHADOW", "SAMPLER2DSHADOW", "SAMPLERCUBESHADOW",
"SAMPLER1DARRAY", "SAMPLER2DARRAY", "SAMPLER1DARRAYSHADOW",
"SAMPLER2DARRAYSHADOW", "SAMPLERCUBEARRAY", "SAMPLERCUBEARRAYSHADOW",
@@ -885,17 +882,17 @@ static const char *const yytname[] =
"INC_OP", "DEC_OP", "LE_OP", "GE_OP", "EQ_OP", "NE_OP", "AND_OP",
"OR_OP", "XOR_OP", "MUL_ASSIGN", "DIV_ASSIGN", "ADD_ASSIGN",
"MOD_ASSIGN", "LEFT_ASSIGN", "RIGHT_ASSIGN", "AND_ASSIGN", "XOR_ASSIGN",
- "OR_ASSIGN", "SUB_ASSIGN", "INVARIANT", "PRECISE", "LOWP", "MEDIUMP",
- "HIGHP", "SUPERP", "PRECISION", "VERSION_TOK", "EXTENSION", "LINE",
- "COLON", "EOL", "INTERFACE", "OUTPUT", "PRAGMA_DEBUG_ON",
- "PRAGMA_DEBUG_OFF", "PRAGMA_OPTIMIZE_ON", "PRAGMA_OPTIMIZE_OFF",
- "PRAGMA_INVARIANT_ALL", "LAYOUT_TOK", "ASM", "CLASS", "UNION", "ENUM",
- "TYPEDEF", "TEMPLATE", "THIS", "PACKED_TOK", "GOTO", "INLINE_TOK",
- "NOINLINE", "PUBLIC_TOK", "STATIC", "EXTERN", "EXTERNAL", "LONG_TOK",
- "SHORT_TOK", "DOUBLE_TOK", "HALF", "FIXED_TOK", "UNSIGNED", "INPUT_TOK",
- "HVEC2", "HVEC3", "HVEC4", "DVEC2", "DVEC3", "DVEC4", "FVEC2", "FVEC3",
- "FVEC4", "SAMPLER3DRECT", "SIZEOF", "CAST", "NAMESPACE", "USING",
- "RESOURCE", "PATCH", "SUBROUTINE", "ERROR_TOK", "COMMON", "PARTITION",
+ "OR_ASSIGN", "SUB_ASSIGN", "INVARIANT", "LOWP", "MEDIUMP", "HIGHP",
+ "SUPERP", "PRECISION", "VERSION_TOK", "EXTENSION", "LINE", "COLON",
+ "EOL", "INTERFACE", "OUTPUT", "PRAGMA_DEBUG_ON", "PRAGMA_DEBUG_OFF",
+ "PRAGMA_OPTIMIZE_ON", "PRAGMA_OPTIMIZE_OFF", "PRAGMA_INVARIANT_ALL",
+ "LAYOUT_TOK", "ASM", "CLASS", "UNION", "ENUM", "TYPEDEF", "TEMPLATE",
+ "THIS", "PACKED_TOK", "GOTO", "INLINE_TOK", "NOINLINE", "PUBLIC_TOK",
+ "STATIC", "EXTERN", "EXTERNAL", "LONG_TOK", "SHORT_TOK", "DOUBLE_TOK",
+ "HALF", "FIXED_TOK", "UNSIGNED", "INPUT_TOK", "OUPTUT", "HVEC2", "HVEC3",
+ "HVEC4", "DVEC2", "DVEC3", "DVEC4", "FVEC2", "FVEC3", "FVEC4",
+ "SAMPLER3DRECT", "SIZEOF", "CAST", "NAMESPACE", "USING", "RESOURCE",
+ "PATCH", "SAMPLE", "SUBROUTINE", "ERROR_TOK", "COMMON", "PARTITION",
"ACTIVE", "FILTER", "ROW_MAJOR", "THEN", "'('", "')'", "'['", "']'",
"'.'", "','", "'+'", "'-'", "'!'", "'~'", "'*'", "'/'", "'%'", "'<'",
"'>'", "'&'", "'^'", "'|'", "'?'", "':'", "'='", "';'", "'{'", "'}'",
@@ -976,12 +973,12 @@ static const yytype_uint16 yytoknum[] =
};
# endif
-#define YYPACT_NINF -405
+#define YYPACT_NINF -393
#define yypact_value_is_default(Yystate) \
- (!!((Yystate) == (-405)))
+ (!!((Yystate) == (-393)))
-#define YYTABLE_NINF -377
+#define YYTABLE_NINF -372
#define yytable_value_is_error(Yytable_value) \
0
@@ -990,60 +987,60 @@ static const yytype_uint16 yytoknum[] =
STATE-NUM. */
static const yytype_int16 yypact[] =
{
- -98, -37, 78, -405, -85, -405, -72, -405, -405, -405,
- -405, -70, 68, 4796, -405, -405, -59, -405, -405, -405,
- -405, -405, -405, -405, -405, -405, -405, -405, -405, -405,
- -405, -405, -405, -405, -405, -405, -17, 2, 14, -405,
- -405, -405, -405, -405, -405, -405, -405, -405, -405, -405,
- -405, -405, -405, -405, -405, -405, -405, -405, -405, -405,
- -405, -405, -405, -405, -405, -405, -405, -405, -405, -405,
- -405, -405, -405, -405, -405, -405, -405, -405, -405, -405,
- -405, -405, -405, -405, -405, -405, -405, -405, -405, -405,
- -405, -405, -405, -405, -405, -405, -405, -405, -405, -405,
- -405, -405, -405, -405, -405, -405, -405, -405, -405, -405,
- -405, -405, -405, -405, -405, -405, -405, -405, -405, -405,
- -405, -405, -405, -405, -405, -405, -405, -405, -405, -405,
- -405, -405, -405, -115, -405, -405, 264, 264, -405, -405,
- -405, 43, -47, -18, 26, 41, 52, -66, -405, 4612,
- -405, -144, -114, -63, 11, -191, -405, 77, 313, 5089,
- 5261, 5089, 5089, -405, -77, -405, 5089, -405, -405, -405,
- -405, -405, 49, -405, 68, 4967, -83, -405, -405, -405,
- -405, -405, 5089, 5089, -405, 5089, -405, -405, -405, 5261,
- -405, -405, -405, -405, -405, -80, -405, -405, -405, 524,
- -405, -405, 32, 32, -405, -405, -405, 32, -405, 5261,
- 32, 32, 68, -405, -12, 0, -203, 3, -124, -120,
- -119, -405, -405, -405, -405, -405, -405, 3585, 9, -405,
- -8, 73, 68, 1272, -405, 4967, -2, -405, -405, 4,
- -201, -405, -405, 8, 10, 1967, 21, 30, 12, 3144,
- 38, 39, -405, -405, -405, -405, -405, 3987, 3987, 3987,
- -405, -405, -405, -405, -405, 17, -405, 42, -405, -108,
- -405, -405, -405, 40, -90, 4188, 44, -76, 3987, -20,
- -42, 63, -54, 74, 35, 31, 34, 131, 130, -125,
- -405, -405, -138, -405, 37, 5109, 56, -405, -405, -405,
- -405, 778, -405, -405, -405, -405, -405, -405, -405, -405,
- -405, -405, 68, -405, -405, -192, 2921, -161, -405, -405,
- -405, -405, -405, -405, -405, 58, -405, 3786, 4967, -405,
- -77, -137, -405, -405, -405, 1493, -405, 86, -405, -80,
- -405, -405, 155, 2460, 3987, -405, -405, -126, 3987, 3384,
- -405, -405, -75, -405, 1967, -405, -405, 3987, 77, -405,
- -405, 3987, 61, -405, -405, -405, -405, -405, -405, -405,
- -405, -405, -405, -405, -405, -405, 3987, -405, 3987, 3987,
- 3987, 3987, 3987, 3987, 3987, 3987, 3987, 3987, 3987, 3987,
- 3987, 3987, 3987, 3987, 3987, 3987, 3987, 3987, 3987, -405,
- -405, -405, -77, 2921, -158, 2921, -405, -405, 2921, -405,
- -405, 70, 68, 51, 4967, 9, 68, -405, -405, -405,
- -405, -405, -405, 66, -405, -405, 3384, -69, -405, -64,
- 71, 68, 76, -405, 1032, 72, 71, -405, 79, -405,
- 80, -51, 4389, -405, -405, -405, -405, -405, -20, -20,
- -42, -42, 63, 63, 63, 63, -54, -54, 74, 35,
- 31, 34, 131, 130, -210, -405, 9, -405, 2921, -405,
- -147, -405, -405, -113, 173, -405, -405, 3987, -405, 65,
- 87, 1967, 69, 67, 2220, -405, -405, -405, -405, -405,
- 3987, 89, -405, 3987, -405, 2698, -405, -405, -77, 75,
- -39, 3987, 2220, 316, -405, -10, -405, 2921, -405, -405,
- -405, -405, -405, -405, -405, 9, -405, 83, 71, -405,
- 1967, 3987, 81, -405, -405, 1714, 1967, -6, -405, -405,
- -405, -139, -405, -405, -405, -405, -405, 1967, -405
+ -85, -88, 33, -393, -94, -393, -133, -393, -393, -393,
+ -393, -80, -75, 4754, -393, -393, -67, -393, -393, -393,
+ -393, -393, -393, -393, -393, -393, -393, -393, -393, -393,
+ -393, -393, -393, -393, -393, -393, 12, 19, 36, -393,
+ -393, -393, -393, -393, -393, -393, -393, -393, -393, -393,
+ -393, -393, -393, -393, -393, -393, -393, -393, -393, -393,
+ -393, -393, -393, -393, -393, -393, -393, -393, -393, -393,
+ -393, -393, -393, -393, -393, -393, -393, -393, -393, -393,
+ -393, -393, -393, -393, -393, -393, -393, -393, -393, -393,
+ -393, -393, -393, -393, -393, -393, -393, -393, -393, -393,
+ -393, -393, -393, -393, -393, -393, -393, -393, -393, -393,
+ -393, -393, -393, -393, -393, -393, -393, -393, -393, -393,
+ -393, -393, -393, -393, -393, -393, -393, -393, -393, -393,
+ -393, -393, -115, -393, -393, 261, -393, -393, -393, 41,
+ -64, -48, 24, 29, 37, -51, -393, -393, 4754, -393,
+ -132, -41, -23, 1, -147, -393, 86, 35, 5064, 5269,
+ 5064, 5064, -393, -6, -393, 5064, -393, -393, -393, -393,
+ -393, 88, -393, -75, 4943, -24, -393, -393, -393, -393,
+ -393, 5064, -393, 5064, -393, 5269, -393, -393, -393, -393,
+ -393, -83, -393, -393, 517, -393, -393, 17, 17, -393,
+ -393, -393, -393, 5269, 17, 17, -75, -393, 10, 27,
+ -204, 38, -125, -121, -113, -393, -393, -393, -393, -393,
+ -393, 3639, 15, -393, 2, 69, -75, 1265, -393, 4943,
+ 22, -393, -393, 13, -148, -393, -393, 23, 25, 1999,
+ 45, 50, 31, 3176, 53, 54, -393, -393, -393, -393,
+ -393, 4085, 4085, 4085, -393, -393, -393, -393, -393, 34,
+ -393, 56, -393, -101, -393, -393, -393, 57, -145, 4308,
+ 63, 181, 4085, -3, -96, 42, -108, 66, 55, 60,
+ 52, 151, 152, -126, -393, -393, -140, -393, 59, 5083,
+ 77, -393, -393, -393, -393, 771, -393, -393, -393, -393,
+ -393, -393, -393, -393, -393, -75, -393, -393, -187, 2953,
+ -175, -393, -393, -393, -393, -393, -393, -393, 75, -393,
+ 3862, 4943, -393, -6, -138, -393, -393, -393, 1502, -393,
+ 79, -393, -83, -393, -393, 176, 2492, 4085, -393, -393,
+ -127, 4085, 3416, -393, -393, -117, -393, 1999, -393, -393,
+ 4085, 86, -393, -393, 4085, 80, -393, -393, -393, -393,
+ -393, -393, -393, -393, -393, -393, -393, -393, -393, 4085,
+ -393, 4085, 4085, 4085, 4085, 4085, 4085, 4085, 4085, 4085,
+ 4085, 4085, 4085, 4085, 4085, 4085, 4085, 4085, 4085, 4085,
+ 4085, 4085, -393, -393, -393, -6, 2953, -159, 2953, -393,
+ -393, 2953, -393, -393, 81, -75, 62, 4943, 15, -75,
+ -393, -393, -393, -393, -393, -393, 83, -393, -393, 3416,
+ -89, -393, -58, 82, -75, 85, -393, 1025, 90, 82,
+ -393, 89, -393, 87, -40, 4531, -393, -393, -393, -393,
+ -393, -3, -3, -96, -96, 42, 42, 42, 42, -108,
+ -108, 66, 55, 60, 52, 151, 152, -173, -393, 15,
+ -393, 2953, -393, -161, -393, -393, -112, 185, -393, -393,
+ 4085, -393, 73, 94, 1999, 76, 95, 2252, -393, -393,
+ -393, -393, -393, 4085, 96, -393, 4085, -393, 2730, -393,
+ -393, -6, 93, -39, 4085, 2252, 321, -393, -10, -393,
+ 2953, -393, -393, -393, -393, -393, -393, -393, 15, -393,
+ 98, 82, -393, 1999, 4085, 97, -393, -393, 1746, 1999,
+ -8, -393, -393, -393, -139, -393, -393, -393, -393, -393,
+ 1999, -393
};
/* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM.
@@ -1052,91 +1049,91 @@ static const yytype_int16 yypact[] =
static const yytype_uint16 yydefact[] =
{
4, 0, 0, 12, 0, 1, 2, 14, 15, 16,
- 5, 0, 0, 0, 13, 6, 0, 179, 178, 202,
- 199, 200, 201, 206, 207, 208, 209, 210, 211, 212,
- 213, 214, 203, 204, 205, 176, 181, 182, 183, 180,
- 177, 161, 160, 159, 215, 216, 217, 218, 219, 220,
- 221, 222, 223, 224, 225, 227, 228, 230, 231, 233,
- 234, 235, 236, 237, 239, 240, 241, 242, 244, 245,
- 246, 247, 249, 250, 251, 253, 254, 255, 256, 258,
- 226, 243, 252, 232, 238, 248, 257, 259, 260, 261,
- 262, 263, 264, 229, 265, 266, 267, 268, 269, 270,
- 271, 272, 273, 274, 275, 276, 277, 278, 279, 280,
- 281, 282, 283, 284, 285, 286, 287, 288, 289, 290,
- 291, 292, 293, 294, 295, 296, 297, 184, 185, 186,
- 187, 188, 298, 0, 198, 197, 162, 163, 301, 300,
- 299, 0, 0, 0, 0, 0, 0, 0, 368, 3,
- 367, 0, 0, 118, 126, 0, 135, 140, 167, 166,
- 0, 164, 165, 147, 193, 195, 168, 196, 18, 366,
- 115, 371, 0, 369, 0, 0, 0, 181, 182, 183,
- 21, 22, 162, 163, 145, 167, 170, 146, 169, 0,
- 7, 8, 9, 10, 11, 0, 20, 19, 112, 0,
- 370, 116, 126, 126, 131, 132, 133, 126, 119, 0,
- 126, 126, 0, 113, 14, 16, 141, 0, 181, 182,
- 183, 172, 372, 171, 148, 173, 174, 0, 194, 175,
- 0, 0, 0, 0, 304, 0, 0, 158, 157, 154,
- 0, 150, 156, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 26, 24, 25, 27, 48, 0, 0, 0,
- 60, 61, 62, 63, 334, 326, 330, 23, 29, 56,
- 31, 36, 37, 0, 0, 42, 0, 64, 0, 68,
- 71, 74, 79, 82, 84, 86, 88, 90, 92, 94,
- 96, 109, 0, 316, 0, 167, 147, 319, 332, 318,
- 317, 0, 320, 321, 322, 323, 324, 120, 127, 128,
- 124, 125, 134, 129, 130, 136, 0, 142, 121, 384,
- 385, 383, 189, 64, 111, 0, 46, 0, 0, 17,
- 309, 0, 307, 303, 305, 0, 114, 0, 149, 0,
- 362, 361, 0, 0, 0, 365, 363, 0, 0, 0,
- 57, 58, 0, 325, 0, 33, 34, 0, 0, 40,
- 39, 0, 198, 43, 45, 99, 100, 102, 101, 104,
- 105, 106, 107, 108, 103, 98, 0, 59, 0, 0,
+ 5, 0, 0, 0, 13, 6, 0, 174, 173, 197,
+ 194, 195, 196, 201, 202, 203, 204, 205, 206, 207,
+ 208, 209, 198, 199, 200, 171, 176, 177, 178, 175,
+ 158, 157, 156, 210, 211, 212, 213, 214, 215, 216,
+ 217, 218, 219, 220, 222, 223, 225, 226, 228, 229,
+ 230, 231, 232, 234, 235, 236, 237, 239, 240, 241,
+ 242, 244, 245, 246, 248, 249, 250, 251, 253, 221,
+ 238, 247, 227, 233, 243, 252, 254, 255, 256, 257,
+ 258, 259, 224, 260, 261, 262, 263, 264, 265, 266,
+ 267, 268, 269, 270, 271, 272, 273, 274, 275, 276,
+ 277, 278, 279, 280, 281, 282, 283, 284, 285, 286,
+ 287, 288, 289, 290, 291, 292, 179, 180, 181, 182,
+ 183, 293, 0, 193, 192, 159, 296, 295, 294, 0,
+ 0, 0, 0, 0, 0, 0, 172, 363, 3, 362,
+ 0, 0, 117, 125, 0, 133, 138, 163, 162, 0,
+ 160, 161, 144, 188, 190, 164, 191, 18, 361, 114,
+ 366, 0, 364, 0, 0, 0, 176, 177, 178, 20,
+ 21, 159, 143, 163, 165, 0, 7, 8, 9, 10,
+ 11, 0, 19, 111, 0, 365, 115, 125, 125, 129,
+ 130, 131, 118, 0, 125, 125, 0, 112, 14, 16,
+ 139, 0, 176, 177, 178, 167, 367, 166, 145, 168,
+ 169, 0, 189, 170, 0, 0, 0, 0, 299, 0,
+ 0, 155, 154, 151, 0, 147, 153, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 25, 23, 24, 26,
+ 47, 0, 0, 0, 59, 60, 61, 62, 329, 321,
+ 325, 22, 28, 55, 30, 35, 36, 0, 0, 41,
+ 0, 63, 0, 67, 70, 73, 78, 81, 83, 85,
+ 87, 89, 91, 93, 95, 108, 0, 311, 0, 163,
+ 144, 314, 327, 313, 312, 0, 315, 316, 317, 318,
+ 319, 119, 126, 123, 124, 132, 127, 128, 134, 0,
+ 140, 120, 379, 380, 378, 184, 63, 110, 0, 45,
+ 0, 0, 17, 304, 0, 302, 298, 300, 0, 113,
+ 0, 146, 0, 357, 356, 0, 0, 0, 360, 358,
+ 0, 0, 0, 56, 57, 0, 320, 0, 32, 33,
+ 0, 0, 39, 38, 0, 193, 42, 44, 98, 99,
+ 101, 100, 103, 104, 105, 106, 107, 102, 97, 0,
+ 58, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 335,
- 331, 333, 122, 0, 137, 0, 311, 144, 0, 190,
- 191, 0, 0, 0, 380, 310, 0, 306, 302, 152,
- 153, 155, 151, 0, 356, 355, 358, 0, 364, 0,
- 339, 0, 0, 28, 0, 0, 35, 32, 0, 38,
- 0, 0, 52, 44, 97, 65, 66, 67, 69, 70,
- 72, 73, 77, 78, 75, 76, 80, 81, 83, 85,
- 87, 89, 91, 93, 0, 110, 123, 139, 0, 314,
- 0, 143, 192, 0, 377, 381, 308, 0, 357, 0,
- 0, 0, 0, 0, 0, 327, 30, 55, 50, 49,
- 0, 198, 53, 0, 138, 0, 312, 382, 378, 0,
- 0, 359, 0, 338, 336, 0, 341, 0, 329, 352,
- 328, 54, 95, 313, 315, 379, 373, 0, 360, 354,
- 0, 0, 0, 342, 346, 0, 350, 0, 340, 353,
- 337, 0, 345, 348, 347, 349, 343, 351, 344
+ 0, 0, 330, 326, 328, 121, 0, 135, 0, 306,
+ 142, 0, 185, 186, 0, 0, 0, 375, 305, 0,
+ 301, 297, 149, 150, 152, 148, 0, 351, 350, 353,
+ 0, 359, 0, 334, 0, 0, 27, 0, 0, 34,
+ 31, 0, 37, 0, 0, 51, 43, 96, 64, 65,
+ 66, 68, 69, 71, 72, 76, 77, 74, 75, 79,
+ 80, 82, 84, 86, 88, 90, 92, 0, 109, 122,
+ 137, 0, 309, 0, 141, 187, 0, 372, 376, 303,
+ 0, 352, 0, 0, 0, 0, 0, 0, 322, 29,
+ 54, 49, 48, 0, 193, 52, 0, 136, 0, 307,
+ 377, 373, 0, 0, 354, 0, 333, 331, 0, 336,
+ 0, 324, 347, 323, 53, 94, 308, 310, 374, 368,
+ 0, 355, 349, 0, 0, 0, 337, 341, 0, 345,
+ 0, 335, 348, 332, 0, 340, 343, 342, 344, 338,
+ 346, 339
};
/* YYPGOTO[NTERM-NUM]. */
static const yytype_int16 yypgoto[] =
{
- -405, -405, -405, -405, -405, -405, -1, 176, -405, -118,
- -405, -405, -405, -405, -405, -405, -405, -405, -405, -405,
- -405, -405, -405, -405, -9, -405, -143, -142, -317, -129,
- -52, -50, -53, -46, -40, -38, -405, -205, -237, -405,
- -242, 29, -3, 1, -405, -405, -405, -405, 142, -58,
- -405, -405, -405, -405, -171, -11, -405, -405, 20, -405,
- -405, -110, -405, -405, -211, -13, -405, -405, 124, -405,
- 125, -198, -49, -55, -374, -405, 19, -244, -404, -405,
- -405, -136, 213, 13, 22, -405, -405, -36, -405, -405,
- -157, -405, -135, -405, -405, -405, -405, -405, -405, 239,
- -405, -405, -152, -405, -405, -25, -405, -405
+ -393, -393, -393, -393, -393, -393, 0, -393, -393, -119,
+ -393, -393, -393, -393, -393, -393, -393, -393, -393, -393,
+ -393, -393, -393, -393, -14, -393, -141, -124, -111, -110,
+ -49, -35, -33, -32, -34, -12, -393, -196, -239, -393,
+ -240, 61, 6, 7, -393, -393, -393, -393, 159, -27,
+ -393, -393, -393, -393, -168, -11, -393, -393, 44, -393,
+ -393, -77, -393, -393, -203, -13, -393, -393, 58, -393,
+ 149, -210, -26, -29, -369, -393, 46, -238, -392, -393,
+ -393, -109, 233, 40, 48, -393, -393, -31, -393, -393,
+ -123, -393, -135, -393, -393, -393, -393, -393, -393, 248,
+ -393, -393, -142, -393, -393, -5, -393, -393
};
/* YYDEFGOTO[NTERM-NUM]. */
static const yytype_int16 yydefgoto[] =
{
- -1, 2, 13, 3, 148, 6, 330, 14, 149, 267,
- 268, 269, 435, 270, 271, 272, 273, 274, 275, 276,
- 439, 440, 441, 442, 277, 278, 279, 280, 281, 282,
- 283, 284, 285, 286, 287, 288, 289, 290, 291, 376,
- 292, 325, 293, 294, 152, 153, 154, 310, 208, 209,
- 210, 311, 155, 156, 157, 185, 240, 421, 241, 242,
- 159, 160, 161, 162, 228, 326, 164, 165, 166, 167,
- 233, 234, 331, 332, 407, 470, 297, 298, 299, 300,
- 354, 509, 510, 301, 302, 303, 504, 432, 304, 506,
- 524, 525, 526, 527, 305, 426, 479, 480, 306, 168,
- 169, 170, 171, 172, 499, 413, 414, 173
+ -1, 2, 13, 3, 147, 6, 323, 14, 148, 261,
+ 262, 263, 428, 264, 265, 266, 267, 268, 269, 270,
+ 432, 433, 434, 435, 271, 272, 273, 274, 275, 276,
+ 277, 278, 279, 280, 281, 282, 283, 284, 285, 369,
+ 286, 318, 287, 288, 151, 152, 153, 303, 202, 203,
+ 204, 304, 154, 155, 156, 183, 234, 414, 235, 236,
+ 158, 159, 160, 161, 222, 319, 163, 164, 165, 166,
+ 227, 228, 324, 325, 400, 463, 291, 292, 293, 294,
+ 347, 502, 503, 295, 296, 297, 497, 425, 298, 499,
+ 517, 518, 519, 520, 299, 419, 472, 473, 300, 167,
+ 168, 169, 170, 171, 492, 406, 407, 172
};
/* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If
@@ -1144,111 +1141,233 @@ static const yytype_int16 yydefgoto[] =
number is the opposite. If YYTABLE_NINF, syntax error. */
static const yytype_int16 yytable[] =
{
- 163, 342, 158, 11, 232, 317, 222, 347, 521, 522,
- 150, 16, 521, 522, 151, 203, -374, 352, 184, 187,
- -375, -376, 324, 7, 8, 9, 186, 188, 398, 467,
- 396, 469, 227, 338, 471, 334, 203, 339, 363, 217,
- 355, 356, 493, 227, 204, 205, 206, 212, 221, 223,
- 316, 225, 226, 7, 8, 9, 229, 401, 7, 8,
- 9, 403, 232, 213, 232, 204, 205, 206, 452, 453,
- 454, 455, 186, 188, 327, 221, 1, 327, 5, 406,
- 508, 365, 366, 367, 368, 369, 370, 371, 372, 373,
- 374, 495, 408, 10, 494, 468, 385, 386, 508, 398,
- 398, 416, 427, 12, 404, 4, 429, 430, 15, 496,
- 198, 199, 398, 538, 237, 436, 399, 417, 174, 415,
- 201, 514, 324, -374, 443, 416, 397, 357, 428, 358,
- 319, 190, 176, 528, 320, 321, 163, 334, 158, 444,
- 175, 497, -375, 222, 360, 308, 150, 224, 361, 309,
- 151, 238, 313, 314, -376, 464, 216, 412, 227, 433,
- 191, 465, 163, 398, 232, 481, 406, 195, 406, 398,
- 482, 406, 235, 231, 398, 202, 236, 375, 431, 207,
- 138, 139, 140, 489, 430, 221, 296, 490, 295, 230,
- 401, 466, 387, 388, 239, 517, 312, 381, 382, 398,
- 207, 138, 139, 140, 192, 492, 7, 8, 9, 383,
- 384, 315, 138, 139, 140, 214, 8, 215, 323, 193,
- 163, -21, 163, 378, 379, 380, 389, 390, 419, 420,
- 194, 406, 296, -22, 295, 500, 318, 503, 448, 449,
- 438, 450, 451, 412, 327, -117, 523, 328, 350, 351,
- 536, 329, 336, 511, 343, 431, 512, 337, 406, 518,
- 456, 457, 340, 344, 341, 189, 345, 17, 18, 377,
- 406, 348, 349, 353, 359, -47, 530, 364, 211, 531,
- 392, 533, 535, 391, 393, 394, 395, 515, 296, -46,
- 295, 198, 423, 535, 409, -41, 35, 177, 178, 477,
- 179, 39, 40, 41, 42, 43, 472, 474, 486, 398,
- 484, 402, 487, 498, 488, 163, 17, 18, 323, 501,
- 507, 502, 163, -51, 505, 196, 211, 211, 520, 516,
- 296, 211, 295, 532, 211, 211, 296, 529, 239, 458,
- 460, 296, 459, 295, 307, 35, 218, 219, 461, 220,
- 39, 40, 41, 42, 43, 462, 411, 437, 463, 422,
- 335, 476, 424, 473, 200, 425, 519, 434, 534, 445,
- 446, 447, 323, 323, 323, 323, 323, 323, 323, 323,
- 323, 323, 323, 323, 323, 323, 323, 323, 197, 475,
- 478, 0, 537, 127, 128, 129, 130, 131, 0, 0,
- 0, 163, 180, 0, 181, 0, 0, 0, 0, 0,
- 0, 0, 0, 296, 0, 0, 0, 0, 0, 0,
- 0, 296, 0, 295, 0, 0, 0, 0, 0, 0,
- 483, 182, 183, 138, 139, 140, 0, 0, 0, 0,
- 0, 0, 127, 128, 129, 130, 131, 0, 0, 0,
- 147, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 296, 0,
- 295, 296, 0, 295, 0, 0, 0, 0, 0, 0,
- 182, 183, 138, 139, 140, 0, 0, 0, 0, 296,
- 0, 295, 0, 0, 0, 0, 0, 0, 0, 147,
- 0, 0, 0, 0, 0, 0, 0, 296, 0, 295,
- 0, 0, 296, 296, 295, 295, 0, 0, 0, 0,
- 0, 0, 0, 0, 296, 0, 295, 17, 18, 19,
- 20, 21, 22, 243, 244, 245, 0, 246, 247, 248,
- 249, 250, 0, 0, 23, 24, 25, 26, 27, 28,
- 29, 30, 31, 32, 33, 34, 35, 36, 37, 0,
- 38, 39, 40, 41, 42, 43, 44, 45, 46, 47,
- 48, 49, 50, 51, 52, 53, 54, 55, 56, 57,
- 58, 59, 60, 61, 62, 63, 64, 65, 66, 67,
- 68, 69, 70, 71, 72, 73, 74, 75, 76, 77,
- 78, 79, 80, 81, 82, 83, 84, 85, 86, 87,
- 88, 89, 90, 91, 92, 93, 94, 95, 96, 97,
- 98, 99, 100, 101, 102, 103, 104, 105, 106, 107,
- 108, 109, 110, 111, 112, 113, 114, 115, 116, 117,
- 118, 119, 120, 121, 122, 123, 124, 125, 126, 0,
- 0, 0, 0, 127, 128, 129, 130, 131, 132, 133,
- 134, 251, 180, 135, 181, 252, 253, 254, 255, 256,
- 0, 0, 257, 258, 0, 0, 0, 0, 0, 0,
+ 162, 335, 157, 340, 11, 198, 226, 310, 514, 515,
+ 514, 515, 16, 345, -369, 216, 182, 327, -370, 149,
+ 150, 198, 7, 8, 9, 317, -371, 460, 389, 462,
+ 356, 221, 464, 5, 199, 200, 201, 211, 17, 18,
+ 12, 378, 379, 7, 8, 9, 348, 349, 221, 309,
+ 199, 200, 201, 4, 7, 8, 9, 394, 184, 226,
+ 320, 226, 7, 8, 9, 391, 396, 35, 212, 213,
+ 399, 214, 39, 40, 41, 42, 320, 488, 401, 486,
+ 215, 217, 10, 219, 220, 501, 331, 1, 223, 353,
+ 332, 206, 487, 354, 461, 489, 15, 420, 391, 391,
+ 409, 422, 423, 501, 184, 397, 215, 207, 173, 231,
+ 429, 391, 186, 531, 392, 436, 410, 426, 327, 507,
+ 408, 391, 193, 194, 317, 390, 409, 421, 187, 312,
+ 437, 521, 175, 313, 350, 162, 351, 157, 380, 381,
+ 174, 314, 490, 374, 375, 474, 218, 216, 232, 391,
+ 457, -369, 458, 405, 149, 150, 210, 399, -370, 399,
+ 226, 162, 399, 126, 127, 128, 129, 130, 136, 137,
+ 138, 302, 230, 225, 424, -371, 475, 306, 307, 423,
+ 391, 290, 191, 289, 136, 137, 138, 376, 377, 394,
+ 305, 233, 459, 196, 482, 510, 485, 185, 483, 391,
+ 188, 181, 136, 137, 138, 189, 308, 316, 136, 137,
+ 138, 205, 215, 190, 162, 197, 162, 382, 383, 145,
+ 412, 413, 399, 208, 8, 209, 290, 224, 289, 221,
+ 493, 229, 431, 441, 442, -116, 496, 343, 344, 405,
+ 371, 372, 373, -20, 504, 322, 516, 505, 529, 399,
+ 320, 424, 443, 444, 511, 205, 205, 321, 370, 146,
+ -21, 399, 205, 205, 17, 18, 330, 445, 446, 447,
+ 448, 311, 449, 450, 524, 523, 329, 333, 336, 334,
+ 526, 528, 290, 337, 289, 338, 341, 342, 508, -46,
+ 346, 352, 528, 35, 176, 177, 357, 178, 39, 40,
+ 41, 42, 386, 384, 387, 395, 316, 388, 162, 385,
+ -45, 402, 416, 193, -40, 162, 470, 465, 467, 477,
+ 391, 481, 480, 290, 491, 289, 479, 494, 495, 290,
+ -50, 498, 233, 513, 290, 451, 289, 358, 359, 360,
+ 361, 362, 363, 364, 365, 366, 367, 509, 500, 525,
+ 452, 430, 522, 453, 455, 454, 301, 438, 439, 440,
+ 316, 316, 316, 316, 316, 316, 316, 316, 316, 316,
+ 316, 316, 316, 316, 316, 316, 415, 456, 328, 466,
+ 469, 404, 417, 195, 418, 530, 512, 427, 471, 126,
+ 127, 128, 129, 130, 162, 527, 192, 0, 179, 0,
+ 180, 0, 468, 0, 0, 0, 290, 0, 0, 0,
+ 0, 0, 0, 0, 290, 0, 289, 0, 0, 0,
+ 0, 0, 0, 0, 476, 0, 0, 181, 136, 137,
+ 138, 0, 0, 0, 368, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 145, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 136, 137, 138, 139, 140, 0, 141, 0, 0,
+ 0, 290, 0, 289, 290, 0, 289, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 147, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 290, 0, 289, 146, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 290, 0, 289, 0, 0, 290, 290, 289, 289, 0,
+ 0, 0, 0, 0, 0, 0, 0, 290, 0, 289,
+ 17, 18, 19, 20, 21, 22, 237, 238, 239, 0,
+ 240, 241, 242, 243, 244, 0, 0, 23, 24, 25,
+ 26, 27, 28, 29, 30, 31, 32, 33, 34, 35,
+ 36, 37, 0, 38, 39, 40, 41, 42, 43, 44,
+ 45, 46, 47, 48, 49, 50, 51, 52, 53, 54,
+ 55, 56, 57, 58, 59, 60, 61, 62, 63, 64,
+ 65, 66, 67, 68, 69, 70, 71, 72, 73, 74,
+ 75, 76, 77, 78, 79, 80, 81, 82, 83, 84,
+ 85, 86, 87, 88, 89, 90, 91, 92, 93, 94,
+ 95, 96, 97, 98, 99, 100, 101, 102, 103, 104,
+ 105, 106, 107, 108, 109, 110, 111, 112, 113, 114,
+ 115, 116, 117, 118, 119, 120, 121, 122, 123, 124,
+ 125, 0, 0, 0, 0, 126, 127, 128, 129, 130,
+ 131, 132, 133, 245, 179, 134, 180, 246, 247, 248,
+ 249, 250, 0, 0, 251, 252, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 135, 136, 137, 138, 0, 139, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 259, 0, 0,
- 0, 0, 0, 260, 261, 262, 263, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 264, 265,
- 266, 17, 18, 19, 20, 21, 22, 243, 244, 245,
- 0, 246, 247, 248, 249, 250, 0, 0, 23, 24,
- 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
- 35, 36, 37, 0, 38, 39, 40, 41, 42, 43,
- 44, 45, 46, 47, 48, 49, 50, 51, 52, 53,
- 54, 55, 56, 57, 58, 59, 60, 61, 62, 63,
- 64, 65, 66, 67, 68, 69, 70, 71, 72, 73,
- 74, 75, 76, 77, 78, 79, 80, 81, 82, 83,
- 84, 85, 86, 87, 88, 89, 90, 91, 92, 93,
- 94, 95, 96, 97, 98, 99, 100, 101, 102, 103,
- 104, 105, 106, 107, 108, 109, 110, 111, 112, 113,
- 114, 115, 116, 117, 118, 119, 120, 121, 122, 123,
- 124, 125, 126, 0, 0, 0, 0, 127, 128, 129,
- 130, 131, 132, 133, 134, 251, 180, 135, 181, 252,
- 253, 254, 255, 256, 0, 0, 257, 258, 0, 0,
+ 0, 145, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 146, 0, 0, 0, 0, 0, 0, 0, 0,
+ 253, 0, 0, 0, 0, 0, 254, 255, 256, 257,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 258, 259, 260, 17, 18, 19, 20, 21, 22,
+ 237, 238, 239, 0, 240, 241, 242, 243, 244, 0,
+ 0, 23, 24, 25, 26, 27, 28, 29, 30, 31,
+ 32, 33, 34, 35, 36, 37, 0, 38, 39, 40,
+ 41, 42, 43, 44, 45, 46, 47, 48, 49, 50,
+ 51, 52, 53, 54, 55, 56, 57, 58, 59, 60,
+ 61, 62, 63, 64, 65, 66, 67, 68, 69, 70,
+ 71, 72, 73, 74, 75, 76, 77, 78, 79, 80,
+ 81, 82, 83, 84, 85, 86, 87, 88, 89, 90,
+ 91, 92, 93, 94, 95, 96, 97, 98, 99, 100,
+ 101, 102, 103, 104, 105, 106, 107, 108, 109, 110,
+ 111, 112, 113, 114, 115, 116, 117, 118, 119, 120,
+ 121, 122, 123, 124, 125, 0, 0, 0, 0, 126,
+ 127, 128, 129, 130, 131, 132, 133, 245, 179, 134,
+ 180, 246, 247, 248, 249, 250, 0, 0, 251, 252,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 135, 136, 137,
+ 138, 0, 139, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 145, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 146, 0, 0, 0, 0,
+ 0, 0, 0, 0, 253, 0, 0, 0, 0, 0,
+ 254, 255, 256, 257, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 258, 259, 393, 17, 18,
+ 19, 20, 21, 22, 237, 238, 239, 0, 240, 241,
+ 242, 243, 244, 0, 0, 23, 24, 25, 26, 27,
+ 28, 29, 30, 31, 32, 33, 34, 35, 36, 37,
+ 0, 38, 39, 40, 41, 42, 43, 44, 45, 46,
+ 47, 48, 49, 50, 51, 52, 53, 54, 55, 56,
+ 57, 58, 59, 60, 61, 62, 63, 64, 65, 66,
+ 67, 68, 69, 70, 71, 72, 73, 74, 75, 76,
+ 77, 78, 79, 80, 81, 82, 83, 84, 85, 86,
+ 87, 88, 89, 90, 91, 92, 93, 94, 95, 96,
+ 97, 98, 99, 100, 101, 102, 103, 104, 105, 106,
+ 107, 108, 109, 110, 111, 112, 113, 114, 115, 116,
+ 117, 118, 119, 120, 121, 122, 123, 124, 125, 0,
+ 0, 0, 0, 126, 127, 128, 129, 130, 131, 132,
+ 133, 245, 179, 134, 180, 246, 247, 248, 249, 250,
+ 0, 0, 251, 252, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 135, 136, 137, 138, 0, 139, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 145,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 146,
+ 0, 0, 0, 0, 0, 0, 0, 0, 253, 0,
+ 0, 0, 0, 0, 254, 255, 256, 257, 17, 18,
+ 19, 20, 21, 22, 0, 0, 0, 0, 0, 258,
+ 259, 478, 0, 0, 0, 23, 24, 25, 26, 27,
+ 28, 29, 30, 31, 32, 33, 34, 35, 176, 177,
+ 0, 178, 39, 40, 41, 42, 43, 44, 45, 46,
+ 47, 48, 49, 50, 51, 52, 53, 54, 55, 56,
+ 57, 58, 59, 60, 61, 62, 63, 64, 65, 66,
+ 67, 68, 69, 70, 71, 72, 73, 74, 75, 76,
+ 77, 78, 79, 80, 81, 82, 83, 84, 85, 86,
+ 87, 88, 89, 90, 91, 92, 93, 94, 95, 96,
+ 97, 98, 99, 100, 101, 102, 103, 104, 105, 106,
+ 107, 108, 109, 110, 111, 112, 113, 114, 115, 116,
+ 117, 118, 119, 120, 121, 122, 123, 124, 125, 0,
+ 0, 0, 0, 126, 127, 128, 129, 130, 131, 132,
+ 133, 0, 0, 134, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 181, 136, 137, 138, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 145,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 146,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 17, 18, 19, 20, 21,
+ 22, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 326, 23, 24, 25, 26, 27, 28, 29, 30,
+ 31, 32, 33, 34, 35, 176, 177, 0, 178, 39,
+ 40, 41, 42, 43, 44, 45, 46, 47, 48, 49,
+ 50, 51, 52, 53, 54, 55, 56, 57, 58, 59,
+ 60, 61, 62, 63, 64, 65, 66, 67, 68, 69,
+ 70, 71, 72, 73, 74, 75, 76, 77, 78, 79,
+ 80, 81, 82, 83, 84, 85, 86, 87, 88, 89,
+ 90, 91, 92, 93, 94, 95, 96, 97, 98, 99,
+ 100, 101, 102, 103, 104, 105, 106, 107, 108, 109,
+ 110, 111, 112, 113, 114, 115, 116, 117, 118, 119,
+ 120, 121, 122, 123, 124, 125, 0, 0, 0, 0,
+ 126, 127, 128, 129, 130, 131, 132, 133, 0, 0,
+ 134, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 181, 136,
+ 137, 138, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 145, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 146, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 17,
+ 18, 19, 20, 21, 22, 237, 238, 239, 411, 240,
+ 241, 242, 243, 244, 514, 515, 23, 24, 25, 26,
+ 27, 28, 29, 30, 31, 32, 33, 34, 35, 36,
+ 37, 0, 38, 39, 40, 41, 42, 43, 44, 45,
+ 46, 47, 48, 49, 50, 51, 52, 53, 54, 55,
+ 56, 57, 58, 59, 60, 61, 62, 63, 64, 65,
+ 66, 67, 68, 69, 70, 71, 72, 73, 74, 75,
+ 76, 77, 78, 79, 80, 81, 82, 83, 84, 85,
+ 86, 87, 88, 89, 90, 91, 92, 93, 94, 95,
+ 96, 97, 98, 99, 100, 101, 102, 103, 104, 105,
+ 106, 107, 108, 109, 110, 111, 112, 113, 114, 115,
+ 116, 117, 118, 119, 120, 121, 122, 123, 124, 125,
+ 0, 0, 0, 0, 126, 127, 128, 129, 130, 131,
+ 132, 133, 245, 179, 134, 180, 246, 247, 248, 249,
+ 250, 0, 0, 251, 252, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 136, 137, 138, 139, 140,
- 0, 141, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 147, 0, 0, 0, 0, 0,
+ 0, 0, 135, 136, 137, 138, 0, 139, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 145, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 259, 0, 0, 0, 0, 0, 260, 261, 262,
- 263, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 264, 265, 400, 17, 18, 19, 20, 21,
- 22, 243, 244, 245, 0, 246, 247, 248, 249, 250,
+ 146, 0, 0, 0, 0, 0, 0, 0, 0, 253,
+ 0, 0, 0, 0, 0, 254, 255, 256, 257, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 258, 259, 17, 18, 19, 20, 21, 22, 237, 238,
+ 239, 0, 240, 241, 242, 243, 244, 0, 0, 23,
+ 24, 25, 26, 27, 28, 29, 30, 31, 32, 33,
+ 34, 35, 36, 37, 0, 38, 39, 40, 41, 42,
+ 43, 44, 45, 46, 47, 48, 49, 50, 51, 52,
+ 53, 54, 55, 56, 57, 58, 59, 60, 61, 62,
+ 63, 64, 65, 66, 67, 68, 69, 70, 71, 72,
+ 73, 74, 75, 76, 77, 78, 79, 80, 81, 82,
+ 83, 84, 85, 86, 87, 88, 89, 90, 91, 92,
+ 93, 94, 95, 96, 97, 98, 99, 100, 101, 102,
+ 103, 104, 105, 106, 107, 108, 109, 110, 111, 112,
+ 113, 114, 115, 116, 117, 118, 119, 120, 121, 122,
+ 123, 124, 125, 0, 0, 0, 0, 126, 127, 128,
+ 129, 130, 131, 132, 133, 245, 179, 134, 180, 246,
+ 247, 248, 249, 250, 0, 0, 251, 252, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 135, 136, 137, 138, 0,
+ 139, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 145, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 146, 0, 0, 0, 0, 0, 0,
+ 0, 0, 253, 0, 0, 0, 0, 0, 254, 255,
+ 256, 257, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 258, 259, 17, 18, 19, 20, 21,
+ 22, 237, 238, 239, 0, 240, 241, 242, 243, 244,
0, 0, 23, 24, 25, 26, 27, 28, 29, 30,
31, 32, 33, 34, 35, 36, 37, 0, 38, 39,
40, 41, 42, 43, 44, 45, 46, 47, 48, 49,
@@ -1259,22 +1378,22 @@ static const yytype_int16 yytable[] =
90, 91, 92, 93, 94, 95, 96, 97, 98, 99,
100, 101, 102, 103, 104, 105, 106, 107, 108, 109,
110, 111, 112, 113, 114, 115, 116, 117, 118, 119,
- 120, 121, 122, 123, 124, 125, 126, 0, 0, 0,
- 0, 127, 128, 129, 130, 131, 132, 133, 134, 251,
- 180, 135, 181, 252, 253, 254, 255, 256, 0, 0,
- 257, 258, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 136,
- 137, 138, 139, 140, 0, 141, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 147, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 120, 121, 122, 123, 124, 125, 0, 0, 0, 0,
+ 126, 127, 128, 129, 130, 131, 132, 133, 245, 179,
+ 134, 180, 246, 247, 248, 249, 250, 0, 0, 251,
+ 252, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 135, 136,
+ 137, 138, 0, 139, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 145, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 259, 0, 0, 0, 0,
- 0, 260, 261, 262, 263, 17, 18, 19, 20, 21,
- 22, 0, 0, 0, 0, 0, 264, 265, 485, 0,
+ 0, 0, 0, 0, 0, 0, 146, 0, 0, 0,
+ 0, 0, 0, 0, 0, 253, 0, 0, 0, 0,
+ 0, 254, 255, 256, 257, 17, 18, 19, 20, 21,
+ 22, 0, 0, 0, 0, 0, 258, 194, 0, 0,
0, 0, 23, 24, 25, 26, 27, 28, 29, 30,
- 31, 32, 33, 34, 35, 177, 178, 0, 179, 39,
+ 31, 32, 33, 34, 35, 36, 37, 0, 38, 39,
40, 41, 42, 43, 44, 45, 46, 47, 48, 49,
50, 51, 52, 53, 54, 55, 56, 57, 58, 59,
60, 61, 62, 63, 64, 65, 66, 67, 68, 69,
@@ -1283,21 +1402,45 @@ static const yytype_int16 yytable[] =
90, 91, 92, 93, 94, 95, 96, 97, 98, 99,
100, 101, 102, 103, 104, 105, 106, 107, 108, 109,
110, 111, 112, 113, 114, 115, 116, 117, 118, 119,
- 120, 121, 122, 123, 124, 125, 126, 0, 0, 0,
- 0, 127, 128, 129, 130, 131, 132, 133, 134, 0,
- 0, 135, 0, 0, 0, 0, 0, 0, 0, 0,
+ 120, 121, 122, 123, 124, 125, 0, 0, 0, 0,
+ 126, 127, 128, 129, 130, 131, 132, 133, 0, 179,
+ 134, 180, 246, 247, 248, 249, 250, 0, 0, 251,
+ 252, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 135, 136,
+ 137, 138, 0, 139, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 145, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 146, 0, 0, 0,
+ 0, 0, 0, 0, 0, 253, 0, 0, 0, 0,
+ 0, 254, 255, 256, 257, 19, 20, 21, 22, 0,
+ 0, 0, 0, 0, 0, 0, 258, 0, 0, 0,
+ 23, 24, 25, 26, 27, 28, 29, 30, 31, 32,
+ 33, 34, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 43, 44, 45, 46, 47, 48, 49, 50, 51,
+ 52, 53, 54, 55, 56, 57, 58, 59, 60, 61,
+ 62, 63, 64, 65, 66, 67, 68, 69, 70, 71,
+ 72, 73, 74, 75, 76, 77, 78, 79, 80, 81,
+ 82, 83, 84, 85, 86, 87, 88, 89, 90, 91,
+ 92, 93, 94, 95, 96, 97, 98, 99, 100, 101,
+ 102, 103, 104, 105, 106, 107, 108, 109, 110, 111,
+ 112, 113, 114, 115, 116, 117, 118, 119, 120, 121,
+ 122, 123, 124, 125, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 131, 132, 133, 0, 179, 134, 180,
+ 246, 247, 248, 249, 250, 0, 0, 251, 252, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 182,
- 183, 138, 139, 140, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 147, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 17, 18, 19, 20,
- 21, 22, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 23, 24, 25, 26, 27, 28, 29,
- 30, 31, 32, 33, 34, 35, 177, 178, 333, 179,
- 39, 40, 41, 42, 43, 44, 45, 46, 47, 48,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 19, 20,
+ 21, 22, 0, 253, 0, 0, 0, 0, 0, 254,
+ 255, 256, 257, 23, 24, 25, 26, 27, 28, 29,
+ 30, 31, 32, 33, 34, 398, 506, 0, 0, 0,
+ 0, 0, 0, 0, 43, 44, 45, 46, 47, 48,
49, 50, 51, 52, 53, 54, 55, 56, 57, 58,
59, 60, 61, 62, 63, 64, 65, 66, 67, 68,
69, 70, 71, 72, 73, 74, 75, 76, 77, 78,
@@ -1305,119 +1448,134 @@ static const yytype_int16 yytable[] =
89, 90, 91, 92, 93, 94, 95, 96, 97, 98,
99, 100, 101, 102, 103, 104, 105, 106, 107, 108,
109, 110, 111, 112, 113, 114, 115, 116, 117, 118,
- 119, 120, 121, 122, 123, 124, 125, 126, 0, 0,
- 0, 0, 127, 128, 129, 130, 131, 132, 133, 134,
- 0, 0, 135, 0, 0, 0, 0, 0, 0, 0,
+ 119, 120, 121, 122, 123, 124, 125, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 131, 132, 133, 0,
+ 179, 134, 180, 246, 247, 248, 249, 250, 0, 0,
+ 251, 252, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 182, 183, 138, 139, 140, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 147,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 17, 18, 19,
- 20, 21, 22, 243, 244, 245, 0, 246, 247, 248,
- 249, 250, 521, 522, 23, 24, 25, 26, 27, 28,
- 29, 30, 31, 32, 33, 34, 35, 36, 37, 418,
- 38, 39, 40, 41, 42, 43, 44, 45, 46, 47,
- 48, 49, 50, 51, 52, 53, 54, 55, 56, 57,
- 58, 59, 60, 61, 62, 63, 64, 65, 66, 67,
- 68, 69, 70, 71, 72, 73, 74, 75, 76, 77,
- 78, 79, 80, 81, 82, 83, 84, 85, 86, 87,
- 88, 89, 90, 91, 92, 93, 94, 95, 96, 97,
- 98, 99, 100, 101, 102, 103, 104, 105, 106, 107,
- 108, 109, 110, 111, 112, 113, 114, 115, 116, 117,
- 118, 119, 120, 121, 122, 123, 124, 125, 126, 0,
- 0, 0, 0, 127, 128, 129, 130, 131, 132, 133,
- 134, 251, 180, 135, 181, 252, 253, 254, 255, 256,
- 0, 0, 257, 258, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 136, 137, 138, 139, 140, 0, 141, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 147, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 19, 20, 21, 22, 0, 253, 0, 0, 0,
+ 0, 0, 254, 255, 256, 257, 23, 24, 25, 26,
+ 27, 28, 29, 30, 31, 32, 33, 34, 398, 0,
+ 0, 0, 0, 0, 0, 0, 0, 43, 44, 45,
+ 46, 47, 48, 49, 50, 51, 52, 53, 54, 55,
+ 56, 57, 58, 59, 60, 61, 62, 63, 64, 65,
+ 66, 67, 68, 69, 70, 71, 72, 73, 74, 75,
+ 76, 77, 78, 79, 80, 81, 82, 83, 84, 85,
+ 86, 87, 88, 89, 90, 91, 92, 93, 94, 95,
+ 96, 97, 98, 99, 100, 101, 102, 103, 104, 105,
+ 106, 107, 108, 109, 110, 111, 112, 113, 114, 115,
+ 116, 117, 118, 119, 120, 121, 122, 123, 124, 125,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 131,
+ 132, 133, 0, 179, 134, 180, 246, 247, 248, 249,
+ 250, 0, 0, 251, 252, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 259, 0, 0,
- 0, 0, 0, 260, 261, 262, 263, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 264, 265,
- 17, 18, 19, 20, 21, 22, 243, 244, 245, 0,
- 246, 247, 248, 249, 250, 0, 0, 23, 24, 25,
- 26, 27, 28, 29, 30, 31, 32, 33, 34, 35,
- 36, 37, 0, 38, 39, 40, 41, 42, 43, 44,
- 45, 46, 47, 48, 49, 50, 51, 52, 53, 54,
- 55, 56, 57, 58, 59, 60, 61, 62, 63, 64,
- 65, 66, 67, 68, 69, 70, 71, 72, 73, 74,
- 75, 76, 77, 78, 79, 80, 81, 82, 83, 84,
- 85, 86, 87, 88, 89, 90, 91, 92, 93, 94,
- 95, 96, 97, 98, 99, 100, 101, 102, 103, 104,
- 105, 106, 107, 108, 109, 110, 111, 112, 113, 114,
- 115, 116, 117, 118, 119, 120, 121, 122, 123, 124,
- 125, 126, 0, 0, 0, 0, 127, 128, 129, 130,
- 131, 132, 133, 134, 251, 180, 135, 181, 252, 253,
- 254, 255, 256, 0, 0, 257, 258, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 136, 137, 138, 139, 140, 0,
- 141, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 147, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 253,
+ 0, 0, 0, 0, 0, 254, 255, 256, 257, 17,
+ 18, 19, 20, 21, 22, 0, 0, 0, 0, 0,
+ 339, 0, 0, 0, 0, 0, 23, 24, 25, 26,
+ 27, 28, 29, 30, 31, 32, 33, 34, 35, 176,
+ 177, 0, 178, 39, 40, 41, 42, 43, 44, 45,
+ 46, 47, 48, 49, 50, 51, 52, 53, 54, 55,
+ 56, 57, 58, 59, 60, 61, 62, 63, 64, 65,
+ 66, 67, 68, 69, 70, 71, 72, 73, 74, 75,
+ 76, 77, 78, 79, 80, 81, 82, 83, 84, 85,
+ 86, 87, 88, 89, 90, 91, 92, 93, 94, 95,
+ 96, 97, 98, 99, 100, 101, 102, 103, 104, 105,
+ 106, 107, 108, 109, 110, 111, 112, 113, 114, 115,
+ 116, 117, 118, 119, 120, 121, 122, 123, 124, 125,
+ 0, 0, 0, 0, 126, 127, 128, 129, 130, 131,
+ 132, 133, 0, 179, 134, 180, 246, 247, 248, 249,
+ 250, 0, 0, 251, 252, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 259, 0, 0, 0, 0, 0, 260, 261, 262, 263,
+ 0, 0, 181, 136, 137, 138, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 264, 265, 17, 18, 19, 20, 21, 22, 243,
- 244, 245, 0, 246, 247, 248, 249, 250, 0, 0,
- 23, 24, 25, 26, 27, 28, 29, 30, 31, 32,
- 33, 34, 35, 36, 37, 0, 38, 39, 40, 41,
- 42, 43, 44, 45, 46, 47, 48, 49, 50, 51,
- 52, 53, 54, 55, 56, 57, 58, 59, 60, 61,
- 62, 63, 64, 65, 66, 67, 68, 69, 70, 71,
- 72, 73, 74, 75, 76, 77, 78, 79, 80, 81,
- 82, 83, 84, 85, 86, 87, 88, 89, 90, 91,
- 92, 93, 94, 95, 96, 97, 98, 99, 100, 101,
- 102, 103, 104, 105, 106, 107, 108, 109, 110, 111,
- 112, 113, 114, 115, 116, 117, 118, 119, 120, 121,
- 122, 123, 124, 125, 126, 0, 0, 0, 0, 127,
- 128, 129, 130, 131, 132, 133, 134, 251, 180, 135,
- 181, 252, 253, 254, 255, 256, 0, 0, 257, 258,
+ 145, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 136, 137, 138,
- 139, 140, 0, 141, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 147, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 146, 0, 0, 0, 19, 20, 21, 22, 0, 253,
+ 0, 0, 0, 0, 0, 254, 255, 256, 257, 23,
+ 24, 25, 26, 27, 28, 29, 30, 31, 32, 33,
+ 34, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 43, 44, 45, 46, 47, 48, 49, 50, 51, 52,
+ 53, 54, 55, 56, 57, 58, 59, 60, 61, 62,
+ 63, 64, 65, 66, 67, 68, 69, 70, 71, 72,
+ 73, 74, 75, 76, 77, 78, 79, 80, 81, 82,
+ 83, 84, 85, 86, 87, 88, 89, 90, 91, 92,
+ 93, 94, 95, 96, 97, 98, 99, 100, 101, 102,
+ 103, 104, 105, 106, 107, 108, 109, 110, 111, 112,
+ 113, 114, 115, 116, 117, 118, 119, 120, 121, 122,
+ 123, 124, 125, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 131, 132, 133, 0, 179, 134, 180, 246,
+ 247, 248, 249, 250, 0, 0, 251, 252, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 259, 0, 0, 0, 0, 0, 260,
- 261, 262, 263, 17, 18, 19, 20, 21, 22, 0,
- 0, 0, 0, 0, 264, 199, 0, 0, 0, 0,
- 23, 24, 25, 26, 27, 28, 29, 30, 31, 32,
- 33, 34, 35, 36, 37, 0, 38, 39, 40, 41,
- 42, 43, 44, 45, 46, 47, 48, 49, 50, 51,
- 52, 53, 54, 55, 56, 57, 58, 59, 60, 61,
- 62, 63, 64, 65, 66, 67, 68, 69, 70, 71,
- 72, 73, 74, 75, 76, 77, 78, 79, 80, 81,
- 82, 83, 84, 85, 86, 87, 88, 89, 90, 91,
- 92, 93, 94, 95, 96, 97, 98, 99, 100, 101,
- 102, 103, 104, 105, 106, 107, 108, 109, 110, 111,
- 112, 113, 114, 115, 116, 117, 118, 119, 120, 121,
- 122, 123, 124, 125, 126, 0, 0, 0, 0, 127,
- 128, 129, 130, 131, 132, 133, 134, 0, 180, 135,
- 181, 252, 253, 254, 255, 256, 0, 0, 257, 258,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 136, 137, 138,
- 139, 140, 0, 141, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 147, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 259, 0, 0, 0, 0, 0, 260,
- 261, 262, 263, 19, 20, 21, 22, 0, 0, 0,
- 0, 0, 0, 0, 264, 0, 0, 0, 23, 24,
- 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
+ 0, 0, 0, 0, 0, 0, 0, 19, 20, 21,
+ 22, 0, 253, 0, 0, 315, 0, 0, 254, 255,
+ 256, 257, 23, 24, 25, 26, 27, 28, 29, 30,
+ 31, 32, 33, 34, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 43, 44, 45, 46, 47, 48, 49,
+ 50, 51, 52, 53, 54, 55, 56, 57, 58, 59,
+ 60, 61, 62, 63, 64, 65, 66, 67, 68, 69,
+ 70, 71, 72, 73, 74, 75, 76, 77, 78, 79,
+ 80, 81, 82, 83, 84, 85, 86, 87, 88, 89,
+ 90, 91, 92, 93, 94, 95, 96, 97, 98, 99,
+ 100, 101, 102, 103, 104, 105, 106, 107, 108, 109,
+ 110, 111, 112, 113, 114, 115, 116, 117, 118, 119,
+ 120, 121, 122, 123, 124, 125, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 131, 132, 133, 0, 179,
+ 134, 180, 246, 247, 248, 249, 250, 0, 0, 251,
+ 252, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 19, 20, 21, 22, 0, 253, 0, 0, 403, 0,
+ 0, 254, 255, 256, 257, 23, 24, 25, 26, 27,
+ 28, 29, 30, 31, 32, 33, 34, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 43, 44, 45, 46,
+ 47, 48, 49, 50, 51, 52, 53, 54, 55, 56,
+ 57, 58, 59, 60, 61, 62, 63, 64, 65, 66,
+ 67, 68, 69, 70, 71, 72, 73, 74, 75, 76,
+ 77, 78, 79, 80, 81, 82, 83, 84, 85, 86,
+ 87, 88, 89, 90, 91, 92, 93, 94, 95, 96,
+ 97, 98, 99, 100, 101, 102, 103, 104, 105, 106,
+ 107, 108, 109, 110, 111, 112, 113, 114, 115, 116,
+ 117, 118, 119, 120, 121, 122, 123, 124, 125, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 131, 132,
+ 133, 0, 179, 134, 180, 246, 247, 248, 249, 250,
+ 0, 0, 251, 252, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 19, 20, 21, 22, 0, 253, 0,
+ 0, 0, 0, 0, 254, 255, 256, 257, 23, 24,
+ 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 43,
44, 45, 46, 47, 48, 49, 50, 51, 52, 53,
54, 55, 56, 57, 58, 59, 60, 61, 62, 63,
64, 65, 66, 67, 68, 69, 70, 71, 72, 73,
@@ -1426,9 +1584,9 @@ static const yytype_int16 yytable[] =
94, 95, 96, 97, 98, 99, 100, 101, 102, 103,
104, 105, 106, 107, 108, 109, 110, 111, 112, 113,
114, 115, 116, 117, 118, 119, 120, 121, 122, 123,
- 124, 125, 126, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 132, 133, 134, 0, 180, 135, 181, 252,
- 253, 254, 255, 256, 0, 0, 257, 258, 0, 0,
+ 124, 125, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 131, 132, 355, 0, 179, 134, 180, 246, 247,
+ 248, 249, 250, 0, 0, 251, 252, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
@@ -1437,10 +1595,10 @@ static const yytype_int16 yytable[] =
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 19, 20, 21, 22,
- 0, 259, 0, 0, 0, 0, 0, 260, 261, 262,
- 263, 23, 24, 25, 26, 27, 28, 29, 30, 31,
- 32, 33, 34, 405, 513, 0, 0, 0, 0, 0,
- 0, 0, 0, 44, 45, 46, 47, 48, 49, 50,
+ 0, 253, 0, 0, 0, 0, 0, 254, 255, 256,
+ 257, 23, 24, 25, 26, 27, 28, 29, 30, 31,
+ 32, 33, 34, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 43, 44, 45, 46, 47, 48, 49, 50,
51, 52, 53, 54, 55, 56, 57, 58, 59, 60,
61, 62, 63, 64, 65, 66, 67, 68, 69, 70,
71, 72, 73, 74, 75, 76, 77, 78, 79, 80,
@@ -1448,32 +1606,9 @@ static const yytype_int16 yytable[] =
91, 92, 93, 94, 95, 96, 97, 98, 99, 100,
101, 102, 103, 104, 105, 106, 107, 108, 109, 110,
111, 112, 113, 114, 115, 116, 117, 118, 119, 120,
- 121, 122, 123, 124, 125, 126, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 132, 133, 134, 0, 180,
- 135, 181, 252, 253, 254, 255, 256, 0, 0, 257,
- 258, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 19,
- 20, 21, 22, 0, 259, 0, 0, 0, 0, 0,
- 260, 261, 262, 263, 23, 24, 25, 26, 27, 28,
- 29, 30, 31, 32, 33, 34, 405, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 44, 45, 46, 47,
- 48, 49, 50, 51, 52, 53, 54, 55, 56, 57,
- 58, 59, 60, 61, 62, 63, 64, 65, 66, 67,
- 68, 69, 70, 71, 72, 73, 74, 75, 76, 77,
- 78, 79, 80, 81, 82, 83, 84, 85, 86, 87,
- 88, 89, 90, 91, 92, 93, 94, 95, 96, 97,
- 98, 99, 100, 101, 102, 103, 104, 105, 106, 107,
- 108, 109, 110, 111, 112, 113, 114, 115, 116, 117,
- 118, 119, 120, 121, 122, 123, 124, 125, 126, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 132, 133,
- 134, 0, 180, 135, 181, 252, 253, 254, 255, 256,
- 0, 0, 257, 258, 0, 0, 0, 0, 0, 0,
+ 121, 122, 123, 124, 125, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 131, 132, 484, 0, 179, 134,
+ 180, 246, 247, 248, 249, 250, 0, 0, 251, 252,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
@@ -1481,12 +1616,11 @@ static const yytype_int16 yytable[] =
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 259, 0, 0,
- 0, 0, 0, 260, 261, 262, 263, 17, 18, 19,
- 20, 21, 22, 0, 0, 0, 0, 0, 346, 0,
- 0, 0, 0, 0, 23, 24, 25, 26, 27, 28,
- 29, 30, 31, 32, 33, 34, 35, 177, 178, 0,
- 179, 39, 40, 41, 42, 43, 44, 45, 46, 47,
+ 0, 0, 0, 0, 0, 0, 0, 17, 18, 19,
+ 20, 21, 22, 0, 253, 0, 0, 0, 0, 0,
+ 254, 255, 256, 257, 23, 24, 25, 26, 27, 28,
+ 29, 30, 31, 32, 33, 34, 35, 36, 37, 0,
+ 38, 39, 40, 41, 42, 43, 44, 45, 46, 47,
48, 49, 50, 51, 52, 53, 54, 55, 56, 57,
58, 59, 60, 61, 62, 63, 64, 65, 66, 67,
68, 69, 70, 71, 72, 73, 74, 75, 76, 77,
@@ -1494,100 +1628,51 @@ static const yytype_int16 yytable[] =
88, 89, 90, 91, 92, 93, 94, 95, 96, 97,
98, 99, 100, 101, 102, 103, 104, 105, 106, 107,
108, 109, 110, 111, 112, 113, 114, 115, 116, 117,
- 118, 119, 120, 121, 122, 123, 124, 125, 126, 0,
- 0, 0, 0, 127, 128, 129, 130, 131, 132, 133,
- 134, 0, 180, 135, 181, 252, 253, 254, 255, 256,
- 0, 0, 257, 258, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 182, 183, 138, 139, 140, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 147, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 19, 20, 21, 22, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 23, 24, 25, 26, 27,
- 28, 29, 30, 31, 32, 33, 34, 259, 0, 0,
- 0, 0, 0, 260, 261, 262, 263, 44, 45, 46,
- 47, 48, 49, 50, 51, 52, 53, 54, 55, 56,
- 57, 58, 59, 60, 61, 62, 63, 64, 65, 66,
- 67, 68, 69, 70, 71, 72, 73, 74, 75, 76,
- 77, 78, 79, 80, 81, 82, 83, 84, 85, 86,
- 87, 88, 89, 90, 91, 92, 93, 94, 95, 96,
- 97, 98, 99, 100, 101, 102, 103, 104, 105, 106,
- 107, 108, 109, 110, 111, 112, 113, 114, 115, 116,
- 117, 118, 119, 120, 121, 122, 123, 124, 125, 126,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 132,
- 133, 134, 0, 180, 135, 181, 252, 253, 254, 255,
- 256, 0, 0, 257, 258, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 19, 20, 21, 22, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 23, 24, 25, 26,
- 27, 28, 29, 30, 31, 32, 33, 34, 259, 0,
- 0, 322, 0, 0, 260, 261, 262, 263, 44, 45,
- 46, 47, 48, 49, 50, 51, 52, 53, 54, 55,
- 56, 57, 58, 59, 60, 61, 62, 63, 64, 65,
- 66, 67, 68, 69, 70, 71, 72, 73, 74, 75,
- 76, 77, 78, 79, 80, 81, 82, 83, 84, 85,
- 86, 87, 88, 89, 90, 91, 92, 93, 94, 95,
- 96, 97, 98, 99, 100, 101, 102, 103, 104, 105,
- 106, 107, 108, 109, 110, 111, 112, 113, 114, 115,
- 116, 117, 118, 119, 120, 121, 122, 123, 124, 125,
- 126, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 132, 133, 134, 0, 180, 135, 181, 252, 253, 254,
- 255, 256, 0, 0, 257, 258, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 19, 20, 21, 22, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 23, 24, 25,
- 26, 27, 28, 29, 30, 31, 32, 33, 34, 259,
- 0, 0, 410, 0, 0, 260, 261, 262, 263, 44,
- 45, 46, 47, 48, 49, 50, 51, 52, 53, 54,
- 55, 56, 57, 58, 59, 60, 61, 62, 63, 64,
- 65, 66, 67, 68, 69, 70, 71, 72, 73, 74,
- 75, 76, 77, 78, 79, 80, 81, 82, 83, 84,
- 85, 86, 87, 88, 89, 90, 91, 92, 93, 94,
- 95, 96, 97, 98, 99, 100, 101, 102, 103, 104,
- 105, 106, 107, 108, 109, 110, 111, 112, 113, 114,
- 115, 116, 117, 118, 119, 120, 121, 122, 123, 124,
- 125, 126, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 132, 133, 134, 0, 180, 135, 181, 252, 253,
- 254, 255, 256, 0, 0, 257, 258, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 118, 119, 120, 121, 122, 123, 124, 125, 0, 0,
+ 0, 0, 126, 127, 128, 129, 130, 131, 132, 133,
+ 0, 0, 134, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 135, 136, 137, 138, 0, 139, 0, 0, 0, 0,
+ 0, 0, 0, 140, 141, 142, 143, 144, 145, 0,
+ 0, 0, 0, 0, 0, 0, 17, 18, 19, 20,
+ 21, 22, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 23, 24, 25, 26, 27, 28, 29,
+ 30, 31, 32, 33, 34, 35, 176, 177, 146, 178,
+ 39, 40, 41, 42, 43, 44, 45, 46, 47, 48,
+ 49, 50, 51, 52, 53, 54, 55, 56, 57, 58,
+ 59, 60, 61, 62, 63, 64, 65, 66, 67, 68,
+ 69, 70, 71, 72, 73, 74, 75, 76, 77, 78,
+ 79, 80, 81, 82, 83, 84, 85, 86, 87, 88,
+ 89, 90, 91, 92, 93, 94, 95, 96, 97, 98,
+ 99, 100, 101, 102, 103, 104, 105, 106, 107, 108,
+ 109, 110, 111, 112, 113, 114, 115, 116, 117, 118,
+ 119, 120, 121, 122, 123, 124, 125, 17, 18, 0,
+ 0, 126, 127, 128, 129, 130, 131, 132, 133, 0,
+ 0, 134, 0, 0, 0, 0, 17, 18, 0, 0,
+ 0, 0, 0, 0, 0, 0, 35, 176, 177, 0,
+ 178, 39, 40, 41, 42, 0, 0, 0, 0, 181,
+ 136, 137, 138, 0, 0, 35, 36, 37, 0, 38,
+ 39, 40, 41, 42, 0, 0, 0, 145, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 19, 20, 21, 22, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 23, 24,
- 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
- 259, 0, 0, 0, 0, 0, 260, 261, 262, 263,
- 44, 45, 46, 47, 48, 49, 50, 51, 52, 53,
- 54, 55, 56, 57, 58, 59, 60, 61, 62, 63,
- 64, 65, 66, 67, 68, 69, 70, 71, 72, 73,
- 74, 75, 76, 77, 78, 79, 80, 81, 82, 83,
- 84, 85, 86, 87, 88, 89, 90, 91, 92, 93,
- 94, 95, 96, 97, 98, 99, 100, 101, 102, 103,
- 104, 105, 106, 107, 108, 109, 110, 111, 112, 113,
- 114, 115, 116, 117, 118, 119, 120, 121, 122, 123,
- 124, 125, 126, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 132, 133, 362, 0, 180, 135, 181, 252,
- 253, 254, 255, 256, 0, 0, 257, 258, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 146, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 126, 127, 128, 129, 130, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 126, 127, 128, 129, 130, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 181, 136, 137, 138, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 145, 181,
+ 136, 137, 138, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 145, 0, 0,
0, 0, 0, 0, 19, 20, 21, 22, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 23,
+ 0, 0, 0, 0, 0, 0, 0, 0, 146, 23,
24, 25, 26, 27, 28, 29, 30, 31, 32, 33,
- 34, 259, 0, 0, 0, 0, 0, 260, 261, 262,
- 263, 44, 45, 46, 47, 48, 49, 50, 51, 52,
+ 34, 0, 0, 0, 0, 0, 0, 146, 0, 0,
+ 43, 44, 45, 46, 47, 48, 49, 50, 51, 52,
53, 54, 55, 56, 57, 58, 59, 60, 61, 62,
63, 64, 65, 66, 67, 68, 69, 70, 71, 72,
73, 74, 75, 76, 77, 78, 79, 80, 81, 82,
@@ -1595,56 +1680,119 @@ static const yytype_int16 yytable[] =
93, 94, 95, 96, 97, 98, 99, 100, 101, 102,
103, 104, 105, 106, 107, 108, 109, 110, 111, 112,
113, 114, 115, 116, 117, 118, 119, 120, 121, 122,
- 123, 124, 125, 126, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 132, 133, 491, 0, 180, 135, 181,
- 252, 253, 254, 255, 256, 0, 0, 257, 258, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 17, 18, 19, 20, 21,
- 22, 0, 259, 0, 0, 0, 0, 0, 260, 261,
- 262, 263, 23, 24, 25, 26, 27, 28, 29, 30,
- 31, 32, 33, 34, 35, 36, 37, 0, 38, 39,
- 40, 41, 42, 43, 44, 45, 46, 47, 48, 49,
- 50, 51, 52, 53, 54, 55, 56, 57, 58, 59,
- 60, 61, 62, 63, 64, 65, 66, 67, 68, 69,
- 70, 71, 72, 73, 74, 75, 76, 77, 78, 79,
- 80, 81, 82, 83, 84, 85, 86, 87, 88, 89,
- 90, 91, 92, 93, 94, 95, 96, 97, 98, 99,
- 100, 101, 102, 103, 104, 105, 106, 107, 108, 109,
- 110, 111, 112, 113, 114, 115, 116, 117, 118, 119,
- 120, 121, 122, 123, 124, 125, 126, 0, 0, 0,
- 0, 127, 128, 129, 130, 131, 132, 133, 134, 0,
- 0, 135, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 136,
- 137, 138, 139, 140, 0, 141, 0, 12, 0, 0,
- 0, 0, 0, 142, 143, 144, 145, 146, 147, 17,
- 18, 19, 20, 21, 22, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 23, 24, 25, 26,
- 27, 28, 29, 30, 31, 32, 33, 34, 35, 36,
- 37, 0, 38, 39, 40, 41, 42, 43, 44, 45,
- 46, 47, 48, 49, 50, 51, 52, 53, 54, 55,
- 56, 57, 58, 59, 60, 61, 62, 63, 64, 65,
- 66, 67, 68, 69, 70, 71, 72, 73, 74, 75,
- 76, 77, 78, 79, 80, 81, 82, 83, 84, 85,
- 86, 87, 88, 89, 90, 91, 92, 93, 94, 95,
- 96, 97, 98, 99, 100, 101, 102, 103, 104, 105,
- 106, 107, 108, 109, 110, 111, 112, 113, 114, 115,
- 116, 117, 118, 119, 120, 121, 122, 123, 124, 125,
- 126, 0, 0, 0, 0, 127, 128, 129, 130, 131,
- 132, 133, 134, 0, 0, 135, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 136, 137, 138, 139, 140, 0, 141,
- 17, 18, 19, 20, 21, 22, 0, 142, 143, 144,
- 145, 146, 147, 0, 0, 0, 0, 23, 24, 25,
- 26, 27, 28, 29, 30, 31, 32, 33, 34, 35,
- 177, 178, 0, 179, 39, 40, 41, 42, 43, 44,
+ 123, 124, 125, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 131, 132, 133, 0, 0, 134
+};
+
+static const yytype_int16 yycheck[] =
+{
+ 13, 239, 13, 243, 4, 4, 174, 210, 18, 19,
+ 18, 19, 12, 253, 139, 157, 135, 227, 139, 13,
+ 13, 4, 137, 138, 139, 221, 139, 396, 154, 398,
+ 269, 235, 401, 0, 33, 34, 35, 156, 3, 4,
+ 173, 149, 150, 137, 138, 139, 147, 148, 235, 253,
+ 33, 34, 35, 141, 137, 138, 139, 295, 135, 227,
+ 235, 229, 137, 138, 139, 238, 253, 32, 33, 34,
+ 309, 36, 37, 38, 39, 40, 235, 238, 253, 252,
+ 157, 158, 176, 160, 161, 477, 234, 172, 165, 234,
+ 238, 238, 461, 238, 253, 256, 176, 337, 238, 238,
+ 238, 341, 342, 495, 181, 308, 183, 254, 175, 192,
+ 350, 238, 176, 252, 254, 354, 254, 234, 328, 488,
+ 323, 238, 254, 255, 320, 251, 238, 254, 176, 254,
+ 369, 500, 132, 254, 235, 148, 237, 148, 246, 247,
+ 255, 254, 254, 239, 240, 234, 159, 289, 231, 238,
+ 390, 139, 391, 321, 148, 148, 156, 396, 139, 398,
+ 328, 174, 401, 128, 129, 130, 131, 132, 167, 168,
+ 169, 198, 185, 173, 342, 139, 234, 204, 205, 419,
+ 238, 194, 233, 194, 167, 168, 169, 145, 146, 427,
+ 203, 191, 395, 234, 234, 234, 435, 139, 238, 238,
+ 176, 166, 167, 168, 169, 176, 206, 221, 167, 168,
+ 169, 153, 289, 176, 227, 238, 229, 151, 152, 184,
+ 141, 142, 461, 137, 138, 139, 239, 139, 239, 235,
+ 470, 255, 351, 374, 375, 234, 474, 251, 252, 407,
+ 243, 244, 245, 233, 483, 176, 256, 486, 256, 488,
+ 235, 419, 376, 377, 494, 197, 198, 255, 272, 224,
+ 233, 500, 204, 205, 3, 4, 253, 378, 379, 380,
+ 381, 233, 382, 383, 514, 513, 254, 254, 233, 254,
+ 518, 519, 295, 233, 295, 254, 233, 233, 491, 233,
+ 256, 234, 530, 32, 33, 34, 233, 36, 37, 38,
+ 39, 40, 250, 248, 153, 305, 320, 155, 321, 249,
+ 233, 236, 136, 254, 234, 328, 233, 236, 256, 234,
+ 238, 234, 233, 336, 139, 336, 236, 254, 234, 342,
+ 234, 255, 332, 12, 347, 384, 347, 156, 157, 158,
+ 159, 160, 161, 162, 163, 164, 165, 254, 253, 252,
+ 385, 351, 254, 386, 388, 387, 197, 371, 372, 373,
+ 374, 375, 376, 377, 378, 379, 380, 381, 382, 383,
+ 384, 385, 386, 387, 388, 389, 332, 389, 229, 405,
+ 409, 320, 336, 150, 336, 520, 495, 347, 419, 128,
+ 129, 130, 131, 132, 407, 518, 148, -1, 137, -1,
+ 139, -1, 407, -1, -1, -1, 419, -1, -1, -1,
+ -1, -1, -1, -1, 427, -1, 427, -1, -1, -1,
+ -1, -1, -1, -1, 424, -1, -1, 166, 167, 168,
+ 169, -1, -1, -1, 253, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, 184, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, 474, -1, 474, 477, -1, 477, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, 495, -1, 495, 224, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ 513, -1, 513, -1, -1, 518, 519, 518, 519, -1,
+ -1, -1, -1, -1, -1, -1, -1, 530, -1, 530,
+ 3, 4, 5, 6, 7, 8, 9, 10, 11, -1,
+ 13, 14, 15, 16, 17, -1, -1, 20, 21, 22,
+ 23, 24, 25, 26, 27, 28, 29, 30, 31, 32,
+ 33, 34, -1, 36, 37, 38, 39, 40, 41, 42,
+ 43, 44, 45, 46, 47, 48, 49, 50, 51, 52,
+ 53, 54, 55, 56, 57, 58, 59, 60, 61, 62,
+ 63, 64, 65, 66, 67, 68, 69, 70, 71, 72,
+ 73, 74, 75, 76, 77, 78, 79, 80, 81, 82,
+ 83, 84, 85, 86, 87, 88, 89, 90, 91, 92,
+ 93, 94, 95, 96, 97, 98, 99, 100, 101, 102,
+ 103, 104, 105, 106, 107, 108, 109, 110, 111, 112,
+ 113, 114, 115, 116, 117, 118, 119, 120, 121, 122,
+ 123, -1, -1, -1, -1, 128, 129, 130, 131, 132,
+ 133, 134, 135, 136, 137, 138, 139, 140, 141, 142,
+ 143, 144, -1, -1, 147, 148, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, 166, 167, 168, 169, -1, 171, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, 184, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, 224, -1, -1, -1, -1, -1, -1, -1, -1,
+ 233, -1, -1, -1, -1, -1, 239, 240, 241, 242,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, 254, 255, 256, 3, 4, 5, 6, 7, 8,
+ 9, 10, 11, -1, 13, 14, 15, 16, 17, -1,
+ -1, 20, 21, 22, 23, 24, 25, 26, 27, 28,
+ 29, 30, 31, 32, 33, 34, -1, 36, 37, 38,
+ 39, 40, 41, 42, 43, 44, 45, 46, 47, 48,
+ 49, 50, 51, 52, 53, 54, 55, 56, 57, 58,
+ 59, 60, 61, 62, 63, 64, 65, 66, 67, 68,
+ 69, 70, 71, 72, 73, 74, 75, 76, 77, 78,
+ 79, 80, 81, 82, 83, 84, 85, 86, 87, 88,
+ 89, 90, 91, 92, 93, 94, 95, 96, 97, 98,
+ 99, 100, 101, 102, 103, 104, 105, 106, 107, 108,
+ 109, 110, 111, 112, 113, 114, 115, 116, 117, 118,
+ 119, 120, 121, 122, 123, -1, -1, -1, -1, 128,
+ 129, 130, 131, 132, 133, 134, 135, 136, 137, 138,
+ 139, 140, 141, 142, 143, 144, -1, -1, 147, 148,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, 166, 167, 168,
+ 169, -1, 171, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, 184, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, 224, -1, -1, -1, -1,
+ -1, -1, -1, -1, 233, -1, -1, -1, -1, -1,
+ 239, 240, 241, 242, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, 254, 255, 256, 3, 4,
+ 5, 6, 7, 8, 9, 10, 11, -1, 13, 14,
+ 15, 16, 17, -1, -1, 20, 21, 22, 23, 24,
+ 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
+ -1, 36, 37, 38, 39, 40, 41, 42, 43, 44,
45, 46, 47, 48, 49, 50, 51, 52, 53, 54,
55, 56, 57, 58, 59, 60, 61, 62, 63, 64,
65, 66, 67, 68, 69, 70, 71, 72, 73, 74,
@@ -1652,29 +1800,97 @@ static const yytype_int16 yytable[] =
85, 86, 87, 88, 89, 90, 91, 92, 93, 94,
95, 96, 97, 98, 99, 100, 101, 102, 103, 104,
105, 106, 107, 108, 109, 110, 111, 112, 113, 114,
- 115, 116, 117, 118, 119, 120, 121, 122, 123, 124,
- 125, 126, 17, 18, 0, 0, 127, 128, 129, 130,
- 131, 132, 133, 134, 0, 0, 135, 0, 0, 0,
- 0, 0, 17, 18, 0, 0, 0, 0, 0, 0,
- 0, 35, 177, 178, 0, 179, 39, 40, 41, 42,
- 43, 0, 0, 0, 182, 183, 138, 139, 140, 0,
- 0, 35, 36, 37, 0, 38, 39, 40, 41, 42,
- 43, 0, 0, 147, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 127, 128,
- 129, 130, 131, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 127, 128,
- 129, 130, 131, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 182, 183, 138, 139,
- 140, 0, 0, 0, 0, 0, 19, 20, 21, 22,
- 0, 0, 0, 0, 0, 147, 182, 183, 138, 139,
- 140, 23, 24, 25, 26, 27, 28, 29, 30, 31,
- 32, 33, 34, 0, 0, 147, 0, 0, 0, 0,
- 0, 0, 0, 44, 45, 46, 47, 48, 49, 50,
+ 115, 116, 117, 118, 119, 120, 121, 122, 123, -1,
+ -1, -1, -1, 128, 129, 130, 131, 132, 133, 134,
+ 135, 136, 137, 138, 139, 140, 141, 142, 143, 144,
+ -1, -1, 147, 148, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, 166, 167, 168, 169, -1, 171, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, 184,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, 224,
+ -1, -1, -1, -1, -1, -1, -1, -1, 233, -1,
+ -1, -1, -1, -1, 239, 240, 241, 242, 3, 4,
+ 5, 6, 7, 8, -1, -1, -1, -1, -1, 254,
+ 255, 256, -1, -1, -1, 20, 21, 22, 23, 24,
+ 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
+ -1, 36, 37, 38, 39, 40, 41, 42, 43, 44,
+ 45, 46, 47, 48, 49, 50, 51, 52, 53, 54,
+ 55, 56, 57, 58, 59, 60, 61, 62, 63, 64,
+ 65, 66, 67, 68, 69, 70, 71, 72, 73, 74,
+ 75, 76, 77, 78, 79, 80, 81, 82, 83, 84,
+ 85, 86, 87, 88, 89, 90, 91, 92, 93, 94,
+ 95, 96, 97, 98, 99, 100, 101, 102, 103, 104,
+ 105, 106, 107, 108, 109, 110, 111, 112, 113, 114,
+ 115, 116, 117, 118, 119, 120, 121, 122, 123, -1,
+ -1, -1, -1, 128, 129, 130, 131, 132, 133, 134,
+ 135, -1, -1, 138, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, 166, 167, 168, 169, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, 184,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, 224,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, 3, 4, 5, 6, 7,
+ 8, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, 256, 20, 21, 22, 23, 24, 25, 26, 27,
+ 28, 29, 30, 31, 32, 33, 34, -1, 36, 37,
+ 38, 39, 40, 41, 42, 43, 44, 45, 46, 47,
+ 48, 49, 50, 51, 52, 53, 54, 55, 56, 57,
+ 58, 59, 60, 61, 62, 63, 64, 65, 66, 67,
+ 68, 69, 70, 71, 72, 73, 74, 75, 76, 77,
+ 78, 79, 80, 81, 82, 83, 84, 85, 86, 87,
+ 88, 89, 90, 91, 92, 93, 94, 95, 96, 97,
+ 98, 99, 100, 101, 102, 103, 104, 105, 106, 107,
+ 108, 109, 110, 111, 112, 113, 114, 115, 116, 117,
+ 118, 119, 120, 121, 122, 123, -1, -1, -1, -1,
+ 128, 129, 130, 131, 132, 133, 134, 135, -1, -1,
+ 138, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, 166, 167,
+ 168, 169, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, 184, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, 224, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, 3,
+ 4, 5, 6, 7, 8, 9, 10, 11, 256, 13,
+ 14, 15, 16, 17, 18, 19, 20, 21, 22, 23,
+ 24, 25, 26, 27, 28, 29, 30, 31, 32, 33,
+ 34, -1, 36, 37, 38, 39, 40, 41, 42, 43,
+ 44, 45, 46, 47, 48, 49, 50, 51, 52, 53,
+ 54, 55, 56, 57, 58, 59, 60, 61, 62, 63,
+ 64, 65, 66, 67, 68, 69, 70, 71, 72, 73,
+ 74, 75, 76, 77, 78, 79, 80, 81, 82, 83,
+ 84, 85, 86, 87, 88, 89, 90, 91, 92, 93,
+ 94, 95, 96, 97, 98, 99, 100, 101, 102, 103,
+ 104, 105, 106, 107, 108, 109, 110, 111, 112, 113,
+ 114, 115, 116, 117, 118, 119, 120, 121, 122, 123,
+ -1, -1, -1, -1, 128, 129, 130, 131, 132, 133,
+ 134, 135, 136, 137, 138, 139, 140, 141, 142, 143,
+ 144, -1, -1, 147, 148, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, 166, 167, 168, 169, -1, 171, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ 184, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ 224, -1, -1, -1, -1, -1, -1, -1, -1, 233,
+ -1, -1, -1, -1, -1, 239, 240, 241, 242, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ 254, 255, 3, 4, 5, 6, 7, 8, 9, 10,
+ 11, -1, 13, 14, 15, 16, 17, -1, -1, 20,
+ 21, 22, 23, 24, 25, 26, 27, 28, 29, 30,
+ 31, 32, 33, 34, -1, 36, 37, 38, 39, 40,
+ 41, 42, 43, 44, 45, 46, 47, 48, 49, 50,
51, 52, 53, 54, 55, 56, 57, 58, 59, 60,
61, 62, 63, 64, 65, 66, 67, 68, 69, 70,
71, 72, 73, 74, 75, 76, 77, 78, 79, 80,
@@ -1682,117 +1898,20 @@ static const yytype_int16 yytable[] =
91, 92, 93, 94, 95, 96, 97, 98, 99, 100,
101, 102, 103, 104, 105, 106, 107, 108, 109, 110,
111, 112, 113, 114, 115, 116, 117, 118, 119, 120,
- 121, 122, 123, 124, 125, 126, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 132, 133, 134, 0, 0,
- 135
-};
-
-static const yytype_int16 yycheck[] =
-{
- 13, 245, 13, 4, 175, 216, 158, 249, 18, 19,
- 13, 12, 18, 19, 13, 4, 140, 259, 136, 137,
- 140, 140, 227, 138, 139, 140, 136, 137, 238, 403,
- 155, 405, 235, 234, 408, 233, 4, 238, 275, 157,
- 148, 149, 252, 235, 33, 34, 35, 238, 158, 159,
- 253, 161, 162, 138, 139, 140, 166, 301, 138, 139,
- 140, 253, 233, 254, 235, 33, 34, 35, 385, 386,
- 387, 388, 182, 183, 235, 185, 174, 235, 0, 316,
- 484, 157, 158, 159, 160, 161, 162, 163, 164, 165,
- 166, 238, 253, 178, 468, 253, 150, 151, 502, 238,
- 238, 238, 344, 175, 315, 142, 348, 349, 178, 256,
- 254, 255, 238, 252, 194, 357, 254, 254, 177, 330,
- 234, 495, 327, 140, 361, 238, 251, 235, 254, 237,
- 254, 178, 133, 507, 254, 254, 149, 335, 149, 376,
- 255, 254, 140, 295, 234, 203, 149, 160, 238, 207,
- 149, 231, 210, 211, 140, 397, 157, 328, 235, 234,
- 178, 398, 175, 238, 335, 234, 403, 233, 405, 238,
- 234, 408, 255, 174, 238, 238, 189, 253, 349, 168,
- 169, 170, 171, 234, 426, 295, 199, 238, 199, 140,
- 434, 402, 246, 247, 195, 234, 209, 239, 240, 238,
- 168, 169, 170, 171, 178, 442, 138, 139, 140, 146,
- 147, 212, 169, 170, 171, 138, 139, 140, 227, 178,
- 233, 233, 235, 243, 244, 245, 152, 153, 142, 143,
- 178, 468, 245, 233, 245, 477, 233, 481, 381, 382,
- 358, 383, 384, 414, 235, 234, 256, 255, 257, 258,
- 256, 178, 254, 490, 233, 426, 493, 253, 495, 501,
- 389, 390, 254, 233, 254, 141, 254, 3, 4, 278,
- 507, 233, 233, 256, 234, 233, 520, 233, 154, 521,
- 249, 525, 526, 248, 250, 154, 156, 498, 301, 233,
- 301, 254, 137, 537, 236, 234, 32, 33, 34, 233,
- 36, 37, 38, 39, 40, 41, 236, 256, 236, 238,
- 234, 312, 233, 140, 234, 328, 3, 4, 327, 254,
- 253, 234, 335, 234, 255, 149, 202, 203, 12, 254,
- 343, 207, 343, 252, 210, 211, 349, 254, 339, 391,
- 393, 354, 392, 354, 202, 32, 33, 34, 394, 36,
- 37, 38, 39, 40, 41, 395, 327, 358, 396, 339,
- 235, 416, 343, 412, 151, 343, 502, 354, 525, 378,
- 379, 380, 381, 382, 383, 384, 385, 386, 387, 388,
- 389, 390, 391, 392, 393, 394, 395, 396, 149, 414,
- 426, -1, 527, 129, 130, 131, 132, 133, -1, -1,
- -1, 414, 138, -1, 140, -1, -1, -1, -1, -1,
- -1, -1, -1, 426, -1, -1, -1, -1, -1, -1,
- -1, 434, -1, 434, -1, -1, -1, -1, -1, -1,
- 431, 167, 168, 169, 170, 171, -1, -1, -1, -1,
- -1, -1, 129, 130, 131, 132, 133, -1, -1, -1,
- 186, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, 481, -1,
- 481, 484, -1, 484, -1, -1, -1, -1, -1, -1,
- 167, 168, 169, 170, 171, -1, -1, -1, -1, 502,
- -1, 502, -1, -1, -1, -1, -1, -1, -1, 186,
- -1, -1, -1, -1, -1, -1, -1, 520, -1, 520,
- -1, -1, 525, 526, 525, 526, -1, -1, -1, -1,
- -1, -1, -1, -1, 537, -1, 537, 3, 4, 5,
- 6, 7, 8, 9, 10, 11, -1, 13, 14, 15,
- 16, 17, -1, -1, 20, 21, 22, 23, 24, 25,
- 26, 27, 28, 29, 30, 31, 32, 33, 34, -1,
- 36, 37, 38, 39, 40, 41, 42, 43, 44, 45,
- 46, 47, 48, 49, 50, 51, 52, 53, 54, 55,
- 56, 57, 58, 59, 60, 61, 62, 63, 64, 65,
- 66, 67, 68, 69, 70, 71, 72, 73, 74, 75,
- 76, 77, 78, 79, 80, 81, 82, 83, 84, 85,
- 86, 87, 88, 89, 90, 91, 92, 93, 94, 95,
- 96, 97, 98, 99, 100, 101, 102, 103, 104, 105,
- 106, 107, 108, 109, 110, 111, 112, 113, 114, 115,
- 116, 117, 118, 119, 120, 121, 122, 123, 124, -1,
- -1, -1, -1, 129, 130, 131, 132, 133, 134, 135,
- 136, 137, 138, 139, 140, 141, 142, 143, 144, 145,
- -1, -1, 148, 149, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, 167, 168, 169, 170, 171, -1, 173, -1, -1,
+ 121, 122, 123, -1, -1, -1, -1, 128, 129, 130,
+ 131, 132, 133, 134, 135, 136, 137, 138, 139, 140,
+ 141, 142, 143, 144, -1, -1, 147, 148, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- 186, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, 166, 167, 168, 169, -1,
+ 171, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, 184, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, 233, -1, -1,
- -1, -1, -1, 239, 240, 241, 242, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, 254, 255,
- 256, 3, 4, 5, 6, 7, 8, 9, 10, 11,
- -1, 13, 14, 15, 16, 17, -1, -1, 20, 21,
- 22, 23, 24, 25, 26, 27, 28, 29, 30, 31,
- 32, 33, 34, -1, 36, 37, 38, 39, 40, 41,
- 42, 43, 44, 45, 46, 47, 48, 49, 50, 51,
- 52, 53, 54, 55, 56, 57, 58, 59, 60, 61,
- 62, 63, 64, 65, 66, 67, 68, 69, 70, 71,
- 72, 73, 74, 75, 76, 77, 78, 79, 80, 81,
- 82, 83, 84, 85, 86, 87, 88, 89, 90, 91,
- 92, 93, 94, 95, 96, 97, 98, 99, 100, 101,
- 102, 103, 104, 105, 106, 107, 108, 109, 110, 111,
- 112, 113, 114, 115, 116, 117, 118, 119, 120, 121,
- 122, 123, 124, -1, -1, -1, -1, 129, 130, 131,
- 132, 133, 134, 135, 136, 137, 138, 139, 140, 141,
- 142, 143, 144, 145, -1, -1, 148, 149, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, 167, 168, 169, 170, 171,
- -1, 173, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, 186, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, 233, -1, -1, -1, -1, -1, 239, 240, 241,
- 242, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, 254, 255, 256, 3, 4, 5, 6, 7,
+ -1, -1, -1, 224, -1, -1, -1, -1, -1, -1,
+ -1, -1, 233, -1, -1, -1, -1, -1, 239, 240,
+ 241, 242, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, 254, 255, 3, 4, 5, 6, 7,
8, 9, 10, 11, -1, 13, 14, 15, 16, 17,
-1, -1, 20, 21, 22, 23, 24, 25, 26, 27,
28, 29, 30, 31, 32, 33, 34, -1, 36, 37,
@@ -1804,20 +1923,20 @@ static const yytype_int16 yycheck[] =
88, 89, 90, 91, 92, 93, 94, 95, 96, 97,
98, 99, 100, 101, 102, 103, 104, 105, 106, 107,
108, 109, 110, 111, 112, 113, 114, 115, 116, 117,
- 118, 119, 120, 121, 122, 123, 124, -1, -1, -1,
- -1, 129, 130, 131, 132, 133, 134, 135, 136, 137,
- 138, 139, 140, 141, 142, 143, 144, 145, -1, -1,
- 148, 149, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, 167,
- 168, 169, 170, 171, -1, 173, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, 186, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ 118, 119, 120, 121, 122, 123, -1, -1, -1, -1,
+ 128, 129, 130, 131, 132, 133, 134, 135, 136, 137,
+ 138, 139, 140, 141, 142, 143, 144, -1, -1, 147,
+ 148, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, 166, 167,
+ 168, 169, -1, 171, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, 184, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, 224, -1, -1, -1,
-1, -1, -1, -1, -1, 233, -1, -1, -1, -1,
-1, 239, 240, 241, 242, 3, 4, 5, 6, 7,
- 8, -1, -1, -1, -1, -1, 254, 255, 256, -1,
+ 8, -1, -1, -1, -1, -1, 254, 255, -1, -1,
-1, -1, 20, 21, 22, 23, 24, 25, 26, 27,
28, 29, 30, 31, 32, 33, 34, -1, 36, 37,
38, 39, 40, 41, 42, 43, 44, 45, 46, 47,
@@ -1828,21 +1947,45 @@ static const yytype_int16 yycheck[] =
88, 89, 90, 91, 92, 93, 94, 95, 96, 97,
98, 99, 100, 101, 102, 103, 104, 105, 106, 107,
108, 109, 110, 111, 112, 113, 114, 115, 116, 117,
- 118, 119, 120, 121, 122, 123, 124, -1, -1, -1,
- -1, 129, 130, 131, 132, 133, 134, 135, 136, -1,
- -1, 139, -1, -1, -1, -1, -1, -1, -1, -1,
+ 118, 119, 120, 121, 122, 123, -1, -1, -1, -1,
+ 128, 129, 130, 131, 132, 133, 134, 135, -1, 137,
+ 138, 139, 140, 141, 142, 143, 144, -1, -1, 147,
+ 148, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, 166, 167,
+ 168, 169, -1, 171, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, 184, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, 167,
- 168, 169, 170, 171, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, 186, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, 224, -1, -1, -1,
+ -1, -1, -1, -1, -1, 233, -1, -1, -1, -1,
+ -1, 239, 240, 241, 242, 5, 6, 7, 8, -1,
+ -1, -1, -1, -1, -1, -1, 254, -1, -1, -1,
+ 20, 21, 22, 23, 24, 25, 26, 27, 28, 29,
+ 30, 31, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, 41, 42, 43, 44, 45, 46, 47, 48, 49,
+ 50, 51, 52, 53, 54, 55, 56, 57, 58, 59,
+ 60, 61, 62, 63, 64, 65, 66, 67, 68, 69,
+ 70, 71, 72, 73, 74, 75, 76, 77, 78, 79,
+ 80, 81, 82, 83, 84, 85, 86, 87, 88, 89,
+ 90, 91, 92, 93, 94, 95, 96, 97, 98, 99,
+ 100, 101, 102, 103, 104, 105, 106, 107, 108, 109,
+ 110, 111, 112, 113, 114, 115, 116, 117, 118, 119,
+ 120, 121, 122, 123, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, 133, 134, 135, -1, 137, 138, 139,
+ 140, 141, 142, 143, 144, -1, -1, 147, 148, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, 3, 4, 5, 6,
- 7, 8, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, 20, 21, 22, 23, 24, 25, 26,
- 27, 28, 29, 30, 31, 32, 33, 34, 256, 36,
- 37, 38, 39, 40, 41, 42, 43, 44, 45, 46,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, 5, 6,
+ 7, 8, -1, 233, -1, -1, -1, -1, -1, 239,
+ 240, 241, 242, 20, 21, 22, 23, 24, 25, 26,
+ 27, 28, 29, 30, 31, 255, 256, -1, -1, -1,
+ -1, -1, -1, -1, 41, 42, 43, 44, 45, 46,
47, 48, 49, 50, 51, 52, 53, 54, 55, 56,
57, 58, 59, 60, 61, 62, 63, 64, 65, 66,
67, 68, 69, 70, 71, 72, 73, 74, 75, 76,
@@ -1850,119 +1993,134 @@ static const yytype_int16 yycheck[] =
87, 88, 89, 90, 91, 92, 93, 94, 95, 96,
97, 98, 99, 100, 101, 102, 103, 104, 105, 106,
107, 108, 109, 110, 111, 112, 113, 114, 115, 116,
- 117, 118, 119, 120, 121, 122, 123, 124, -1, -1,
- -1, -1, 129, 130, 131, 132, 133, 134, 135, 136,
- -1, -1, 139, -1, -1, -1, -1, -1, -1, -1,
+ 117, 118, 119, 120, 121, 122, 123, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, 133, 134, 135, -1,
+ 137, 138, 139, 140, 141, 142, 143, 144, -1, -1,
+ 147, 148, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- 167, 168, 169, 170, 171, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, 186,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, 3, 4, 5,
- 6, 7, 8, 9, 10, 11, -1, 13, 14, 15,
- 16, 17, 18, 19, 20, 21, 22, 23, 24, 25,
- 26, 27, 28, 29, 30, 31, 32, 33, 34, 256,
- 36, 37, 38, 39, 40, 41, 42, 43, 44, 45,
- 46, 47, 48, 49, 50, 51, 52, 53, 54, 55,
- 56, 57, 58, 59, 60, 61, 62, 63, 64, 65,
- 66, 67, 68, 69, 70, 71, 72, 73, 74, 75,
- 76, 77, 78, 79, 80, 81, 82, 83, 84, 85,
- 86, 87, 88, 89, 90, 91, 92, 93, 94, 95,
- 96, 97, 98, 99, 100, 101, 102, 103, 104, 105,
- 106, 107, 108, 109, 110, 111, 112, 113, 114, 115,
- 116, 117, 118, 119, 120, 121, 122, 123, 124, -1,
- -1, -1, -1, 129, 130, 131, 132, 133, 134, 135,
- 136, 137, 138, 139, 140, 141, 142, 143, 144, 145,
- -1, -1, 148, 149, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, 167, 168, 169, 170, 171, -1, 173, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- 186, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, 5, 6, 7, 8, -1, 233, -1, -1, -1,
+ -1, -1, 239, 240, 241, 242, 20, 21, 22, 23,
+ 24, 25, 26, 27, 28, 29, 30, 31, 255, -1,
+ -1, -1, -1, -1, -1, -1, -1, 41, 42, 43,
+ 44, 45, 46, 47, 48, 49, 50, 51, 52, 53,
+ 54, 55, 56, 57, 58, 59, 60, 61, 62, 63,
+ 64, 65, 66, 67, 68, 69, 70, 71, 72, 73,
+ 74, 75, 76, 77, 78, 79, 80, 81, 82, 83,
+ 84, 85, 86, 87, 88, 89, 90, 91, 92, 93,
+ 94, 95, 96, 97, 98, 99, 100, 101, 102, 103,
+ 104, 105, 106, 107, 108, 109, 110, 111, 112, 113,
+ 114, 115, 116, 117, 118, 119, 120, 121, 122, 123,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, 133,
+ 134, 135, -1, 137, 138, 139, 140, 141, 142, 143,
+ 144, -1, -1, 147, 148, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, 233, -1, -1,
- -1, -1, -1, 239, 240, 241, 242, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, 254, 255,
- 3, 4, 5, 6, 7, 8, 9, 10, 11, -1,
- 13, 14, 15, 16, 17, -1, -1, 20, 21, 22,
- 23, 24, 25, 26, 27, 28, 29, 30, 31, 32,
- 33, 34, -1, 36, 37, 38, 39, 40, 41, 42,
- 43, 44, 45, 46, 47, 48, 49, 50, 51, 52,
- 53, 54, 55, 56, 57, 58, 59, 60, 61, 62,
- 63, 64, 65, 66, 67, 68, 69, 70, 71, 72,
- 73, 74, 75, 76, 77, 78, 79, 80, 81, 82,
- 83, 84, 85, 86, 87, 88, 89, 90, 91, 92,
- 93, 94, 95, 96, 97, 98, 99, 100, 101, 102,
- 103, 104, 105, 106, 107, 108, 109, 110, 111, 112,
- 113, 114, 115, 116, 117, 118, 119, 120, 121, 122,
- 123, 124, -1, -1, -1, -1, 129, 130, 131, 132,
- 133, 134, 135, 136, 137, 138, 139, 140, 141, 142,
- 143, 144, 145, -1, -1, 148, 149, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, 167, 168, 169, 170, 171, -1,
- 173, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, 186, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, 233,
+ -1, -1, -1, -1, -1, 239, 240, 241, 242, 3,
+ 4, 5, 6, 7, 8, -1, -1, -1, -1, -1,
+ 254, -1, -1, -1, -1, -1, 20, 21, 22, 23,
+ 24, 25, 26, 27, 28, 29, 30, 31, 32, 33,
+ 34, -1, 36, 37, 38, 39, 40, 41, 42, 43,
+ 44, 45, 46, 47, 48, 49, 50, 51, 52, 53,
+ 54, 55, 56, 57, 58, 59, 60, 61, 62, 63,
+ 64, 65, 66, 67, 68, 69, 70, 71, 72, 73,
+ 74, 75, 76, 77, 78, 79, 80, 81, 82, 83,
+ 84, 85, 86, 87, 88, 89, 90, 91, 92, 93,
+ 94, 95, 96, 97, 98, 99, 100, 101, 102, 103,
+ 104, 105, 106, 107, 108, 109, 110, 111, 112, 113,
+ 114, 115, 116, 117, 118, 119, 120, 121, 122, 123,
+ -1, -1, -1, -1, 128, 129, 130, 131, 132, 133,
+ 134, 135, -1, 137, 138, 139, 140, 141, 142, 143,
+ 144, -1, -1, 147, 148, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- 233, -1, -1, -1, -1, -1, 239, 240, 241, 242,
+ -1, -1, 166, 167, 168, 169, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, 254, 255, 3, 4, 5, 6, 7, 8, 9,
- 10, 11, -1, 13, 14, 15, 16, 17, -1, -1,
- 20, 21, 22, 23, 24, 25, 26, 27, 28, 29,
- 30, 31, 32, 33, 34, -1, 36, 37, 38, 39,
- 40, 41, 42, 43, 44, 45, 46, 47, 48, 49,
- 50, 51, 52, 53, 54, 55, 56, 57, 58, 59,
- 60, 61, 62, 63, 64, 65, 66, 67, 68, 69,
- 70, 71, 72, 73, 74, 75, 76, 77, 78, 79,
- 80, 81, 82, 83, 84, 85, 86, 87, 88, 89,
- 90, 91, 92, 93, 94, 95, 96, 97, 98, 99,
- 100, 101, 102, 103, 104, 105, 106, 107, 108, 109,
- 110, 111, 112, 113, 114, 115, 116, 117, 118, 119,
- 120, 121, 122, 123, 124, -1, -1, -1, -1, 129,
- 130, 131, 132, 133, 134, 135, 136, 137, 138, 139,
- 140, 141, 142, 143, 144, 145, -1, -1, 148, 149,
+ 184, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, 167, 168, 169,
- 170, 171, -1, 173, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, 186, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ 224, -1, -1, -1, 5, 6, 7, 8, -1, 233,
+ -1, -1, -1, -1, -1, 239, 240, 241, 242, 20,
+ 21, 22, 23, 24, 25, 26, 27, 28, 29, 30,
+ 31, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ 41, 42, 43, 44, 45, 46, 47, 48, 49, 50,
+ 51, 52, 53, 54, 55, 56, 57, 58, 59, 60,
+ 61, 62, 63, 64, 65, 66, 67, 68, 69, 70,
+ 71, 72, 73, 74, 75, 76, 77, 78, 79, 80,
+ 81, 82, 83, 84, 85, 86, 87, 88, 89, 90,
+ 91, 92, 93, 94, 95, 96, 97, 98, 99, 100,
+ 101, 102, 103, 104, 105, 106, 107, 108, 109, 110,
+ 111, 112, 113, 114, 115, 116, 117, 118, 119, 120,
+ 121, 122, 123, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, 133, 134, 135, -1, 137, 138, 139, 140,
+ 141, 142, 143, 144, -1, -1, 147, 148, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, 233, -1, -1, -1, -1, -1, 239,
- 240, 241, 242, 3, 4, 5, 6, 7, 8, -1,
- -1, -1, -1, -1, 254, 255, -1, -1, -1, -1,
- 20, 21, 22, 23, 24, 25, 26, 27, 28, 29,
- 30, 31, 32, 33, 34, -1, 36, 37, 38, 39,
- 40, 41, 42, 43, 44, 45, 46, 47, 48, 49,
- 50, 51, 52, 53, 54, 55, 56, 57, 58, 59,
- 60, 61, 62, 63, 64, 65, 66, 67, 68, 69,
- 70, 71, 72, 73, 74, 75, 76, 77, 78, 79,
- 80, 81, 82, 83, 84, 85, 86, 87, 88, 89,
- 90, 91, 92, 93, 94, 95, 96, 97, 98, 99,
- 100, 101, 102, 103, 104, 105, 106, 107, 108, 109,
- 110, 111, 112, 113, 114, 115, 116, 117, 118, 119,
- 120, 121, 122, 123, 124, -1, -1, -1, -1, 129,
- 130, 131, 132, 133, 134, 135, 136, -1, 138, 139,
- 140, 141, 142, 143, 144, 145, -1, -1, 148, 149,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, 167, 168, 169,
- 170, 171, -1, 173, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, 186, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, 233, -1, -1, -1, -1, -1, 239,
- 240, 241, 242, 5, 6, 7, 8, -1, -1, -1,
- -1, -1, -1, -1, 254, -1, -1, -1, 20, 21,
- 22, 23, 24, 25, 26, 27, 28, 29, 30, 31,
+ -1, -1, -1, -1, -1, -1, -1, 5, 6, 7,
+ 8, -1, 233, -1, -1, 236, -1, -1, 239, 240,
+ 241, 242, 20, 21, 22, 23, 24, 25, 26, 27,
+ 28, 29, 30, 31, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, 41, 42, 43, 44, 45, 46, 47,
+ 48, 49, 50, 51, 52, 53, 54, 55, 56, 57,
+ 58, 59, 60, 61, 62, 63, 64, 65, 66, 67,
+ 68, 69, 70, 71, 72, 73, 74, 75, 76, 77,
+ 78, 79, 80, 81, 82, 83, 84, 85, 86, 87,
+ 88, 89, 90, 91, 92, 93, 94, 95, 96, 97,
+ 98, 99, 100, 101, 102, 103, 104, 105, 106, 107,
+ 108, 109, 110, 111, 112, 113, 114, 115, 116, 117,
+ 118, 119, 120, 121, 122, 123, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, 133, 134, 135, -1, 137,
+ 138, 139, 140, 141, 142, 143, 144, -1, -1, 147,
+ 148, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ 5, 6, 7, 8, -1, 233, -1, -1, 236, -1,
+ -1, 239, 240, 241, 242, 20, 21, 22, 23, 24,
+ 25, 26, 27, 28, 29, 30, 31, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, 41, 42, 43, 44,
+ 45, 46, 47, 48, 49, 50, 51, 52, 53, 54,
+ 55, 56, 57, 58, 59, 60, 61, 62, 63, 64,
+ 65, 66, 67, 68, 69, 70, 71, 72, 73, 74,
+ 75, 76, 77, 78, 79, 80, 81, 82, 83, 84,
+ 85, 86, 87, 88, 89, 90, 91, 92, 93, 94,
+ 95, 96, 97, 98, 99, 100, 101, 102, 103, 104,
+ 105, 106, 107, 108, 109, 110, 111, 112, 113, 114,
+ 115, 116, 117, 118, 119, 120, 121, 122, 123, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, 133, 134,
+ 135, -1, 137, 138, 139, 140, 141, 142, 143, 144,
+ -1, -1, 147, 148, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, 5, 6, 7, 8, -1, 233, -1,
+ -1, -1, -1, -1, 239, 240, 241, 242, 20, 21,
+ 22, 23, 24, 25, 26, 27, 28, 29, 30, 31,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, 41,
42, 43, 44, 45, 46, 47, 48, 49, 50, 51,
52, 53, 54, 55, 56, 57, 58, 59, 60, 61,
62, 63, 64, 65, 66, 67, 68, 69, 70, 71,
@@ -1971,9 +2129,9 @@ static const yytype_int16 yycheck[] =
92, 93, 94, 95, 96, 97, 98, 99, 100, 101,
102, 103, 104, 105, 106, 107, 108, 109, 110, 111,
112, 113, 114, 115, 116, 117, 118, 119, 120, 121,
- 122, 123, 124, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, 134, 135, 136, -1, 138, 139, 140, 141,
- 142, 143, 144, 145, -1, -1, 148, 149, -1, -1,
+ 122, 123, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, 133, 134, 135, -1, 137, 138, 139, 140, 141,
+ 142, 143, 144, -1, -1, 147, 148, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
@@ -1984,8 +2142,8 @@ static const yytype_int16 yycheck[] =
-1, -1, -1, -1, -1, -1, 5, 6, 7, 8,
-1, 233, -1, -1, -1, -1, -1, 239, 240, 241,
242, 20, 21, 22, 23, 24, 25, 26, 27, 28,
- 29, 30, 31, 255, 256, -1, -1, -1, -1, -1,
- -1, -1, -1, 42, 43, 44, 45, 46, 47, 48,
+ 29, 30, 31, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, 41, 42, 43, 44, 45, 46, 47, 48,
49, 50, 51, 52, 53, 54, 55, 56, 57, 58,
59, 60, 61, 62, 63, 64, 65, 66, 67, 68,
69, 70, 71, 72, 73, 74, 75, 76, 77, 78,
@@ -1993,43 +2151,19 @@ static const yytype_int16 yycheck[] =
89, 90, 91, 92, 93, 94, 95, 96, 97, 98,
99, 100, 101, 102, 103, 104, 105, 106, 107, 108,
109, 110, 111, 112, 113, 114, 115, 116, 117, 118,
- 119, 120, 121, 122, 123, 124, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, 134, 135, 136, -1, 138,
- 139, 140, 141, 142, 143, 144, 145, -1, -1, 148,
- 149, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ 119, 120, 121, 122, 123, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, 133, 134, 135, -1, 137, 138,
+ 139, 140, 141, 142, 143, 144, -1, -1, 147, 148,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, 5,
+ -1, -1, -1, -1, -1, -1, -1, 3, 4, 5,
6, 7, 8, -1, 233, -1, -1, -1, -1, -1,
239, 240, 241, 242, 20, 21, 22, 23, 24, 25,
- 26, 27, 28, 29, 30, 31, 255, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, 42, 43, 44, 45,
- 46, 47, 48, 49, 50, 51, 52, 53, 54, 55,
- 56, 57, 58, 59, 60, 61, 62, 63, 64, 65,
- 66, 67, 68, 69, 70, 71, 72, 73, 74, 75,
- 76, 77, 78, 79, 80, 81, 82, 83, 84, 85,
- 86, 87, 88, 89, 90, 91, 92, 93, 94, 95,
- 96, 97, 98, 99, 100, 101, 102, 103, 104, 105,
- 106, 107, 108, 109, 110, 111, 112, 113, 114, 115,
- 116, 117, 118, 119, 120, 121, 122, 123, 124, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, 134, 135,
- 136, -1, 138, 139, 140, 141, 142, 143, 144, 145,
- -1, -1, 148, 149, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, 233, -1, -1,
- -1, -1, -1, 239, 240, 241, 242, 3, 4, 5,
- 6, 7, 8, -1, -1, -1, -1, -1, 254, -1,
- -1, -1, -1, -1, 20, 21, 22, 23, 24, 25,
26, 27, 28, 29, 30, 31, 32, 33, 34, -1,
36, 37, 38, 39, 40, 41, 42, 43, 44, 45,
46, 47, 48, 49, 50, 51, 52, 53, 54, 55,
@@ -2039,100 +2173,51 @@ static const yytype_int16 yycheck[] =
86, 87, 88, 89, 90, 91, 92, 93, 94, 95,
96, 97, 98, 99, 100, 101, 102, 103, 104, 105,
106, 107, 108, 109, 110, 111, 112, 113, 114, 115,
- 116, 117, 118, 119, 120, 121, 122, 123, 124, -1,
- -1, -1, -1, 129, 130, 131, 132, 133, 134, 135,
- 136, -1, 138, 139, 140, 141, 142, 143, 144, 145,
- -1, -1, 148, 149, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, 167, 168, 169, 170, 171, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- 186, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- 5, 6, 7, 8, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, 20, 21, 22, 23, 24,
- 25, 26, 27, 28, 29, 30, 31, 233, -1, -1,
- -1, -1, -1, 239, 240, 241, 242, 42, 43, 44,
- 45, 46, 47, 48, 49, 50, 51, 52, 53, 54,
- 55, 56, 57, 58, 59, 60, 61, 62, 63, 64,
- 65, 66, 67, 68, 69, 70, 71, 72, 73, 74,
- 75, 76, 77, 78, 79, 80, 81, 82, 83, 84,
- 85, 86, 87, 88, 89, 90, 91, 92, 93, 94,
- 95, 96, 97, 98, 99, 100, 101, 102, 103, 104,
- 105, 106, 107, 108, 109, 110, 111, 112, 113, 114,
- 115, 116, 117, 118, 119, 120, 121, 122, 123, 124,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, 134,
- 135, 136, -1, 138, 139, 140, 141, 142, 143, 144,
- 145, -1, -1, 148, 149, -1, -1, -1, -1, -1,
+ 116, 117, 118, 119, 120, 121, 122, 123, -1, -1,
+ -1, -1, 128, 129, 130, 131, 132, 133, 134, 135,
+ -1, -1, 138, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ 166, 167, 168, 169, -1, 171, -1, -1, -1, -1,
+ -1, -1, -1, 179, 180, 181, 182, 183, 184, -1,
+ -1, -1, -1, -1, -1, -1, 3, 4, 5, 6,
+ 7, 8, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, 20, 21, 22, 23, 24, 25, 26,
+ 27, 28, 29, 30, 31, 32, 33, 34, 224, 36,
+ 37, 38, 39, 40, 41, 42, 43, 44, 45, 46,
+ 47, 48, 49, 50, 51, 52, 53, 54, 55, 56,
+ 57, 58, 59, 60, 61, 62, 63, 64, 65, 66,
+ 67, 68, 69, 70, 71, 72, 73, 74, 75, 76,
+ 77, 78, 79, 80, 81, 82, 83, 84, 85, 86,
+ 87, 88, 89, 90, 91, 92, 93, 94, 95, 96,
+ 97, 98, 99, 100, 101, 102, 103, 104, 105, 106,
+ 107, 108, 109, 110, 111, 112, 113, 114, 115, 116,
+ 117, 118, 119, 120, 121, 122, 123, 3, 4, -1,
+ -1, 128, 129, 130, 131, 132, 133, 134, 135, -1,
+ -1, 138, -1, -1, -1, -1, 3, 4, -1, -1,
+ -1, -1, -1, -1, -1, -1, 32, 33, 34, -1,
+ 36, 37, 38, 39, 40, -1, -1, -1, -1, 166,
+ 167, 168, 169, -1, -1, 32, 33, 34, -1, 36,
+ 37, 38, 39, 40, -1, -1, -1, 184, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, 5, 6, 7, 8, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, 20, 21, 22, 23,
- 24, 25, 26, 27, 28, 29, 30, 31, 233, -1,
- -1, 236, -1, -1, 239, 240, 241, 242, 42, 43,
- 44, 45, 46, 47, 48, 49, 50, 51, 52, 53,
- 54, 55, 56, 57, 58, 59, 60, 61, 62, 63,
- 64, 65, 66, 67, 68, 69, 70, 71, 72, 73,
- 74, 75, 76, 77, 78, 79, 80, 81, 82, 83,
- 84, 85, 86, 87, 88, 89, 90, 91, 92, 93,
- 94, 95, 96, 97, 98, 99, 100, 101, 102, 103,
- 104, 105, 106, 107, 108, 109, 110, 111, 112, 113,
- 114, 115, 116, 117, 118, 119, 120, 121, 122, 123,
- 124, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- 134, 135, 136, -1, 138, 139, 140, 141, 142, 143,
- 144, 145, -1, -1, 148, 149, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, 5, 6, 7, 8, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, 20, 21, 22,
- 23, 24, 25, 26, 27, 28, 29, 30, 31, 233,
- -1, -1, 236, -1, -1, 239, 240, 241, 242, 42,
- 43, 44, 45, 46, 47, 48, 49, 50, 51, 52,
- 53, 54, 55, 56, 57, 58, 59, 60, 61, 62,
- 63, 64, 65, 66, 67, 68, 69, 70, 71, 72,
- 73, 74, 75, 76, 77, 78, 79, 80, 81, 82,
- 83, 84, 85, 86, 87, 88, 89, 90, 91, 92,
- 93, 94, 95, 96, 97, 98, 99, 100, 101, 102,
- 103, 104, 105, 106, 107, 108, 109, 110, 111, 112,
- 113, 114, 115, 116, 117, 118, 119, 120, 121, 122,
- 123, 124, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, 134, 135, 136, -1, 138, 139, 140, 141, 142,
- 143, 144, 145, -1, -1, 148, 149, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, 5, 6, 7, 8, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, 20, 21,
- 22, 23, 24, 25, 26, 27, 28, 29, 30, 31,
- 233, -1, -1, -1, -1, -1, 239, 240, 241, 242,
- 42, 43, 44, 45, 46, 47, 48, 49, 50, 51,
- 52, 53, 54, 55, 56, 57, 58, 59, 60, 61,
- 62, 63, 64, 65, 66, 67, 68, 69, 70, 71,
- 72, 73, 74, 75, 76, 77, 78, 79, 80, 81,
- 82, 83, 84, 85, 86, 87, 88, 89, 90, 91,
- 92, 93, 94, 95, 96, 97, 98, 99, 100, 101,
- 102, 103, 104, 105, 106, 107, 108, 109, 110, 111,
- 112, 113, 114, 115, 116, 117, 118, 119, 120, 121,
- 122, 123, 124, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, 134, 135, 136, -1, 138, 139, 140, 141,
- 142, 143, 144, 145, -1, -1, 148, 149, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, 224, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, 128, 129, 130, 131, 132, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, 128, 129, 130, 131, 132, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ 166, 167, 168, 169, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, 184, 166,
+ 167, 168, 169, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, 184, -1, -1,
-1, -1, -1, -1, 5, 6, 7, 8, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, 20,
+ -1, -1, -1, -1, -1, -1, -1, -1, 224, 20,
21, 22, 23, 24, 25, 26, 27, 28, 29, 30,
- 31, 233, -1, -1, -1, -1, -1, 239, 240, 241,
- 242, 42, 43, 44, 45, 46, 47, 48, 49, 50,
+ 31, -1, -1, -1, -1, -1, -1, 224, -1, -1,
+ 41, 42, 43, 44, 45, 46, 47, 48, 49, 50,
51, 52, 53, 54, 55, 56, 57, 58, 59, 60,
61, 62, 63, 64, 65, 66, 67, 68, 69, 70,
71, 72, 73, 74, 75, 76, 77, 78, 79, 80,
@@ -2140,104 +2225,16 @@ static const yytype_int16 yycheck[] =
91, 92, 93, 94, 95, 96, 97, 98, 99, 100,
101, 102, 103, 104, 105, 106, 107, 108, 109, 110,
111, 112, 113, 114, 115, 116, 117, 118, 119, 120,
- 121, 122, 123, 124, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, 134, 135, 136, -1, 138, 139, 140,
- 141, 142, 143, 144, 145, -1, -1, 148, 149, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, 3, 4, 5, 6, 7,
- 8, -1, 233, -1, -1, -1, -1, -1, 239, 240,
- 241, 242, 20, 21, 22, 23, 24, 25, 26, 27,
- 28, 29, 30, 31, 32, 33, 34, -1, 36, 37,
- 38, 39, 40, 41, 42, 43, 44, 45, 46, 47,
- 48, 49, 50, 51, 52, 53, 54, 55, 56, 57,
- 58, 59, 60, 61, 62, 63, 64, 65, 66, 67,
- 68, 69, 70, 71, 72, 73, 74, 75, 76, 77,
- 78, 79, 80, 81, 82, 83, 84, 85, 86, 87,
- 88, 89, 90, 91, 92, 93, 94, 95, 96, 97,
- 98, 99, 100, 101, 102, 103, 104, 105, 106, 107,
- 108, 109, 110, 111, 112, 113, 114, 115, 116, 117,
- 118, 119, 120, 121, 122, 123, 124, -1, -1, -1,
- -1, 129, 130, 131, 132, 133, 134, 135, 136, -1,
- -1, 139, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, 167,
- 168, 169, 170, 171, -1, 173, -1, 175, -1, -1,
- -1, -1, -1, 181, 182, 183, 184, 185, 186, 3,
- 4, 5, 6, 7, 8, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, 20, 21, 22, 23,
- 24, 25, 26, 27, 28, 29, 30, 31, 32, 33,
- 34, -1, 36, 37, 38, 39, 40, 41, 42, 43,
- 44, 45, 46, 47, 48, 49, 50, 51, 52, 53,
- 54, 55, 56, 57, 58, 59, 60, 61, 62, 63,
- 64, 65, 66, 67, 68, 69, 70, 71, 72, 73,
- 74, 75, 76, 77, 78, 79, 80, 81, 82, 83,
- 84, 85, 86, 87, 88, 89, 90, 91, 92, 93,
- 94, 95, 96, 97, 98, 99, 100, 101, 102, 103,
- 104, 105, 106, 107, 108, 109, 110, 111, 112, 113,
- 114, 115, 116, 117, 118, 119, 120, 121, 122, 123,
- 124, -1, -1, -1, -1, 129, 130, 131, 132, 133,
- 134, 135, 136, -1, -1, 139, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, 167, 168, 169, 170, 171, -1, 173,
- 3, 4, 5, 6, 7, 8, -1, 181, 182, 183,
- 184, 185, 186, -1, -1, -1, -1, 20, 21, 22,
- 23, 24, 25, 26, 27, 28, 29, 30, 31, 32,
- 33, 34, -1, 36, 37, 38, 39, 40, 41, 42,
- 43, 44, 45, 46, 47, 48, 49, 50, 51, 52,
- 53, 54, 55, 56, 57, 58, 59, 60, 61, 62,
- 63, 64, 65, 66, 67, 68, 69, 70, 71, 72,
- 73, 74, 75, 76, 77, 78, 79, 80, 81, 82,
- 83, 84, 85, 86, 87, 88, 89, 90, 91, 92,
- 93, 94, 95, 96, 97, 98, 99, 100, 101, 102,
- 103, 104, 105, 106, 107, 108, 109, 110, 111, 112,
- 113, 114, 115, 116, 117, 118, 119, 120, 121, 122,
- 123, 124, 3, 4, -1, -1, 129, 130, 131, 132,
- 133, 134, 135, 136, -1, -1, 139, -1, -1, -1,
- -1, -1, 3, 4, -1, -1, -1, -1, -1, -1,
- -1, 32, 33, 34, -1, 36, 37, 38, 39, 40,
- 41, -1, -1, -1, 167, 168, 169, 170, 171, -1,
- -1, 32, 33, 34, -1, 36, 37, 38, 39, 40,
- 41, -1, -1, 186, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, 129, 130,
- 131, 132, 133, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, 129, 130,
- 131, 132, 133, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, 167, 168, 169, 170,
- 171, -1, -1, -1, -1, -1, 5, 6, 7, 8,
- -1, -1, -1, -1, -1, 186, 167, 168, 169, 170,
- 171, 20, 21, 22, 23, 24, 25, 26, 27, 28,
- 29, 30, 31, -1, -1, 186, -1, -1, -1, -1,
- -1, -1, -1, 42, 43, 44, 45, 46, 47, 48,
- 49, 50, 51, 52, 53, 54, 55, 56, 57, 58,
- 59, 60, 61, 62, 63, 64, 65, 66, 67, 68,
- 69, 70, 71, 72, 73, 74, 75, 76, 77, 78,
- 79, 80, 81, 82, 83, 84, 85, 86, 87, 88,
- 89, 90, 91, 92, 93, 94, 95, 96, 97, 98,
- 99, 100, 101, 102, 103, 104, 105, 106, 107, 108,
- 109, 110, 111, 112, 113, 114, 115, 116, 117, 118,
- 119, 120, 121, 122, 123, 124, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, 134, 135, 136, -1, -1,
- 139
+ 121, 122, 123, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, 133, 134, 135, -1, -1, 138
};
/* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
symbol of state STATE-NUM. */
static const yytype_uint16 yystos[] =
{
- 0, 174, 258, 260, 142, 0, 262, 138, 139, 140,
- 178, 263, 175, 259, 264, 178, 263, 3, 4, 5,
+ 0, 172, 258, 260, 141, 0, 262, 137, 138, 139,
+ 176, 263, 173, 259, 264, 176, 263, 3, 4, 5,
6, 7, 8, 20, 21, 22, 23, 24, 25, 26,
27, 28, 29, 30, 31, 32, 33, 34, 36, 37,
38, 39, 40, 41, 42, 43, 44, 45, 46, 47,
@@ -2248,48 +2245,48 @@ static const yytype_uint16 yystos[] =
88, 89, 90, 91, 92, 93, 94, 95, 96, 97,
98, 99, 100, 101, 102, 103, 104, 105, 106, 107,
108, 109, 110, 111, 112, 113, 114, 115, 116, 117,
- 118, 119, 120, 121, 122, 123, 124, 129, 130, 131,
- 132, 133, 134, 135, 136, 139, 167, 168, 169, 170,
- 171, 173, 181, 182, 183, 184, 185, 186, 261, 265,
- 299, 300, 301, 302, 303, 309, 310, 311, 312, 317,
- 318, 319, 320, 322, 323, 324, 325, 326, 356, 357,
- 358, 359, 360, 364, 177, 255, 263, 33, 34, 36,
- 138, 140, 167, 168, 266, 312, 318, 266, 318, 325,
- 178, 178, 178, 178, 178, 233, 264, 356, 254, 255,
- 339, 234, 238, 4, 33, 34, 35, 168, 305, 306,
- 307, 325, 238, 254, 138, 140, 263, 266, 33, 34,
- 36, 318, 359, 318, 322, 318, 318, 235, 321, 318,
- 140, 263, 311, 327, 328, 255, 322, 194, 231, 263,
- 313, 315, 316, 9, 10, 11, 13, 14, 15, 16,
- 17, 137, 141, 142, 143, 144, 145, 148, 149, 233,
- 239, 240, 241, 242, 254, 255, 256, 266, 267, 268,
- 270, 271, 272, 273, 274, 275, 276, 281, 282, 283,
- 284, 285, 286, 287, 288, 289, 290, 291, 292, 293,
- 294, 295, 297, 299, 300, 312, 322, 333, 334, 335,
- 336, 340, 341, 342, 345, 351, 355, 305, 306, 306,
- 304, 308, 322, 306, 306, 263, 253, 321, 233, 254,
- 254, 254, 236, 281, 294, 298, 322, 235, 255, 178,
- 263, 329, 330, 256, 328, 327, 254, 253, 234, 238,
- 254, 254, 334, 233, 233, 254, 254, 297, 233, 233,
- 281, 281, 297, 256, 337, 148, 149, 235, 237, 234,
- 234, 238, 136, 295, 233, 157, 158, 159, 160, 161,
- 162, 163, 164, 165, 166, 253, 296, 281, 243, 244,
- 245, 239, 240, 146, 147, 150, 151, 246, 247, 152,
- 153, 248, 249, 250, 154, 156, 155, 251, 238, 254,
- 256, 334, 263, 253, 321, 255, 295, 331, 253, 236,
- 236, 298, 311, 362, 363, 321, 238, 254, 256, 142,
- 143, 314, 315, 137, 333, 341, 352, 297, 254, 297,
- 297, 311, 344, 234, 340, 269, 297, 263, 266, 277,
- 278, 279, 280, 295, 295, 281, 281, 281, 283, 283,
- 284, 284, 285, 285, 285, 285, 286, 286, 287, 288,
- 289, 290, 291, 292, 297, 295, 321, 331, 253, 331,
- 332, 331, 236, 329, 256, 362, 330, 233, 344, 353,
- 354, 234, 234, 263, 234, 256, 236, 233, 234, 234,
- 238, 136, 295, 252, 331, 238, 256, 254, 140, 361,
- 297, 254, 234, 334, 343, 255, 346, 253, 335, 338,
- 339, 295, 295, 256, 331, 321, 254, 234, 297, 338,
- 12, 18, 19, 256, 347, 348, 349, 350, 331, 254,
- 334, 297, 252, 334, 347, 334, 256, 349, 252
+ 118, 119, 120, 121, 122, 123, 128, 129, 130, 131,
+ 132, 133, 134, 135, 138, 166, 167, 168, 169, 171,
+ 179, 180, 181, 182, 183, 184, 224, 261, 265, 299,
+ 300, 301, 302, 303, 309, 310, 311, 312, 317, 318,
+ 319, 320, 322, 323, 324, 325, 326, 356, 357, 358,
+ 359, 360, 364, 175, 255, 263, 33, 34, 36, 137,
+ 139, 166, 266, 312, 318, 325, 176, 176, 176, 176,
+ 176, 233, 356, 254, 255, 339, 234, 238, 4, 33,
+ 34, 35, 305, 306, 307, 325, 238, 254, 137, 139,
+ 263, 266, 33, 34, 36, 318, 359, 318, 322, 318,
+ 318, 235, 321, 318, 139, 263, 311, 327, 328, 255,
+ 322, 192, 231, 263, 313, 315, 316, 9, 10, 11,
+ 13, 14, 15, 16, 17, 136, 140, 141, 142, 143,
+ 144, 147, 148, 233, 239, 240, 241, 242, 254, 255,
+ 256, 266, 267, 268, 270, 271, 272, 273, 274, 275,
+ 276, 281, 282, 283, 284, 285, 286, 287, 288, 289,
+ 290, 291, 292, 293, 294, 295, 297, 299, 300, 312,
+ 322, 333, 334, 335, 336, 340, 341, 342, 345, 351,
+ 355, 305, 306, 304, 308, 322, 306, 306, 263, 253,
+ 321, 233, 254, 254, 254, 236, 281, 294, 298, 322,
+ 235, 255, 176, 263, 329, 330, 256, 328, 327, 254,
+ 253, 234, 238, 254, 254, 334, 233, 233, 254, 254,
+ 297, 233, 233, 281, 281, 297, 256, 337, 147, 148,
+ 235, 237, 234, 234, 238, 135, 295, 233, 156, 157,
+ 158, 159, 160, 161, 162, 163, 164, 165, 253, 296,
+ 281, 243, 244, 245, 239, 240, 145, 146, 149, 150,
+ 246, 247, 151, 152, 248, 249, 250, 153, 155, 154,
+ 251, 238, 254, 256, 334, 263, 253, 321, 255, 295,
+ 331, 253, 236, 236, 298, 311, 362, 363, 321, 238,
+ 254, 256, 141, 142, 314, 315, 136, 333, 341, 352,
+ 297, 254, 297, 297, 311, 344, 234, 340, 269, 297,
+ 263, 266, 277, 278, 279, 280, 295, 295, 281, 281,
+ 281, 283, 283, 284, 284, 285, 285, 285, 285, 286,
+ 286, 287, 288, 289, 290, 291, 292, 297, 295, 321,
+ 331, 253, 331, 332, 331, 236, 329, 256, 362, 330,
+ 233, 344, 353, 354, 234, 234, 263, 234, 256, 236,
+ 233, 234, 234, 238, 135, 295, 252, 331, 238, 256,
+ 254, 139, 361, 297, 254, 234, 334, 343, 255, 346,
+ 253, 335, 338, 339, 295, 295, 256, 331, 321, 254,
+ 234, 297, 338, 12, 18, 19, 256, 347, 348, 349,
+ 350, 331, 254, 334, 297, 252, 334, 347, 334, 256,
+ 349, 252
};
/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
@@ -2297,24 +2294,24 @@ static const yytype_uint16 yyr1[] =
{
0, 257, 259, 258, 260, 260, 260, 261, 261, 261,
261, 261, 262, 262, 263, 263, 263, 264, 265, 265,
- 265, 266, 266, 267, 267, 267, 267, 267, 267, 268,
- 268, 268, 268, 268, 268, 269, 270, 271, 271, 272,
- 272, 273, 273, 274, 274, 275, 276, 276, 276, 277,
- 277, 278, 278, 279, 279, 280, 281, 281, 281, 281,
- 282, 282, 282, 282, 283, 283, 283, 283, 284, 284,
- 284, 285, 285, 285, 286, 286, 286, 286, 286, 287,
- 287, 287, 288, 288, 289, 289, 290, 290, 291, 291,
- 292, 292, 293, 293, 294, 294, 295, 295, 296, 296,
- 296, 296, 296, 296, 296, 296, 296, 296, 296, 297,
- 297, 298, 299, 299, 299, 299, 300, 301, 301, 302,
- 302, 303, 304, 304, 305, 305, 306, 306, 306, 306,
- 306, 307, 307, 307, 308, 309, 309, 309, 309, 309,
- 310, 310, 310, 310, 310, 310, 310, 311, 311, 312,
- 313, 313, 314, 314, 315, 315, 315, 316, 316, 317,
- 317, 317, 318, 318, 318, 318, 318, 318, 318, 318,
- 318, 318, 318, 318, 318, 318, 319, 319, 320, 320,
- 320, 320, 320, 320, 320, 320, 320, 320, 320, 321,
- 321, 321, 321, 322, 322, 323, 323, 323, 324, 324,
+ 266, 266, 267, 267, 267, 267, 267, 267, 268, 268,
+ 268, 268, 268, 268, 269, 270, 271, 271, 272, 272,
+ 273, 273, 274, 274, 275, 276, 276, 276, 277, 277,
+ 278, 278, 279, 279, 280, 281, 281, 281, 281, 282,
+ 282, 282, 282, 283, 283, 283, 283, 284, 284, 284,
+ 285, 285, 285, 286, 286, 286, 286, 286, 287, 287,
+ 287, 288, 288, 289, 289, 290, 290, 291, 291, 292,
+ 292, 293, 293, 294, 294, 295, 295, 296, 296, 296,
+ 296, 296, 296, 296, 296, 296, 296, 296, 297, 297,
+ 298, 299, 299, 299, 299, 300, 301, 301, 302, 302,
+ 303, 304, 304, 305, 305, 306, 306, 306, 306, 307,
+ 307, 307, 308, 309, 309, 309, 309, 309, 310, 310,
+ 310, 310, 310, 310, 311, 311, 312, 313, 313, 314,
+ 314, 315, 315, 315, 316, 316, 317, 317, 317, 318,
+ 318, 318, 318, 318, 318, 318, 318, 318, 318, 318,
+ 318, 319, 319, 320, 320, 320, 320, 320, 320, 320,
+ 320, 320, 320, 320, 321, 321, 321, 321, 322, 322,
+ 323, 323, 323, 324, 324, 324, 324, 324, 324, 324,
324, 324, 324, 324, 324, 324, 324, 324, 324, 324,
324, 324, 324, 324, 324, 324, 324, 324, 324, 324,
324, 324, 324, 324, 324, 324, 324, 324, 324, 324,
@@ -2324,16 +2321,16 @@ static const yytype_uint16 yyr1[] =
324, 324, 324, 324, 324, 324, 324, 324, 324, 324,
324, 324, 324, 324, 324, 324, 324, 324, 324, 324,
324, 324, 324, 324, 324, 324, 324, 324, 324, 324,
- 324, 324, 324, 324, 324, 324, 324, 324, 324, 325,
- 325, 325, 326, 326, 327, 327, 328, 329, 329, 330,
- 330, 331, 331, 331, 332, 332, 333, 334, 334, 335,
- 335, 335, 335, 335, 335, 336, 337, 336, 338, 338,
- 339, 339, 340, 340, 341, 341, 342, 343, 343, 344,
- 344, 345, 346, 346, 347, 347, 348, 348, 349, 349,
- 350, 350, 351, 351, 351, 352, 352, 353, 353, 354,
- 354, 355, 355, 355, 355, 355, 356, 356, 356, 356,
- 357, 358, 358, 359, 360, 360, 360, 361, 361, 361,
- 362, 362, 363, 364, 364, 364
+ 324, 324, 324, 324, 325, 325, 325, 326, 326, 327,
+ 327, 328, 329, 329, 330, 330, 331, 331, 331, 332,
+ 332, 333, 334, 334, 335, 335, 335, 335, 335, 335,
+ 336, 337, 336, 338, 338, 339, 339, 340, 340, 341,
+ 341, 342, 343, 343, 344, 344, 345, 346, 346, 347,
+ 347, 348, 348, 349, 349, 350, 350, 351, 351, 351,
+ 352, 352, 353, 353, 354, 354, 355, 355, 355, 355,
+ 355, 356, 356, 356, 356, 357, 358, 358, 359, 360,
+ 360, 360, 361, 361, 361, 362, 362, 363, 364, 364,
+ 364
};
/* YYR2[YYN] -- Number of symbols on the right hand side of rule YYN. */
@@ -2341,24 +2338,23 @@ static const yytype_uint8 yyr2[] =
{
0, 2, 0, 4, 0, 3, 4, 2, 2, 2,
2, 2, 0, 2, 1, 1, 1, 5, 1, 2,
- 2, 1, 1, 1, 1, 1, 1, 1, 3, 1,
- 4, 1, 3, 2, 2, 1, 1, 1, 3, 2,
- 2, 2, 1, 2, 3, 2, 1, 1, 1, 2,
- 2, 2, 1, 2, 3, 2, 1, 2, 2, 2,
- 1, 1, 1, 1, 1, 3, 3, 3, 1, 3,
- 3, 1, 3, 3, 1, 3, 3, 3, 3, 1,
- 3, 3, 1, 3, 1, 3, 1, 3, 1, 3,
- 1, 3, 1, 3, 1, 5, 1, 3, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 3, 1, 2, 2, 4, 1, 2, 1, 1, 2,
- 3, 3, 2, 3, 2, 2, 0, 2, 2, 2,
- 2, 1, 1, 1, 1, 1, 3, 4, 6, 5,
- 1, 2, 3, 5, 4, 2, 2, 1, 2, 4,
- 1, 3, 1, 1, 1, 3, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 2,
- 2, 2, 2, 2, 2, 2, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 2,
- 3, 3, 4, 1, 2, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 3, 1, 4,
+ 1, 3, 2, 2, 1, 1, 1, 3, 2, 2,
+ 2, 1, 2, 3, 2, 1, 1, 1, 2, 2,
+ 2, 1, 2, 3, 2, 1, 2, 2, 2, 1,
+ 1, 1, 1, 1, 3, 3, 3, 1, 3, 3,
+ 1, 3, 3, 1, 3, 3, 3, 3, 1, 3,
+ 3, 1, 3, 1, 3, 1, 3, 1, 3, 1,
+ 3, 1, 3, 1, 5, 1, 3, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 3,
+ 1, 2, 2, 4, 1, 2, 1, 1, 2, 3,
+ 3, 2, 3, 2, 2, 0, 2, 2, 2, 1,
+ 1, 1, 1, 1, 3, 4, 6, 5, 1, 2,
+ 3, 5, 4, 2, 1, 2, 4, 1, 3, 1,
+ 1, 1, 3, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 2, 2, 2, 2, 2,
+ 2, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 2, 3, 3, 4, 1, 2,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
@@ -2369,15 +2365,16 @@ static const yytype_uint8 yyr2[] =
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 5, 4, 1, 2, 3, 1, 3, 1,
- 2, 1, 3, 4, 1, 3, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 2, 0, 4, 1, 1,
- 2, 3, 1, 2, 1, 2, 5, 3, 1, 1,
- 4, 5, 2, 3, 3, 2, 1, 2, 2, 2,
- 1, 2, 5, 7, 6, 1, 1, 1, 0, 2,
- 3, 2, 2, 2, 3, 2, 1, 1, 1, 1,
- 2, 1, 2, 7, 1, 1, 1, 0, 1, 2,
- 1, 2, 3, 3, 3, 3
+ 1, 1, 1, 1, 1, 1, 1, 5, 4, 1,
+ 2, 3, 1, 3, 1, 2, 1, 3, 4, 1,
+ 3, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 2, 0, 4, 1, 1, 2, 3, 1, 2, 1,
+ 2, 5, 3, 1, 1, 4, 5, 2, 3, 3,
+ 2, 1, 2, 2, 2, 1, 2, 5, 7, 6,
+ 1, 1, 1, 0, 2, 3, 2, 2, 2, 3,
+ 2, 1, 1, 1, 1, 2, 1, 2, 7, 1,
+ 1, 1, 0, 1, 2, 1, 2, 3, 3, 3,
+ 3
};
@@ -2971,7 +2968,7 @@ YYLTYPE yylloc = yyloc_default;
yychar = YYEMPTY; /* Cause a token to be read. */
/* User initialization code. */
-#line 83 "glsl_parser.yy" /* yacc.c:1429 */
+#line 80 "glsl_parser.yy" /* yacc.c:1429 */
{
yylloc.first_line = 1;
yylloc.first_column = 1;
@@ -2980,7 +2977,7 @@ YYLTYPE yylloc = yyloc_default;
yylloc.source = 0;
}
-#line 2984 "glsl_parser.cpp" /* yacc.c:1429 */
+#line 2981 "glsl_parser.cpp" /* yacc.c:1429 */
yylsp[0] = yylloc;
goto yysetstate;
@@ -3167,47 +3164,47 @@ yyreduce:
switch (yyn)
{
case 2:
-#line 298 "glsl_parser.yy" /* yacc.c:1646 */
+#line 295 "glsl_parser.yy" /* yacc.c:1646 */
{
_mesa_glsl_initialize_types(state);
}
-#line 3175 "glsl_parser.cpp" /* yacc.c:1646 */
+#line 3172 "glsl_parser.cpp" /* yacc.c:1646 */
break;
case 3:
-#line 302 "glsl_parser.yy" /* yacc.c:1646 */
+#line 299 "glsl_parser.yy" /* yacc.c:1646 */
{
delete state->symbols;
state->symbols = new(ralloc_parent(state)) glsl_symbol_table;
_mesa_glsl_initialize_types(state);
}
-#line 3185 "glsl_parser.cpp" /* yacc.c:1646 */
+#line 3182 "glsl_parser.cpp" /* yacc.c:1646 */
break;
case 5:
-#line 312 "glsl_parser.yy" /* yacc.c:1646 */
+#line 309 "glsl_parser.yy" /* yacc.c:1646 */
{
state->process_version_directive(&(yylsp[-1]), (yyvsp[-1].n), NULL);
if (state->error) {
YYERROR;
}
}
-#line 3196 "glsl_parser.cpp" /* yacc.c:1646 */
+#line 3193 "glsl_parser.cpp" /* yacc.c:1646 */
break;
case 6:
-#line 319 "glsl_parser.yy" /* yacc.c:1646 */
+#line 316 "glsl_parser.yy" /* yacc.c:1646 */
{
state->process_version_directive(&(yylsp[-2]), (yyvsp[-2].n), (yyvsp[-1].identifier));
if (state->error) {
YYERROR;
}
}
-#line 3207 "glsl_parser.cpp" /* yacc.c:1646 */
+#line 3204 "glsl_parser.cpp" /* yacc.c:1646 */
break;
case 11:
-#line 333 "glsl_parser.yy" /* yacc.c:1646 */
+#line 330 "glsl_parser.yy" /* yacc.c:1646 */
{
if (!state->is_version(120, 100)) {
_mesa_glsl_warning(& (yylsp[-1]), state,
@@ -3218,21 +3215,21 @@ yyreduce:
state->all_invariant = true;
}
}
-#line 3222 "glsl_parser.cpp" /* yacc.c:1646 */
+#line 3219 "glsl_parser.cpp" /* yacc.c:1646 */
break;
case 17:
-#line 358 "glsl_parser.yy" /* yacc.c:1646 */
+#line 355 "glsl_parser.yy" /* yacc.c:1646 */
{
if (!_mesa_glsl_process_extension((yyvsp[-3].identifier), & (yylsp[-3]), (yyvsp[-1].identifier), & (yylsp[-1]), state)) {
YYERROR;
}
}
-#line 3232 "glsl_parser.cpp" /* yacc.c:1646 */
+#line 3229 "glsl_parser.cpp" /* yacc.c:1646 */
break;
case 18:
-#line 367 "glsl_parser.yy" /* yacc.c:1646 */
+#line 364 "glsl_parser.yy" /* yacc.c:1646 */
{
/* FINISHME: The NULL test is required because pragmas are set to
* FINISHME: NULL. (See production rule for external_declaration.)
@@ -3240,11 +3237,11 @@ yyreduce:
if ((yyvsp[0].node) != NULL)
state->translation_unit.push_tail(& (yyvsp[0].node)->link);
}
-#line 3244 "glsl_parser.cpp" /* yacc.c:1646 */
+#line 3241 "glsl_parser.cpp" /* yacc.c:1646 */
break;
case 19:
-#line 375 "glsl_parser.yy" /* yacc.c:1646 */
+#line 372 "glsl_parser.yy" /* yacc.c:1646 */
{
/* FINISHME: The NULL test is required because pragmas are set to
* FINISHME: NULL. (See production rule for external_declaration.)
@@ -3252,176 +3249,163 @@ yyreduce:
if ((yyvsp[0].node) != NULL)
state->translation_unit.push_tail(& (yyvsp[0].node)->link);
}
-#line 3256 "glsl_parser.cpp" /* yacc.c:1646 */
+#line 3253 "glsl_parser.cpp" /* yacc.c:1646 */
break;
- case 20:
-#line 382 "glsl_parser.yy" /* yacc.c:1646 */
- {
- if (!state->allow_extension_directive_midshader) {
- _mesa_glsl_error(& (yylsp[0]), state,
- "#extension directive is not allowed "
- "in the middle of a shader");
- YYERROR;
- }
- }
-#line 3269 "glsl_parser.cpp" /* yacc.c:1646 */
- break;
-
- case 23:
-#line 399 "glsl_parser.yy" /* yacc.c:1646 */
+ case 22:
+#line 388 "glsl_parser.yy" /* yacc.c:1646 */
{
void *ctx = state;
(yyval.expression) = new(ctx) ast_expression(ast_identifier, NULL, NULL, NULL);
(yyval.expression)->set_location((yylsp[0]));
(yyval.expression)->primary_expression.identifier = (yyvsp[0].identifier);
}
-#line 3280 "glsl_parser.cpp" /* yacc.c:1646 */
+#line 3264 "glsl_parser.cpp" /* yacc.c:1646 */
break;
- case 24:
-#line 406 "glsl_parser.yy" /* yacc.c:1646 */
+ case 23:
+#line 395 "glsl_parser.yy" /* yacc.c:1646 */
{
void *ctx = state;
(yyval.expression) = new(ctx) ast_expression(ast_int_constant, NULL, NULL, NULL);
(yyval.expression)->set_location((yylsp[0]));
(yyval.expression)->primary_expression.int_constant = (yyvsp[0].n);
}
-#line 3291 "glsl_parser.cpp" /* yacc.c:1646 */
+#line 3275 "glsl_parser.cpp" /* yacc.c:1646 */
break;
- case 25:
-#line 413 "glsl_parser.yy" /* yacc.c:1646 */
+ case 24:
+#line 402 "glsl_parser.yy" /* yacc.c:1646 */
{
void *ctx = state;
(yyval.expression) = new(ctx) ast_expression(ast_uint_constant, NULL, NULL, NULL);
(yyval.expression)->set_location((yylsp[0]));
(yyval.expression)->primary_expression.uint_constant = (yyvsp[0].n);
}
-#line 3302 "glsl_parser.cpp" /* yacc.c:1646 */
+#line 3286 "glsl_parser.cpp" /* yacc.c:1646 */
break;
- case 26:
-#line 420 "glsl_parser.yy" /* yacc.c:1646 */
+ case 25:
+#line 409 "glsl_parser.yy" /* yacc.c:1646 */
{
void *ctx = state;
(yyval.expression) = new(ctx) ast_expression(ast_float_constant, NULL, NULL, NULL);
(yyval.expression)->set_location((yylsp[0]));
(yyval.expression)->primary_expression.float_constant = (yyvsp[0].real);
}
-#line 3313 "glsl_parser.cpp" /* yacc.c:1646 */
+#line 3297 "glsl_parser.cpp" /* yacc.c:1646 */
break;
- case 27:
-#line 427 "glsl_parser.yy" /* yacc.c:1646 */
+ case 26:
+#line 416 "glsl_parser.yy" /* yacc.c:1646 */
{
void *ctx = state;
(yyval.expression) = new(ctx) ast_expression(ast_bool_constant, NULL, NULL, NULL);
(yyval.expression)->set_location((yylsp[0]));
(yyval.expression)->primary_expression.bool_constant = (yyvsp[0].n);
}
-#line 3324 "glsl_parser.cpp" /* yacc.c:1646 */
+#line 3308 "glsl_parser.cpp" /* yacc.c:1646 */
break;
- case 28:
-#line 434 "glsl_parser.yy" /* yacc.c:1646 */
+ case 27:
+#line 423 "glsl_parser.yy" /* yacc.c:1646 */
{
(yyval.expression) = (yyvsp[-1].expression);
}
-#line 3332 "glsl_parser.cpp" /* yacc.c:1646 */
+#line 3316 "glsl_parser.cpp" /* yacc.c:1646 */
break;
- case 30:
-#line 442 "glsl_parser.yy" /* yacc.c:1646 */
+ case 29:
+#line 431 "glsl_parser.yy" /* yacc.c:1646 */
{
void *ctx = state;
(yyval.expression) = new(ctx) ast_expression(ast_array_index, (yyvsp[-3].expression), (yyvsp[-1].expression), NULL);
(yyval.expression)->set_location_range((yylsp[-3]), (yylsp[0]));
}
-#line 3342 "glsl_parser.cpp" /* yacc.c:1646 */
+#line 3326 "glsl_parser.cpp" /* yacc.c:1646 */
break;
- case 31:
-#line 448 "glsl_parser.yy" /* yacc.c:1646 */
+ case 30:
+#line 437 "glsl_parser.yy" /* yacc.c:1646 */
{
(yyval.expression) = (yyvsp[0].expression);
}
-#line 3350 "glsl_parser.cpp" /* yacc.c:1646 */
+#line 3334 "glsl_parser.cpp" /* yacc.c:1646 */
break;
- case 32:
-#line 452 "glsl_parser.yy" /* yacc.c:1646 */
+ case 31:
+#line 441 "glsl_parser.yy" /* yacc.c:1646 */
{
void *ctx = state;
(yyval.expression) = new(ctx) ast_expression(ast_field_selection, (yyvsp[-2].expression), NULL, NULL);
(yyval.expression)->set_location_range((yylsp[-2]), (yylsp[0]));
(yyval.expression)->primary_expression.identifier = (yyvsp[0].identifier);
}
-#line 3361 "glsl_parser.cpp" /* yacc.c:1646 */
+#line 3345 "glsl_parser.cpp" /* yacc.c:1646 */
break;
- case 33:
-#line 459 "glsl_parser.yy" /* yacc.c:1646 */
+ case 32:
+#line 448 "glsl_parser.yy" /* yacc.c:1646 */
{
void *ctx = state;
(yyval.expression) = new(ctx) ast_expression(ast_post_inc, (yyvsp[-1].expression), NULL, NULL);
(yyval.expression)->set_location_range((yylsp[-1]), (yylsp[0]));
}
-#line 3371 "glsl_parser.cpp" /* yacc.c:1646 */
+#line 3355 "glsl_parser.cpp" /* yacc.c:1646 */
break;
- case 34:
-#line 465 "glsl_parser.yy" /* yacc.c:1646 */
+ case 33:
+#line 454 "glsl_parser.yy" /* yacc.c:1646 */
{
void *ctx = state;
(yyval.expression) = new(ctx) ast_expression(ast_post_dec, (yyvsp[-1].expression), NULL, NULL);
(yyval.expression)->set_location_range((yylsp[-1]), (yylsp[0]));
}
-#line 3381 "glsl_parser.cpp" /* yacc.c:1646 */
+#line 3365 "glsl_parser.cpp" /* yacc.c:1646 */
break;
- case 38:
-#line 483 "glsl_parser.yy" /* yacc.c:1646 */
+ case 37:
+#line 472 "glsl_parser.yy" /* yacc.c:1646 */
{
void *ctx = state;
(yyval.expression) = new(ctx) ast_expression(ast_field_selection, (yyvsp[-2].expression), (yyvsp[0].expression), NULL);
(yyval.expression)->set_location_range((yylsp[-2]), (yylsp[0]));
}
-#line 3391 "glsl_parser.cpp" /* yacc.c:1646 */
+#line 3375 "glsl_parser.cpp" /* yacc.c:1646 */
break;
- case 43:
-#line 502 "glsl_parser.yy" /* yacc.c:1646 */
+ case 42:
+#line 491 "glsl_parser.yy" /* yacc.c:1646 */
{
(yyval.expression) = (yyvsp[-1].expression);
(yyval.expression)->set_location((yylsp[-1]));
(yyval.expression)->expressions.push_tail(& (yyvsp[0].expression)->link);
}
-#line 3401 "glsl_parser.cpp" /* yacc.c:1646 */
+#line 3385 "glsl_parser.cpp" /* yacc.c:1646 */
break;
- case 44:
-#line 508 "glsl_parser.yy" /* yacc.c:1646 */
+ case 43:
+#line 497 "glsl_parser.yy" /* yacc.c:1646 */
{
(yyval.expression) = (yyvsp[-2].expression);
(yyval.expression)->set_location((yylsp[-2]));
(yyval.expression)->expressions.push_tail(& (yyvsp[0].expression)->link);
}
-#line 3411 "glsl_parser.cpp" /* yacc.c:1646 */
+#line 3395 "glsl_parser.cpp" /* yacc.c:1646 */
break;
- case 46:
-#line 524 "glsl_parser.yy" /* yacc.c:1646 */
+ case 45:
+#line 513 "glsl_parser.yy" /* yacc.c:1646 */
{
void *ctx = state;
(yyval.expression) = new(ctx) ast_function_expression((yyvsp[0].type_specifier));
(yyval.expression)->set_location((yylsp[0]));
}
-#line 3421 "glsl_parser.cpp" /* yacc.c:1646 */
+#line 3405 "glsl_parser.cpp" /* yacc.c:1646 */
break;
- case 47:
-#line 530 "glsl_parser.yy" /* yacc.c:1646 */
+ case 46:
+#line 519 "glsl_parser.yy" /* yacc.c:1646 */
{
void *ctx = state;
ast_expression *callee = new(ctx) ast_expression((yyvsp[0].identifier));
@@ -3429,11 +3413,11 @@ yyreduce:
(yyval.expression) = new(ctx) ast_function_expression(callee);
(yyval.expression)->set_location((yylsp[0]));
}
-#line 3433 "glsl_parser.cpp" /* yacc.c:1646 */
+#line 3417 "glsl_parser.cpp" /* yacc.c:1646 */
break;
- case 48:
-#line 538 "glsl_parser.yy" /* yacc.c:1646 */
+ case 47:
+#line 527 "glsl_parser.yy" /* yacc.c:1646 */
{
void *ctx = state;
ast_expression *callee = new(ctx) ast_expression((yyvsp[0].identifier));
@@ -3441,31 +3425,31 @@ yyreduce:
(yyval.expression) = new(ctx) ast_function_expression(callee);
(yyval.expression)->set_location((yylsp[0]));
}
-#line 3445 "glsl_parser.cpp" /* yacc.c:1646 */
+#line 3429 "glsl_parser.cpp" /* yacc.c:1646 */
break;
- case 53:
-#line 559 "glsl_parser.yy" /* yacc.c:1646 */
+ case 52:
+#line 548 "glsl_parser.yy" /* yacc.c:1646 */
{
(yyval.expression) = (yyvsp[-1].expression);
(yyval.expression)->set_location((yylsp[-1]));
(yyval.expression)->expressions.push_tail(& (yyvsp[0].expression)->link);
}
-#line 3455 "glsl_parser.cpp" /* yacc.c:1646 */
+#line 3439 "glsl_parser.cpp" /* yacc.c:1646 */
break;
- case 54:
-#line 565 "glsl_parser.yy" /* yacc.c:1646 */
+ case 53:
+#line 554 "glsl_parser.yy" /* yacc.c:1646 */
{
(yyval.expression) = (yyvsp[-2].expression);
(yyval.expression)->set_location((yylsp[-2]));
(yyval.expression)->expressions.push_tail(& (yyvsp[0].expression)->link);
}
-#line 3465 "glsl_parser.cpp" /* yacc.c:1646 */
+#line 3449 "glsl_parser.cpp" /* yacc.c:1646 */
break;
- case 55:
-#line 577 "glsl_parser.yy" /* yacc.c:1646 */
+ case 54:
+#line 566 "glsl_parser.yy" /* yacc.c:1646 */
{
void *ctx = state;
ast_expression *callee = new(ctx) ast_expression((yyvsp[-1].identifier));
@@ -3473,349 +3457,349 @@ yyreduce:
(yyval.expression) = new(ctx) ast_function_expression(callee);
(yyval.expression)->set_location((yylsp[-1]));
}
-#line 3477 "glsl_parser.cpp" /* yacc.c:1646 */
+#line 3461 "glsl_parser.cpp" /* yacc.c:1646 */
break;
- case 57:
-#line 590 "glsl_parser.yy" /* yacc.c:1646 */
+ case 56:
+#line 579 "glsl_parser.yy" /* yacc.c:1646 */
{
void *ctx = state;
(yyval.expression) = new(ctx) ast_expression(ast_pre_inc, (yyvsp[0].expression), NULL, NULL);
(yyval.expression)->set_location((yylsp[-1]));
}
-#line 3487 "glsl_parser.cpp" /* yacc.c:1646 */
+#line 3471 "glsl_parser.cpp" /* yacc.c:1646 */
break;
- case 58:
-#line 596 "glsl_parser.yy" /* yacc.c:1646 */
+ case 57:
+#line 585 "glsl_parser.yy" /* yacc.c:1646 */
{
void *ctx = state;
(yyval.expression) = new(ctx) ast_expression(ast_pre_dec, (yyvsp[0].expression), NULL, NULL);
(yyval.expression)->set_location((yylsp[-1]));
}
-#line 3497 "glsl_parser.cpp" /* yacc.c:1646 */
+#line 3481 "glsl_parser.cpp" /* yacc.c:1646 */
break;
- case 59:
-#line 602 "glsl_parser.yy" /* yacc.c:1646 */
+ case 58:
+#line 591 "glsl_parser.yy" /* yacc.c:1646 */
{
void *ctx = state;
(yyval.expression) = new(ctx) ast_expression((yyvsp[-1].n), (yyvsp[0].expression), NULL, NULL);
(yyval.expression)->set_location_range((yylsp[-1]), (yylsp[0]));
}
-#line 3507 "glsl_parser.cpp" /* yacc.c:1646 */
+#line 3491 "glsl_parser.cpp" /* yacc.c:1646 */
break;
- case 60:
-#line 611 "glsl_parser.yy" /* yacc.c:1646 */
+ case 59:
+#line 600 "glsl_parser.yy" /* yacc.c:1646 */
{ (yyval.n) = ast_plus; }
-#line 3513 "glsl_parser.cpp" /* yacc.c:1646 */
+#line 3497 "glsl_parser.cpp" /* yacc.c:1646 */
break;
- case 61:
-#line 612 "glsl_parser.yy" /* yacc.c:1646 */
+ case 60:
+#line 601 "glsl_parser.yy" /* yacc.c:1646 */
{ (yyval.n) = ast_neg; }
-#line 3519 "glsl_parser.cpp" /* yacc.c:1646 */
+#line 3503 "glsl_parser.cpp" /* yacc.c:1646 */
break;
- case 62:
-#line 613 "glsl_parser.yy" /* yacc.c:1646 */
+ case 61:
+#line 602 "glsl_parser.yy" /* yacc.c:1646 */
{ (yyval.n) = ast_logic_not; }
-#line 3525 "glsl_parser.cpp" /* yacc.c:1646 */
+#line 3509 "glsl_parser.cpp" /* yacc.c:1646 */
break;
- case 63:
-#line 614 "glsl_parser.yy" /* yacc.c:1646 */
+ case 62:
+#line 603 "glsl_parser.yy" /* yacc.c:1646 */
{ (yyval.n) = ast_bit_not; }
-#line 3531 "glsl_parser.cpp" /* yacc.c:1646 */
+#line 3515 "glsl_parser.cpp" /* yacc.c:1646 */
break;
- case 65:
-#line 620 "glsl_parser.yy" /* yacc.c:1646 */
+ case 64:
+#line 609 "glsl_parser.yy" /* yacc.c:1646 */
{
void *ctx = state;
(yyval.expression) = new(ctx) ast_expression_bin(ast_mul, (yyvsp[-2].expression), (yyvsp[0].expression));
(yyval.expression)->set_location_range((yylsp[-2]), (yylsp[0]));
}
-#line 3541 "glsl_parser.cpp" /* yacc.c:1646 */
+#line 3525 "glsl_parser.cpp" /* yacc.c:1646 */
break;
- case 66:
-#line 626 "glsl_parser.yy" /* yacc.c:1646 */
+ case 65:
+#line 615 "glsl_parser.yy" /* yacc.c:1646 */
{
void *ctx = state;
(yyval.expression) = new(ctx) ast_expression_bin(ast_div, (yyvsp[-2].expression), (yyvsp[0].expression));
(yyval.expression)->set_location_range((yylsp[-2]), (yylsp[0]));
}
-#line 3551 "glsl_parser.cpp" /* yacc.c:1646 */
+#line 3535 "glsl_parser.cpp" /* yacc.c:1646 */
break;
- case 67:
-#line 632 "glsl_parser.yy" /* yacc.c:1646 */
+ case 66:
+#line 621 "glsl_parser.yy" /* yacc.c:1646 */
{
void *ctx = state;
(yyval.expression) = new(ctx) ast_expression_bin(ast_mod, (yyvsp[-2].expression), (yyvsp[0].expression));
(yyval.expression)->set_location_range((yylsp[-2]), (yylsp[0]));
}
-#line 3561 "glsl_parser.cpp" /* yacc.c:1646 */
+#line 3545 "glsl_parser.cpp" /* yacc.c:1646 */
break;
- case 69:
-#line 642 "glsl_parser.yy" /* yacc.c:1646 */
+ case 68:
+#line 631 "glsl_parser.yy" /* yacc.c:1646 */
{
void *ctx = state;
(yyval.expression) = new(ctx) ast_expression_bin(ast_add, (yyvsp[-2].expression), (yyvsp[0].expression));
(yyval.expression)->set_location_range((yylsp[-2]), (yylsp[0]));
}
-#line 3571 "glsl_parser.cpp" /* yacc.c:1646 */
+#line 3555 "glsl_parser.cpp" /* yacc.c:1646 */
break;
- case 70:
-#line 648 "glsl_parser.yy" /* yacc.c:1646 */
+ case 69:
+#line 637 "glsl_parser.yy" /* yacc.c:1646 */
{
void *ctx = state;
(yyval.expression) = new(ctx) ast_expression_bin(ast_sub, (yyvsp[-2].expression), (yyvsp[0].expression));
(yyval.expression)->set_location_range((yylsp[-2]), (yylsp[0]));
}
-#line 3581 "glsl_parser.cpp" /* yacc.c:1646 */
+#line 3565 "glsl_parser.cpp" /* yacc.c:1646 */
break;
- case 72:
-#line 658 "glsl_parser.yy" /* yacc.c:1646 */
+ case 71:
+#line 647 "glsl_parser.yy" /* yacc.c:1646 */
{
void *ctx = state;
(yyval.expression) = new(ctx) ast_expression_bin(ast_lshift, (yyvsp[-2].expression), (yyvsp[0].expression));
(yyval.expression)->set_location_range((yylsp[-2]), (yylsp[0]));
}
-#line 3591 "glsl_parser.cpp" /* yacc.c:1646 */
+#line 3575 "glsl_parser.cpp" /* yacc.c:1646 */
break;
- case 73:
-#line 664 "glsl_parser.yy" /* yacc.c:1646 */
+ case 72:
+#line 653 "glsl_parser.yy" /* yacc.c:1646 */
{
void *ctx = state;
(yyval.expression) = new(ctx) ast_expression_bin(ast_rshift, (yyvsp[-2].expression), (yyvsp[0].expression));
(yyval.expression)->set_location_range((yylsp[-2]), (yylsp[0]));
}
-#line 3601 "glsl_parser.cpp" /* yacc.c:1646 */
+#line 3585 "glsl_parser.cpp" /* yacc.c:1646 */
break;
- case 75:
-#line 674 "glsl_parser.yy" /* yacc.c:1646 */
+ case 74:
+#line 663 "glsl_parser.yy" /* yacc.c:1646 */
{
void *ctx = state;
(yyval.expression) = new(ctx) ast_expression_bin(ast_less, (yyvsp[-2].expression), (yyvsp[0].expression));
(yyval.expression)->set_location_range((yylsp[-2]), (yylsp[0]));
}
-#line 3611 "glsl_parser.cpp" /* yacc.c:1646 */
+#line 3595 "glsl_parser.cpp" /* yacc.c:1646 */
break;
- case 76:
-#line 680 "glsl_parser.yy" /* yacc.c:1646 */
+ case 75:
+#line 669 "glsl_parser.yy" /* yacc.c:1646 */
{
void *ctx = state;
(yyval.expression) = new(ctx) ast_expression_bin(ast_greater, (yyvsp[-2].expression), (yyvsp[0].expression));
(yyval.expression)->set_location_range((yylsp[-2]), (yylsp[0]));
}
-#line 3621 "glsl_parser.cpp" /* yacc.c:1646 */
+#line 3605 "glsl_parser.cpp" /* yacc.c:1646 */
break;
- case 77:
-#line 686 "glsl_parser.yy" /* yacc.c:1646 */
+ case 76:
+#line 675 "glsl_parser.yy" /* yacc.c:1646 */
{
void *ctx = state;
(yyval.expression) = new(ctx) ast_expression_bin(ast_lequal, (yyvsp[-2].expression), (yyvsp[0].expression));
(yyval.expression)->set_location_range((yylsp[-2]), (yylsp[0]));
}
-#line 3631 "glsl_parser.cpp" /* yacc.c:1646 */
+#line 3615 "glsl_parser.cpp" /* yacc.c:1646 */
break;
- case 78:
-#line 692 "glsl_parser.yy" /* yacc.c:1646 */
+ case 77:
+#line 681 "glsl_parser.yy" /* yacc.c:1646 */
{
void *ctx = state;
(yyval.expression) = new(ctx) ast_expression_bin(ast_gequal, (yyvsp[-2].expression), (yyvsp[0].expression));
(yyval.expression)->set_location_range((yylsp[-2]), (yylsp[0]));
}
-#line 3641 "glsl_parser.cpp" /* yacc.c:1646 */
+#line 3625 "glsl_parser.cpp" /* yacc.c:1646 */
break;
- case 80:
-#line 702 "glsl_parser.yy" /* yacc.c:1646 */
+ case 79:
+#line 691 "glsl_parser.yy" /* yacc.c:1646 */
{
void *ctx = state;
(yyval.expression) = new(ctx) ast_expression_bin(ast_equal, (yyvsp[-2].expression), (yyvsp[0].expression));
(yyval.expression)->set_location_range((yylsp[-2]), (yylsp[0]));
}
-#line 3651 "glsl_parser.cpp" /* yacc.c:1646 */
+#line 3635 "glsl_parser.cpp" /* yacc.c:1646 */
break;
- case 81:
-#line 708 "glsl_parser.yy" /* yacc.c:1646 */
+ case 80:
+#line 697 "glsl_parser.yy" /* yacc.c:1646 */
{
void *ctx = state;
(yyval.expression) = new(ctx) ast_expression_bin(ast_nequal, (yyvsp[-2].expression), (yyvsp[0].expression));
(yyval.expression)->set_location_range((yylsp[-2]), (yylsp[0]));
}
-#line 3661 "glsl_parser.cpp" /* yacc.c:1646 */
+#line 3645 "glsl_parser.cpp" /* yacc.c:1646 */
break;
- case 83:
-#line 718 "glsl_parser.yy" /* yacc.c:1646 */
+ case 82:
+#line 707 "glsl_parser.yy" /* yacc.c:1646 */
{
void *ctx = state;
(yyval.expression) = new(ctx) ast_expression_bin(ast_bit_and, (yyvsp[-2].expression), (yyvsp[0].expression));
(yyval.expression)->set_location_range((yylsp[-2]), (yylsp[0]));
}
-#line 3671 "glsl_parser.cpp" /* yacc.c:1646 */
+#line 3655 "glsl_parser.cpp" /* yacc.c:1646 */
break;
- case 85:
-#line 728 "glsl_parser.yy" /* yacc.c:1646 */
+ case 84:
+#line 717 "glsl_parser.yy" /* yacc.c:1646 */
{
void *ctx = state;
(yyval.expression) = new(ctx) ast_expression_bin(ast_bit_xor, (yyvsp[-2].expression), (yyvsp[0].expression));
(yyval.expression)->set_location_range((yylsp[-2]), (yylsp[0]));
}
-#line 3681 "glsl_parser.cpp" /* yacc.c:1646 */
+#line 3665 "glsl_parser.cpp" /* yacc.c:1646 */
break;
- case 87:
-#line 738 "glsl_parser.yy" /* yacc.c:1646 */
+ case 86:
+#line 727 "glsl_parser.yy" /* yacc.c:1646 */
{
void *ctx = state;
(yyval.expression) = new(ctx) ast_expression_bin(ast_bit_or, (yyvsp[-2].expression), (yyvsp[0].expression));
(yyval.expression)->set_location_range((yylsp[-2]), (yylsp[0]));
}
-#line 3691 "glsl_parser.cpp" /* yacc.c:1646 */
+#line 3675 "glsl_parser.cpp" /* yacc.c:1646 */
break;
- case 89:
-#line 748 "glsl_parser.yy" /* yacc.c:1646 */
+ case 88:
+#line 737 "glsl_parser.yy" /* yacc.c:1646 */
{
void *ctx = state;
(yyval.expression) = new(ctx) ast_expression_bin(ast_logic_and, (yyvsp[-2].expression), (yyvsp[0].expression));
(yyval.expression)->set_location_range((yylsp[-2]), (yylsp[0]));
}
-#line 3701 "glsl_parser.cpp" /* yacc.c:1646 */
+#line 3685 "glsl_parser.cpp" /* yacc.c:1646 */
break;
- case 91:
-#line 758 "glsl_parser.yy" /* yacc.c:1646 */
+ case 90:
+#line 747 "glsl_parser.yy" /* yacc.c:1646 */
{
void *ctx = state;
(yyval.expression) = new(ctx) ast_expression_bin(ast_logic_xor, (yyvsp[-2].expression), (yyvsp[0].expression));
(yyval.expression)->set_location_range((yylsp[-2]), (yylsp[0]));
}
-#line 3711 "glsl_parser.cpp" /* yacc.c:1646 */
+#line 3695 "glsl_parser.cpp" /* yacc.c:1646 */
break;
- case 93:
-#line 768 "glsl_parser.yy" /* yacc.c:1646 */
+ case 92:
+#line 757 "glsl_parser.yy" /* yacc.c:1646 */
{
void *ctx = state;
(yyval.expression) = new(ctx) ast_expression_bin(ast_logic_or, (yyvsp[-2].expression), (yyvsp[0].expression));
(yyval.expression)->set_location_range((yylsp[-2]), (yylsp[0]));
}
-#line 3721 "glsl_parser.cpp" /* yacc.c:1646 */
+#line 3705 "glsl_parser.cpp" /* yacc.c:1646 */
break;
- case 95:
-#line 778 "glsl_parser.yy" /* yacc.c:1646 */
+ case 94:
+#line 767 "glsl_parser.yy" /* yacc.c:1646 */
{
void *ctx = state;
(yyval.expression) = new(ctx) ast_expression(ast_conditional, (yyvsp[-4].expression), (yyvsp[-2].expression), (yyvsp[0].expression));
(yyval.expression)->set_location_range((yylsp[-4]), (yylsp[0]));
}
-#line 3731 "glsl_parser.cpp" /* yacc.c:1646 */
+#line 3715 "glsl_parser.cpp" /* yacc.c:1646 */
break;
- case 97:
-#line 788 "glsl_parser.yy" /* yacc.c:1646 */
+ case 96:
+#line 777 "glsl_parser.yy" /* yacc.c:1646 */
{
void *ctx = state;
(yyval.expression) = new(ctx) ast_expression((yyvsp[-1].n), (yyvsp[-2].expression), (yyvsp[0].expression), NULL);
(yyval.expression)->set_location_range((yylsp[-2]), (yylsp[0]));
}
-#line 3741 "glsl_parser.cpp" /* yacc.c:1646 */
+#line 3725 "glsl_parser.cpp" /* yacc.c:1646 */
break;
- case 98:
-#line 796 "glsl_parser.yy" /* yacc.c:1646 */
+ case 97:
+#line 785 "glsl_parser.yy" /* yacc.c:1646 */
{ (yyval.n) = ast_assign; }
-#line 3747 "glsl_parser.cpp" /* yacc.c:1646 */
+#line 3731 "glsl_parser.cpp" /* yacc.c:1646 */
break;
- case 99:
-#line 797 "glsl_parser.yy" /* yacc.c:1646 */
+ case 98:
+#line 786 "glsl_parser.yy" /* yacc.c:1646 */
{ (yyval.n) = ast_mul_assign; }
-#line 3753 "glsl_parser.cpp" /* yacc.c:1646 */
+#line 3737 "glsl_parser.cpp" /* yacc.c:1646 */
break;
- case 100:
-#line 798 "glsl_parser.yy" /* yacc.c:1646 */
+ case 99:
+#line 787 "glsl_parser.yy" /* yacc.c:1646 */
{ (yyval.n) = ast_div_assign; }
-#line 3759 "glsl_parser.cpp" /* yacc.c:1646 */
+#line 3743 "glsl_parser.cpp" /* yacc.c:1646 */
break;
- case 101:
-#line 799 "glsl_parser.yy" /* yacc.c:1646 */
+ case 100:
+#line 788 "glsl_parser.yy" /* yacc.c:1646 */
{ (yyval.n) = ast_mod_assign; }
-#line 3765 "glsl_parser.cpp" /* yacc.c:1646 */
+#line 3749 "glsl_parser.cpp" /* yacc.c:1646 */
break;
- case 102:
-#line 800 "glsl_parser.yy" /* yacc.c:1646 */
+ case 101:
+#line 789 "glsl_parser.yy" /* yacc.c:1646 */
{ (yyval.n) = ast_add_assign; }
-#line 3771 "glsl_parser.cpp" /* yacc.c:1646 */
+#line 3755 "glsl_parser.cpp" /* yacc.c:1646 */
break;
- case 103:
-#line 801 "glsl_parser.yy" /* yacc.c:1646 */
+ case 102:
+#line 790 "glsl_parser.yy" /* yacc.c:1646 */
{ (yyval.n) = ast_sub_assign; }
-#line 3777 "glsl_parser.cpp" /* yacc.c:1646 */
+#line 3761 "glsl_parser.cpp" /* yacc.c:1646 */
break;
- case 104:
-#line 802 "glsl_parser.yy" /* yacc.c:1646 */
+ case 103:
+#line 791 "glsl_parser.yy" /* yacc.c:1646 */
{ (yyval.n) = ast_ls_assign; }
-#line 3783 "glsl_parser.cpp" /* yacc.c:1646 */
+#line 3767 "glsl_parser.cpp" /* yacc.c:1646 */
break;
- case 105:
-#line 803 "glsl_parser.yy" /* yacc.c:1646 */
+ case 104:
+#line 792 "glsl_parser.yy" /* yacc.c:1646 */
{ (yyval.n) = ast_rs_assign; }
-#line 3789 "glsl_parser.cpp" /* yacc.c:1646 */
+#line 3773 "glsl_parser.cpp" /* yacc.c:1646 */
break;
- case 106:
-#line 804 "glsl_parser.yy" /* yacc.c:1646 */
+ case 105:
+#line 793 "glsl_parser.yy" /* yacc.c:1646 */
{ (yyval.n) = ast_and_assign; }
-#line 3795 "glsl_parser.cpp" /* yacc.c:1646 */
+#line 3779 "glsl_parser.cpp" /* yacc.c:1646 */
break;
- case 107:
-#line 805 "glsl_parser.yy" /* yacc.c:1646 */
+ case 106:
+#line 794 "glsl_parser.yy" /* yacc.c:1646 */
{ (yyval.n) = ast_xor_assign; }
-#line 3801 "glsl_parser.cpp" /* yacc.c:1646 */
+#line 3785 "glsl_parser.cpp" /* yacc.c:1646 */
break;
- case 108:
-#line 806 "glsl_parser.yy" /* yacc.c:1646 */
+ case 107:
+#line 795 "glsl_parser.yy" /* yacc.c:1646 */
{ (yyval.n) = ast_or_assign; }
-#line 3807 "glsl_parser.cpp" /* yacc.c:1646 */
+#line 3791 "glsl_parser.cpp" /* yacc.c:1646 */
break;
- case 109:
-#line 811 "glsl_parser.yy" /* yacc.c:1646 */
+ case 108:
+#line 800 "glsl_parser.yy" /* yacc.c:1646 */
{
(yyval.expression) = (yyvsp[0].expression);
}
-#line 3815 "glsl_parser.cpp" /* yacc.c:1646 */
+#line 3799 "glsl_parser.cpp" /* yacc.c:1646 */
break;
- case 110:
-#line 815 "glsl_parser.yy" /* yacc.c:1646 */
+ case 109:
+#line 804 "glsl_parser.yy" /* yacc.c:1646 */
{
void *ctx = state;
if ((yyvsp[-2].expression)->oper != ast_sequence) {
@@ -3828,63 +3812,63 @@ yyreduce:
(yyval.expression)->expressions.push_tail(& (yyvsp[0].expression)->link);
}
-#line 3832 "glsl_parser.cpp" /* yacc.c:1646 */
+#line 3816 "glsl_parser.cpp" /* yacc.c:1646 */
break;
- case 112:
-#line 835 "glsl_parser.yy" /* yacc.c:1646 */
+ case 111:
+#line 824 "glsl_parser.yy" /* yacc.c:1646 */
{
state->symbols->pop_scope();
(yyval.node) = (yyvsp[-1].function);
}
-#line 3841 "glsl_parser.cpp" /* yacc.c:1646 */
+#line 3825 "glsl_parser.cpp" /* yacc.c:1646 */
break;
- case 113:
-#line 840 "glsl_parser.yy" /* yacc.c:1646 */
+ case 112:
+#line 829 "glsl_parser.yy" /* yacc.c:1646 */
{
(yyval.node) = (yyvsp[-1].declarator_list);
}
-#line 3849 "glsl_parser.cpp" /* yacc.c:1646 */
+#line 3833 "glsl_parser.cpp" /* yacc.c:1646 */
break;
- case 114:
-#line 844 "glsl_parser.yy" /* yacc.c:1646 */
+ case 113:
+#line 833 "glsl_parser.yy" /* yacc.c:1646 */
{
(yyvsp[-1].type_specifier)->default_precision = (yyvsp[-2].n);
(yyval.node) = (yyvsp[-1].type_specifier);
}
-#line 3858 "glsl_parser.cpp" /* yacc.c:1646 */
+#line 3842 "glsl_parser.cpp" /* yacc.c:1646 */
break;
- case 115:
-#line 849 "glsl_parser.yy" /* yacc.c:1646 */
+ case 114:
+#line 838 "glsl_parser.yy" /* yacc.c:1646 */
{
(yyval.node) = (yyvsp[0].node);
}
-#line 3866 "glsl_parser.cpp" /* yacc.c:1646 */
+#line 3850 "glsl_parser.cpp" /* yacc.c:1646 */
break;
- case 119:
-#line 865 "glsl_parser.yy" /* yacc.c:1646 */
+ case 118:
+#line 854 "glsl_parser.yy" /* yacc.c:1646 */
{
(yyval.function) = (yyvsp[-1].function);
(yyval.function)->parameters.push_tail(& (yyvsp[0].parameter_declarator)->link);
}
-#line 3875 "glsl_parser.cpp" /* yacc.c:1646 */
+#line 3859 "glsl_parser.cpp" /* yacc.c:1646 */
break;
- case 120:
-#line 870 "glsl_parser.yy" /* yacc.c:1646 */
+ case 119:
+#line 859 "glsl_parser.yy" /* yacc.c:1646 */
{
(yyval.function) = (yyvsp[-2].function);
(yyval.function)->parameters.push_tail(& (yyvsp[0].parameter_declarator)->link);
}
-#line 3884 "glsl_parser.cpp" /* yacc.c:1646 */
+#line 3868 "glsl_parser.cpp" /* yacc.c:1646 */
break;
- case 121:
-#line 878 "glsl_parser.yy" /* yacc.c:1646 */
+ case 120:
+#line 867 "glsl_parser.yy" /* yacc.c:1646 */
{
void *ctx = state;
(yyval.function) = new(ctx) ast_function();
@@ -3895,11 +3879,11 @@ yyreduce:
state->symbols->add_function(new(state) ir_function((yyvsp[-1].identifier)));
state->symbols->push_scope();
}
-#line 3899 "glsl_parser.cpp" /* yacc.c:1646 */
+#line 3883 "glsl_parser.cpp" /* yacc.c:1646 */
break;
- case 122:
-#line 892 "glsl_parser.yy" /* yacc.c:1646 */
+ case 121:
+#line 881 "glsl_parser.yy" /* yacc.c:1646 */
{
void *ctx = state;
(yyval.parameter_declarator) = new(ctx) ast_parameter_declarator();
@@ -3909,11 +3893,11 @@ yyreduce:
(yyval.parameter_declarator)->type->specifier = (yyvsp[-1].type_specifier);
(yyval.parameter_declarator)->identifier = (yyvsp[0].identifier);
}
-#line 3913 "glsl_parser.cpp" /* yacc.c:1646 */
+#line 3897 "glsl_parser.cpp" /* yacc.c:1646 */
break;
- case 123:
-#line 902 "glsl_parser.yy" /* yacc.c:1646 */
+ case 122:
+#line 891 "glsl_parser.yy" /* yacc.c:1646 */
{
void *ctx = state;
(yyval.parameter_declarator) = new(ctx) ast_parameter_declarator();
@@ -3924,20 +3908,20 @@ yyreduce:
(yyval.parameter_declarator)->identifier = (yyvsp[-1].identifier);
(yyval.parameter_declarator)->array_specifier = (yyvsp[0].array_specifier);
}
-#line 3928 "glsl_parser.cpp" /* yacc.c:1646 */
+#line 3912 "glsl_parser.cpp" /* yacc.c:1646 */
break;
- case 124:
-#line 916 "glsl_parser.yy" /* yacc.c:1646 */
+ case 123:
+#line 905 "glsl_parser.yy" /* yacc.c:1646 */
{
(yyval.parameter_declarator) = (yyvsp[0].parameter_declarator);
(yyval.parameter_declarator)->type->qualifier = (yyvsp[-1].type_qualifier);
}
-#line 3937 "glsl_parser.cpp" /* yacc.c:1646 */
+#line 3921 "glsl_parser.cpp" /* yacc.c:1646 */
break;
- case 125:
-#line 921 "glsl_parser.yy" /* yacc.c:1646 */
+ case 124:
+#line 910 "glsl_parser.yy" /* yacc.c:1646 */
{
void *ctx = state;
(yyval.parameter_declarator) = new(ctx) ast_parameter_declarator();
@@ -3947,19 +3931,19 @@ yyreduce:
(yyval.parameter_declarator)->type->qualifier = (yyvsp[-1].type_qualifier);
(yyval.parameter_declarator)->type->specifier = (yyvsp[0].type_specifier);
}
-#line 3951 "glsl_parser.cpp" /* yacc.c:1646 */
+#line 3935 "glsl_parser.cpp" /* yacc.c:1646 */
break;
- case 126:
-#line 934 "glsl_parser.yy" /* yacc.c:1646 */
+ case 125:
+#line 923 "glsl_parser.yy" /* yacc.c:1646 */
{
memset(& (yyval.type_qualifier), 0, sizeof((yyval.type_qualifier)));
}
-#line 3959 "glsl_parser.cpp" /* yacc.c:1646 */
+#line 3943 "glsl_parser.cpp" /* yacc.c:1646 */
break;
- case 127:
-#line 938 "glsl_parser.yy" /* yacc.c:1646 */
+ case 126:
+#line 927 "glsl_parser.yy" /* yacc.c:1646 */
{
if ((yyvsp[0].type_qualifier).flags.q.constant)
_mesa_glsl_error(&(yylsp[-1]), state, "duplicate const qualifier");
@@ -3967,39 +3951,27 @@ yyreduce:
(yyval.type_qualifier) = (yyvsp[0].type_qualifier);
(yyval.type_qualifier).flags.q.constant = 1;
}
-#line 3971 "glsl_parser.cpp" /* yacc.c:1646 */
- break;
-
- case 128:
-#line 946 "glsl_parser.yy" /* yacc.c:1646 */
- {
- if ((yyvsp[0].type_qualifier).flags.q.precise)
- _mesa_glsl_error(&(yylsp[-1]), state, "duplicate precise qualifier");
-
- (yyval.type_qualifier) = (yyvsp[0].type_qualifier);
- (yyval.type_qualifier).flags.q.precise = 1;
- }
-#line 3983 "glsl_parser.cpp" /* yacc.c:1646 */
+#line 3955 "glsl_parser.cpp" /* yacc.c:1646 */
break;
- case 129:
-#line 954 "glsl_parser.yy" /* yacc.c:1646 */
+ case 127:
+#line 935 "glsl_parser.yy" /* yacc.c:1646 */
{
if (((yyvsp[-1].type_qualifier).flags.q.in || (yyvsp[-1].type_qualifier).flags.q.out) && ((yyvsp[0].type_qualifier).flags.q.in || (yyvsp[0].type_qualifier).flags.q.out))
_mesa_glsl_error(&(yylsp[-1]), state, "duplicate in/out/inout qualifier");
if (!state->ARB_shading_language_420pack_enable && (yyvsp[0].type_qualifier).flags.q.constant)
- _mesa_glsl_error(&(yylsp[-1]), state, "in/out/inout must come after const "
- "or precise");
+ _mesa_glsl_error(&(yylsp[-1]), state, "const must be specified before "
+ "in/out/inout");
(yyval.type_qualifier) = (yyvsp[-1].type_qualifier);
(yyval.type_qualifier).merge_qualifier(&(yylsp[-1]), state, (yyvsp[0].type_qualifier));
}
-#line 3999 "glsl_parser.cpp" /* yacc.c:1646 */
+#line 3971 "glsl_parser.cpp" /* yacc.c:1646 */
break;
- case 130:
-#line 966 "glsl_parser.yy" /* yacc.c:1646 */
+ case 128:
+#line 947 "glsl_parser.yy" /* yacc.c:1646 */
{
if ((yyvsp[0].type_qualifier).precision != ast_precision_none)
_mesa_glsl_error(&(yylsp[-1]), state, "duplicate precision qualifier");
@@ -4010,39 +3982,39 @@ yyreduce:
(yyval.type_qualifier) = (yyvsp[0].type_qualifier);
(yyval.type_qualifier).precision = (yyvsp[-1].n);
}
-#line 4014 "glsl_parser.cpp" /* yacc.c:1646 */
+#line 3986 "glsl_parser.cpp" /* yacc.c:1646 */
break;
- case 131:
-#line 979 "glsl_parser.yy" /* yacc.c:1646 */
+ case 129:
+#line 960 "glsl_parser.yy" /* yacc.c:1646 */
{
memset(& (yyval.type_qualifier), 0, sizeof((yyval.type_qualifier)));
(yyval.type_qualifier).flags.q.in = 1;
}
-#line 4023 "glsl_parser.cpp" /* yacc.c:1646 */
+#line 3995 "glsl_parser.cpp" /* yacc.c:1646 */
break;
- case 132:
-#line 984 "glsl_parser.yy" /* yacc.c:1646 */
+ case 130:
+#line 965 "glsl_parser.yy" /* yacc.c:1646 */
{
memset(& (yyval.type_qualifier), 0, sizeof((yyval.type_qualifier)));
(yyval.type_qualifier).flags.q.out = 1;
}
-#line 4032 "glsl_parser.cpp" /* yacc.c:1646 */
+#line 4004 "glsl_parser.cpp" /* yacc.c:1646 */
break;
- case 133:
-#line 989 "glsl_parser.yy" /* yacc.c:1646 */
+ case 131:
+#line 970 "glsl_parser.yy" /* yacc.c:1646 */
{
memset(& (yyval.type_qualifier), 0, sizeof((yyval.type_qualifier)));
(yyval.type_qualifier).flags.q.in = 1;
(yyval.type_qualifier).flags.q.out = 1;
}
-#line 4042 "glsl_parser.cpp" /* yacc.c:1646 */
+#line 4014 "glsl_parser.cpp" /* yacc.c:1646 */
break;
- case 136:
-#line 1003 "glsl_parser.yy" /* yacc.c:1646 */
+ case 134:
+#line 984 "glsl_parser.yy" /* yacc.c:1646 */
{
void *ctx = state;
ast_declaration *decl = new(ctx) ast_declaration((yyvsp[0].identifier), NULL, NULL);
@@ -4052,11 +4024,11 @@ yyreduce:
(yyval.declarator_list)->declarations.push_tail(&decl->link);
state->symbols->add_variable(new(state) ir_variable(NULL, (yyvsp[0].identifier), ir_var_auto));
}
-#line 4056 "glsl_parser.cpp" /* yacc.c:1646 */
+#line 4028 "glsl_parser.cpp" /* yacc.c:1646 */
break;
- case 137:
-#line 1013 "glsl_parser.yy" /* yacc.c:1646 */
+ case 135:
+#line 994 "glsl_parser.yy" /* yacc.c:1646 */
{
void *ctx = state;
ast_declaration *decl = new(ctx) ast_declaration((yyvsp[-1].identifier), (yyvsp[0].array_specifier), NULL);
@@ -4066,11 +4038,11 @@ yyreduce:
(yyval.declarator_list)->declarations.push_tail(&decl->link);
state->symbols->add_variable(new(state) ir_variable(NULL, (yyvsp[-1].identifier), ir_var_auto));
}
-#line 4070 "glsl_parser.cpp" /* yacc.c:1646 */
+#line 4042 "glsl_parser.cpp" /* yacc.c:1646 */
break;
- case 138:
-#line 1023 "glsl_parser.yy" /* yacc.c:1646 */
+ case 136:
+#line 1004 "glsl_parser.yy" /* yacc.c:1646 */
{
void *ctx = state;
ast_declaration *decl = new(ctx) ast_declaration((yyvsp[-3].identifier), (yyvsp[-2].array_specifier), (yyvsp[0].expression));
@@ -4080,11 +4052,11 @@ yyreduce:
(yyval.declarator_list)->declarations.push_tail(&decl->link);
state->symbols->add_variable(new(state) ir_variable(NULL, (yyvsp[-3].identifier), ir_var_auto));
}
-#line 4084 "glsl_parser.cpp" /* yacc.c:1646 */
+#line 4056 "glsl_parser.cpp" /* yacc.c:1646 */
break;
- case 139:
-#line 1033 "glsl_parser.yy" /* yacc.c:1646 */
+ case 137:
+#line 1014 "glsl_parser.yy" /* yacc.c:1646 */
{
void *ctx = state;
ast_declaration *decl = new(ctx) ast_declaration((yyvsp[-2].identifier), NULL, (yyvsp[0].expression));
@@ -4094,22 +4066,22 @@ yyreduce:
(yyval.declarator_list)->declarations.push_tail(&decl->link);
state->symbols->add_variable(new(state) ir_variable(NULL, (yyvsp[-2].identifier), ir_var_auto));
}
-#line 4098 "glsl_parser.cpp" /* yacc.c:1646 */
+#line 4070 "glsl_parser.cpp" /* yacc.c:1646 */
break;
- case 140:
-#line 1047 "glsl_parser.yy" /* yacc.c:1646 */
+ case 138:
+#line 1028 "glsl_parser.yy" /* yacc.c:1646 */
{
void *ctx = state;
/* Empty declaration list is valid. */
(yyval.declarator_list) = new(ctx) ast_declarator_list((yyvsp[0].fully_specified_type));
(yyval.declarator_list)->set_location((yylsp[0]));
}
-#line 4109 "glsl_parser.cpp" /* yacc.c:1646 */
+#line 4081 "glsl_parser.cpp" /* yacc.c:1646 */
break;
- case 141:
-#line 1054 "glsl_parser.yy" /* yacc.c:1646 */
+ case 139:
+#line 1035 "glsl_parser.yy" /* yacc.c:1646 */
{
void *ctx = state;
ast_declaration *decl = new(ctx) ast_declaration((yyvsp[0].identifier), NULL, NULL);
@@ -4119,11 +4091,11 @@ yyreduce:
(yyval.declarator_list)->set_location_range((yylsp[-1]), (yylsp[0]));
(yyval.declarator_list)->declarations.push_tail(&decl->link);
}
-#line 4123 "glsl_parser.cpp" /* yacc.c:1646 */
+#line 4095 "glsl_parser.cpp" /* yacc.c:1646 */
break;
- case 142:
-#line 1064 "glsl_parser.yy" /* yacc.c:1646 */
+ case 140:
+#line 1045 "glsl_parser.yy" /* yacc.c:1646 */
{
void *ctx = state;
ast_declaration *decl = new(ctx) ast_declaration((yyvsp[-1].identifier), (yyvsp[0].array_specifier), NULL);
@@ -4133,11 +4105,11 @@ yyreduce:
(yyval.declarator_list)->set_location_range((yylsp[-2]), (yylsp[0]));
(yyval.declarator_list)->declarations.push_tail(&decl->link);
}
-#line 4137 "glsl_parser.cpp" /* yacc.c:1646 */
+#line 4109 "glsl_parser.cpp" /* yacc.c:1646 */
break;
- case 143:
-#line 1074 "glsl_parser.yy" /* yacc.c:1646 */
+ case 141:
+#line 1055 "glsl_parser.yy" /* yacc.c:1646 */
{
void *ctx = state;
ast_declaration *decl = new(ctx) ast_declaration((yyvsp[-3].identifier), (yyvsp[-2].array_specifier), (yyvsp[0].expression));
@@ -4147,11 +4119,11 @@ yyreduce:
(yyval.declarator_list)->set_location_range((yylsp[-4]), (yylsp[-2]));
(yyval.declarator_list)->declarations.push_tail(&decl->link);
}
-#line 4151 "glsl_parser.cpp" /* yacc.c:1646 */
+#line 4123 "glsl_parser.cpp" /* yacc.c:1646 */
break;
- case 144:
-#line 1084 "glsl_parser.yy" /* yacc.c:1646 */
+ case 142:
+#line 1065 "glsl_parser.yy" /* yacc.c:1646 */
{
void *ctx = state;
ast_declaration *decl = new(ctx) ast_declaration((yyvsp[-2].identifier), NULL, (yyvsp[0].expression));
@@ -4161,11 +4133,11 @@ yyreduce:
(yyval.declarator_list)->set_location_range((yylsp[-3]), (yylsp[-2]));
(yyval.declarator_list)->declarations.push_tail(&decl->link);
}
-#line 4165 "glsl_parser.cpp" /* yacc.c:1646 */
+#line 4137 "glsl_parser.cpp" /* yacc.c:1646 */
break;
- case 145:
-#line 1094 "glsl_parser.yy" /* yacc.c:1646 */
+ case 143:
+#line 1075 "glsl_parser.yy" /* yacc.c:1646 */
{
void *ctx = state;
ast_declaration *decl = new(ctx) ast_declaration((yyvsp[0].identifier), NULL, NULL);
@@ -4177,38 +4149,22 @@ yyreduce:
(yyval.declarator_list)->declarations.push_tail(&decl->link);
}
-#line 4181 "glsl_parser.cpp" /* yacc.c:1646 */
+#line 4153 "glsl_parser.cpp" /* yacc.c:1646 */
break;
- case 146:
-#line 1106 "glsl_parser.yy" /* yacc.c:1646 */
- {
- void *ctx = state;
- ast_declaration *decl = new(ctx) ast_declaration((yyvsp[0].identifier), NULL, NULL);
- decl->set_location((yylsp[0]));
-
- (yyval.declarator_list) = new(ctx) ast_declarator_list(NULL);
- (yyval.declarator_list)->set_location_range((yylsp[-1]), (yylsp[0]));
- (yyval.declarator_list)->precise = true;
-
- (yyval.declarator_list)->declarations.push_tail(&decl->link);
- }
-#line 4197 "glsl_parser.cpp" /* yacc.c:1646 */
- break;
-
- case 147:
-#line 1121 "glsl_parser.yy" /* yacc.c:1646 */
+ case 144:
+#line 1090 "glsl_parser.yy" /* yacc.c:1646 */
{
void *ctx = state;
(yyval.fully_specified_type) = new(ctx) ast_fully_specified_type();
(yyval.fully_specified_type)->set_location((yylsp[0]));
(yyval.fully_specified_type)->specifier = (yyvsp[0].type_specifier);
}
-#line 4208 "glsl_parser.cpp" /* yacc.c:1646 */
+#line 4164 "glsl_parser.cpp" /* yacc.c:1646 */
break;
- case 148:
-#line 1128 "glsl_parser.yy" /* yacc.c:1646 */
+ case 145:
+#line 1097 "glsl_parser.yy" /* yacc.c:1646 */
{
void *ctx = state;
(yyval.fully_specified_type) = new(ctx) ast_fully_specified_type();
@@ -4216,42 +4172,42 @@ yyreduce:
(yyval.fully_specified_type)->qualifier = (yyvsp[-1].type_qualifier);
(yyval.fully_specified_type)->specifier = (yyvsp[0].type_specifier);
}
-#line 4220 "glsl_parser.cpp" /* yacc.c:1646 */
+#line 4176 "glsl_parser.cpp" /* yacc.c:1646 */
break;
- case 149:
-#line 1139 "glsl_parser.yy" /* yacc.c:1646 */
+ case 146:
+#line 1108 "glsl_parser.yy" /* yacc.c:1646 */
{
(yyval.type_qualifier) = (yyvsp[-1].type_qualifier);
}
-#line 4228 "glsl_parser.cpp" /* yacc.c:1646 */
+#line 4184 "glsl_parser.cpp" /* yacc.c:1646 */
break;
- case 151:
-#line 1147 "glsl_parser.yy" /* yacc.c:1646 */
+ case 148:
+#line 1116 "glsl_parser.yy" /* yacc.c:1646 */
{
(yyval.type_qualifier) = (yyvsp[-2].type_qualifier);
if (!(yyval.type_qualifier).merge_qualifier(& (yylsp[0]), state, (yyvsp[0].type_qualifier))) {
YYERROR;
}
}
-#line 4239 "glsl_parser.cpp" /* yacc.c:1646 */
+#line 4195 "glsl_parser.cpp" /* yacc.c:1646 */
break;
- case 152:
-#line 1156 "glsl_parser.yy" /* yacc.c:1646 */
+ case 149:
+#line 1125 "glsl_parser.yy" /* yacc.c:1646 */
{ (yyval.n) = (yyvsp[0].n); }
-#line 4245 "glsl_parser.cpp" /* yacc.c:1646 */
+#line 4201 "glsl_parser.cpp" /* yacc.c:1646 */
break;
- case 153:
-#line 1157 "glsl_parser.yy" /* yacc.c:1646 */
+ case 150:
+#line 1126 "glsl_parser.yy" /* yacc.c:1646 */
{ (yyval.n) = (yyvsp[0].n); }
-#line 4251 "glsl_parser.cpp" /* yacc.c:1646 */
+#line 4207 "glsl_parser.cpp" /* yacc.c:1646 */
break;
- case 154:
-#line 1162 "glsl_parser.yy" /* yacc.c:1646 */
+ case 151:
+#line 1131 "glsl_parser.yy" /* yacc.c:1646 */
{
memset(& (yyval.type_qualifier), 0, sizeof((yyval.type_qualifier)));
@@ -4436,11 +4392,11 @@ yyreduce:
YYERROR;
}
}
-#line 4440 "glsl_parser.cpp" /* yacc.c:1646 */
+#line 4396 "glsl_parser.cpp" /* yacc.c:1646 */
break;
- case 155:
-#line 1347 "glsl_parser.yy" /* yacc.c:1646 */
+ case 152:
+#line 1316 "glsl_parser.yy" /* yacc.c:1646 */
{
memset(& (yyval.type_qualifier), 0, sizeof((yyval.type_qualifier)));
@@ -4503,22 +4459,6 @@ yyreduce:
}
}
- if (state->stage == MESA_SHADER_GEOMETRY) {
- if (match_layout_qualifier("stream", (yyvsp[-2].identifier), state) == 0 &&
- state->check_explicit_attrib_stream_allowed(& (yylsp[0]))) {
- (yyval.type_qualifier).flags.q.stream = 1;
-
- if ((yyvsp[0].n) < 0) {
- _mesa_glsl_error(& (yylsp[0]), state,
- "invalid stream %d specified", (yyvsp[0].n));
- YYERROR;
- } else {
- (yyval.type_qualifier).flags.q.explicit_stream = 1;
- (yyval.type_qualifier).stream = (yyvsp[0].n);
- }
- }
- }
-
static const char * const local_size_qualifiers[3] = {
"local_size_x",
"local_size_y",
@@ -4579,11 +4519,11 @@ yyreduce:
YYERROR;
}
}
-#line 4583 "glsl_parser.cpp" /* yacc.c:1646 */
+#line 4523 "glsl_parser.cpp" /* yacc.c:1646 */
break;
- case 156:
-#line 1486 "glsl_parser.yy" /* yacc.c:1646 */
+ case 153:
+#line 1439 "glsl_parser.yy" /* yacc.c:1646 */
{
(yyval.type_qualifier) = (yyvsp[0].type_qualifier);
/* Layout qualifiers for ARB_uniform_buffer_object. */
@@ -4597,111 +4537,91 @@ yyreduce:
"layout qualifier `%s' is used", (yyvsp[0].type_qualifier));
}
}
-#line 4601 "glsl_parser.cpp" /* yacc.c:1646 */
+#line 4541 "glsl_parser.cpp" /* yacc.c:1646 */
break;
- case 157:
-#line 1512 "glsl_parser.yy" /* yacc.c:1646 */
+ case 154:
+#line 1465 "glsl_parser.yy" /* yacc.c:1646 */
{
memset(& (yyval.type_qualifier), 0, sizeof((yyval.type_qualifier)));
(yyval.type_qualifier).flags.q.row_major = 1;
}
-#line 4610 "glsl_parser.cpp" /* yacc.c:1646 */
+#line 4550 "glsl_parser.cpp" /* yacc.c:1646 */
break;
- case 158:
-#line 1517 "glsl_parser.yy" /* yacc.c:1646 */
+ case 155:
+#line 1470 "glsl_parser.yy" /* yacc.c:1646 */
{
memset(& (yyval.type_qualifier), 0, sizeof((yyval.type_qualifier)));
(yyval.type_qualifier).flags.q.packed = 1;
}
-#line 4619 "glsl_parser.cpp" /* yacc.c:1646 */
+#line 4559 "glsl_parser.cpp" /* yacc.c:1646 */
break;
- case 159:
-#line 1525 "glsl_parser.yy" /* yacc.c:1646 */
+ case 156:
+#line 1478 "glsl_parser.yy" /* yacc.c:1646 */
{
memset(& (yyval.type_qualifier), 0, sizeof((yyval.type_qualifier)));
(yyval.type_qualifier).flags.q.smooth = 1;
}
-#line 4628 "glsl_parser.cpp" /* yacc.c:1646 */
+#line 4568 "glsl_parser.cpp" /* yacc.c:1646 */
break;
- case 160:
-#line 1530 "glsl_parser.yy" /* yacc.c:1646 */
+ case 157:
+#line 1483 "glsl_parser.yy" /* yacc.c:1646 */
{
memset(& (yyval.type_qualifier), 0, sizeof((yyval.type_qualifier)));
(yyval.type_qualifier).flags.q.flat = 1;
}
-#line 4637 "glsl_parser.cpp" /* yacc.c:1646 */
+#line 4577 "glsl_parser.cpp" /* yacc.c:1646 */
break;
- case 161:
-#line 1535 "glsl_parser.yy" /* yacc.c:1646 */
+ case 158:
+#line 1488 "glsl_parser.yy" /* yacc.c:1646 */
{
memset(& (yyval.type_qualifier), 0, sizeof((yyval.type_qualifier)));
(yyval.type_qualifier).flags.q.noperspective = 1;
}
-#line 4646 "glsl_parser.cpp" /* yacc.c:1646 */
+#line 4586 "glsl_parser.cpp" /* yacc.c:1646 */
break;
- case 162:
-#line 1544 "glsl_parser.yy" /* yacc.c:1646 */
+ case 159:
+#line 1497 "glsl_parser.yy" /* yacc.c:1646 */
{
memset(& (yyval.type_qualifier), 0, sizeof((yyval.type_qualifier)));
(yyval.type_qualifier).flags.q.invariant = 1;
}
-#line 4655 "glsl_parser.cpp" /* yacc.c:1646 */
+#line 4595 "glsl_parser.cpp" /* yacc.c:1646 */
break;
- case 163:
-#line 1549 "glsl_parser.yy" /* yacc.c:1646 */
- {
- memset(& (yyval.type_qualifier), 0, sizeof((yyval.type_qualifier)));
- (yyval.type_qualifier).flags.q.precise = 1;
- }
-#line 4664 "glsl_parser.cpp" /* yacc.c:1646 */
- break;
-
- case 168:
-#line 1558 "glsl_parser.yy" /* yacc.c:1646 */
+ case 164:
+#line 1506 "glsl_parser.yy" /* yacc.c:1646 */
{
memset(&(yyval.type_qualifier), 0, sizeof((yyval.type_qualifier)));
(yyval.type_qualifier).precision = (yyvsp[0].n);
}
-#line 4673 "glsl_parser.cpp" /* yacc.c:1646 */
+#line 4604 "glsl_parser.cpp" /* yacc.c:1646 */
break;
- case 169:
-#line 1576 "glsl_parser.yy" /* yacc.c:1646 */
- {
- if ((yyvsp[0].type_qualifier).flags.q.precise)
- _mesa_glsl_error(&(yylsp[-1]), state, "duplicate \"precise\" qualifier");
-
- (yyval.type_qualifier) = (yyvsp[0].type_qualifier);
- (yyval.type_qualifier).flags.q.precise = 1;
- }
-#line 4685 "glsl_parser.cpp" /* yacc.c:1646 */
- break;
-
- case 170:
-#line 1584 "glsl_parser.yy" /* yacc.c:1646 */
+ case 165:
+#line 1524 "glsl_parser.yy" /* yacc.c:1646 */
{
if ((yyvsp[0].type_qualifier).flags.q.invariant)
_mesa_glsl_error(&(yylsp[-1]), state, "duplicate \"invariant\" qualifier");
- if (!state->ARB_shading_language_420pack_enable && (yyvsp[0].type_qualifier).flags.q.precise)
+ if ((yyvsp[0].type_qualifier).has_layout()) {
_mesa_glsl_error(&(yylsp[-1]), state,
- "\"invariant\" must come after \"precise\"");
+ "\"invariant\" cannot be used with layout(...)");
+ }
(yyval.type_qualifier) = (yyvsp[0].type_qualifier);
(yyval.type_qualifier).flags.q.invariant = 1;
}
-#line 4701 "glsl_parser.cpp" /* yacc.c:1646 */
+#line 4621 "glsl_parser.cpp" /* yacc.c:1646 */
break;
- case 171:
-#line 1596 "glsl_parser.yy" /* yacc.c:1646 */
+ case 166:
+#line 1537 "glsl_parser.yy" /* yacc.c:1646 */
{
/* Section 4.3 of the GLSL 1.40 specification states:
* "...qualified with one of these interpolation qualifiers"
@@ -4716,41 +4636,51 @@ yyreduce:
if ((yyvsp[0].type_qualifier).has_interpolation())
_mesa_glsl_error(&(yylsp[-1]), state, "duplicate interpolation qualifier");
- if (!state->ARB_shading_language_420pack_enable &&
- ((yyvsp[0].type_qualifier).flags.q.precise || (yyvsp[0].type_qualifier).flags.q.invariant)) {
+ if ((yyvsp[0].type_qualifier).has_layout()) {
+ _mesa_glsl_error(&(yylsp[-1]), state, "interpolation qualifiers cannot be used "
+ "with layout(...)");
+ }
+
+ if (!state->ARB_shading_language_420pack_enable && (yyvsp[0].type_qualifier).flags.q.invariant) {
_mesa_glsl_error(&(yylsp[-1]), state, "interpolation qualifiers must come "
- "after \"precise\" or \"invariant\"");
+ "after \"invariant\"");
}
(yyval.type_qualifier) = (yyvsp[-1].type_qualifier);
(yyval.type_qualifier).merge_qualifier(&(yylsp[-1]), state, (yyvsp[0].type_qualifier));
}
-#line 4729 "glsl_parser.cpp" /* yacc.c:1646 */
+#line 4653 "glsl_parser.cpp" /* yacc.c:1646 */
break;
- case 172:
-#line 1620 "glsl_parser.yy" /* yacc.c:1646 */
+ case 167:
+#line 1565 "glsl_parser.yy" /* yacc.c:1646 */
{
- /* In the absence of ARB_shading_language_420pack, layout qualifiers may
- * appear no later than auxiliary storage qualifiers. There is no
- * particularly clear spec language mandating this, but in all examples
- * the layout qualifier precedes the storage qualifier.
- *
- * We allow combinations of layout with interpolation, invariant or
- * precise qualifiers since these are useful in ARB_separate_shader_objects.
- * There is no clear spec guidance on this either.
+ /* The GLSL 1.50 grammar indicates that a layout(...) declaration can be
+ * used standalone or immediately before a storage qualifier. It cannot
+ * be used with interpolation qualifiers or invariant. There does not
+ * appear to be any text indicating that it must come before the storage
+ * qualifier, but always seems to in examples.
*/
if (!state->ARB_shading_language_420pack_enable && (yyvsp[0].type_qualifier).has_layout())
_mesa_glsl_error(&(yylsp[-1]), state, "duplicate layout(...) qualifiers");
+ if ((yyvsp[0].type_qualifier).flags.q.invariant)
+ _mesa_glsl_error(&(yylsp[-1]), state, "layout(...) cannot be used with "
+ "the \"invariant\" qualifier");
+
+ if ((yyvsp[0].type_qualifier).has_interpolation()) {
+ _mesa_glsl_error(&(yylsp[-1]), state, "layout(...) cannot be used with "
+ "interpolation qualifiers");
+ }
+
(yyval.type_qualifier) = (yyvsp[-1].type_qualifier);
(yyval.type_qualifier).merge_qualifier(&(yylsp[-1]), state, (yyvsp[0].type_qualifier));
}
-#line 4750 "glsl_parser.cpp" /* yacc.c:1646 */
+#line 4680 "glsl_parser.cpp" /* yacc.c:1646 */
break;
- case 173:
-#line 1637 "glsl_parser.yy" /* yacc.c:1646 */
+ case 168:
+#line 1588 "glsl_parser.yy" /* yacc.c:1646 */
{
if ((yyvsp[0].type_qualifier).has_auxiliary_storage()) {
_mesa_glsl_error(&(yylsp[-1]), state,
@@ -4758,19 +4688,18 @@ yyreduce:
}
if (!state->ARB_shading_language_420pack_enable &&
- ((yyvsp[0].type_qualifier).flags.q.precise || (yyvsp[0].type_qualifier).flags.q.invariant ||
- (yyvsp[0].type_qualifier).has_interpolation() || (yyvsp[0].type_qualifier).has_layout())) {
+ ((yyvsp[0].type_qualifier).flags.q.invariant || (yyvsp[0].type_qualifier).has_interpolation() || (yyvsp[0].type_qualifier).has_layout())) {
_mesa_glsl_error(&(yylsp[-1]), state, "auxiliary storage qualifiers must come "
"just before storage qualifiers");
}
(yyval.type_qualifier) = (yyvsp[-1].type_qualifier);
(yyval.type_qualifier).merge_qualifier(&(yylsp[-1]), state, (yyvsp[0].type_qualifier));
}
-#line 4770 "glsl_parser.cpp" /* yacc.c:1646 */
+#line 4699 "glsl_parser.cpp" /* yacc.c:1646 */
break;
- case 174:
-#line 1653 "glsl_parser.yy" /* yacc.c:1646 */
+ case 169:
+#line 1603 "glsl_parser.yy" /* yacc.c:1646 */
{
/* Section 4.3 of the GLSL 1.20 specification states:
* "Variable declarations may have a storage qualifier specified..."
@@ -4780,21 +4709,21 @@ yyreduce:
_mesa_glsl_error(&(yylsp[-1]), state, "duplicate storage qualifier");
if (!state->ARB_shading_language_420pack_enable &&
- ((yyvsp[0].type_qualifier).flags.q.precise || (yyvsp[0].type_qualifier).flags.q.invariant || (yyvsp[0].type_qualifier).has_interpolation() ||
- (yyvsp[0].type_qualifier).has_layout() || (yyvsp[0].type_qualifier).has_auxiliary_storage())) {
+ ((yyvsp[0].type_qualifier).flags.q.invariant || (yyvsp[0].type_qualifier).has_interpolation() || (yyvsp[0].type_qualifier).has_layout() ||
+ (yyvsp[0].type_qualifier).has_auxiliary_storage())) {
_mesa_glsl_error(&(yylsp[-1]), state, "storage qualifiers must come after "
- "precise, invariant, interpolation, layout and auxiliary "
+ "invariant, interpolation, layout and auxiliary "
"storage qualifiers");
}
(yyval.type_qualifier) = (yyvsp[-1].type_qualifier);
(yyval.type_qualifier).merge_qualifier(&(yylsp[-1]), state, (yyvsp[0].type_qualifier));
}
-#line 4794 "glsl_parser.cpp" /* yacc.c:1646 */
+#line 4723 "glsl_parser.cpp" /* yacc.c:1646 */
break;
- case 175:
-#line 1673 "glsl_parser.yy" /* yacc.c:1646 */
+ case 170:
+#line 1623 "glsl_parser.yy" /* yacc.c:1646 */
{
if ((yyvsp[0].type_qualifier).precision != ast_precision_none)
_mesa_glsl_error(&(yylsp[-1]), state, "duplicate precision qualifier");
@@ -4805,163 +4734,149 @@ yyreduce:
(yyval.type_qualifier) = (yyvsp[0].type_qualifier);
(yyval.type_qualifier).precision = (yyvsp[-1].n);
}
-#line 4809 "glsl_parser.cpp" /* yacc.c:1646 */
+#line 4738 "glsl_parser.cpp" /* yacc.c:1646 */
break;
- case 176:
-#line 1687 "glsl_parser.yy" /* yacc.c:1646 */
+ case 171:
+#line 1637 "glsl_parser.yy" /* yacc.c:1646 */
{
memset(& (yyval.type_qualifier), 0, sizeof((yyval.type_qualifier)));
(yyval.type_qualifier).flags.q.centroid = 1;
}
-#line 4818 "glsl_parser.cpp" /* yacc.c:1646 */
+#line 4747 "glsl_parser.cpp" /* yacc.c:1646 */
break;
- case 177:
-#line 1692 "glsl_parser.yy" /* yacc.c:1646 */
+ case 172:
+#line 1642 "glsl_parser.yy" /* yacc.c:1646 */
{
memset(& (yyval.type_qualifier), 0, sizeof((yyval.type_qualifier)));
(yyval.type_qualifier).flags.q.sample = 1;
}
-#line 4827 "glsl_parser.cpp" /* yacc.c:1646 */
+#line 4756 "glsl_parser.cpp" /* yacc.c:1646 */
break;
- case 178:
-#line 1700 "glsl_parser.yy" /* yacc.c:1646 */
+ case 173:
+#line 1650 "glsl_parser.yy" /* yacc.c:1646 */
{
memset(& (yyval.type_qualifier), 0, sizeof((yyval.type_qualifier)));
(yyval.type_qualifier).flags.q.constant = 1;
}
-#line 4836 "glsl_parser.cpp" /* yacc.c:1646 */
+#line 4765 "glsl_parser.cpp" /* yacc.c:1646 */
break;
- case 179:
-#line 1705 "glsl_parser.yy" /* yacc.c:1646 */
+ case 174:
+#line 1655 "glsl_parser.yy" /* yacc.c:1646 */
{
memset(& (yyval.type_qualifier), 0, sizeof((yyval.type_qualifier)));
(yyval.type_qualifier).flags.q.attribute = 1;
}
-#line 4845 "glsl_parser.cpp" /* yacc.c:1646 */
+#line 4774 "glsl_parser.cpp" /* yacc.c:1646 */
break;
- case 180:
-#line 1710 "glsl_parser.yy" /* yacc.c:1646 */
+ case 175:
+#line 1660 "glsl_parser.yy" /* yacc.c:1646 */
{
memset(& (yyval.type_qualifier), 0, sizeof((yyval.type_qualifier)));
(yyval.type_qualifier).flags.q.varying = 1;
}
-#line 4854 "glsl_parser.cpp" /* yacc.c:1646 */
+#line 4783 "glsl_parser.cpp" /* yacc.c:1646 */
break;
- case 181:
-#line 1715 "glsl_parser.yy" /* yacc.c:1646 */
+ case 176:
+#line 1665 "glsl_parser.yy" /* yacc.c:1646 */
{
memset(& (yyval.type_qualifier), 0, sizeof((yyval.type_qualifier)));
(yyval.type_qualifier).flags.q.in = 1;
}
-#line 4863 "glsl_parser.cpp" /* yacc.c:1646 */
+#line 4792 "glsl_parser.cpp" /* yacc.c:1646 */
break;
- case 182:
-#line 1720 "glsl_parser.yy" /* yacc.c:1646 */
+ case 177:
+#line 1670 "glsl_parser.yy" /* yacc.c:1646 */
{
memset(& (yyval.type_qualifier), 0, sizeof((yyval.type_qualifier)));
(yyval.type_qualifier).flags.q.out = 1;
-
- if (state->stage == MESA_SHADER_GEOMETRY &&
- state->has_explicit_attrib_stream()) {
- /* Section 4.3.8.2 (Output Layout Qualifiers) of the GLSL 4.00
- * spec says:
- *
- * "If the block or variable is declared with the stream
- * identifier, it is associated with the specified stream;
- * otherwise, it is associated with the current default stream."
- */
- (yyval.type_qualifier).flags.q.stream = 1;
- (yyval.type_qualifier).flags.q.explicit_stream = 0;
- (yyval.type_qualifier).stream = state->out_qualifier->stream;
- }
}
-#line 4886 "glsl_parser.cpp" /* yacc.c:1646 */
+#line 4801 "glsl_parser.cpp" /* yacc.c:1646 */
break;
- case 183:
-#line 1739 "glsl_parser.yy" /* yacc.c:1646 */
+ case 178:
+#line 1675 "glsl_parser.yy" /* yacc.c:1646 */
{
memset(& (yyval.type_qualifier), 0, sizeof((yyval.type_qualifier)));
(yyval.type_qualifier).flags.q.uniform = 1;
}
-#line 4895 "glsl_parser.cpp" /* yacc.c:1646 */
+#line 4810 "glsl_parser.cpp" /* yacc.c:1646 */
break;
- case 184:
-#line 1744 "glsl_parser.yy" /* yacc.c:1646 */
+ case 179:
+#line 1680 "glsl_parser.yy" /* yacc.c:1646 */
{
memset(& (yyval.type_qualifier), 0, sizeof((yyval.type_qualifier)));
(yyval.type_qualifier).flags.q.coherent = 1;
}
-#line 4904 "glsl_parser.cpp" /* yacc.c:1646 */
+#line 4819 "glsl_parser.cpp" /* yacc.c:1646 */
break;
- case 185:
-#line 1749 "glsl_parser.yy" /* yacc.c:1646 */
+ case 180:
+#line 1685 "glsl_parser.yy" /* yacc.c:1646 */
{
memset(& (yyval.type_qualifier), 0, sizeof((yyval.type_qualifier)));
(yyval.type_qualifier).flags.q._volatile = 1;
}
-#line 4913 "glsl_parser.cpp" /* yacc.c:1646 */
+#line 4828 "glsl_parser.cpp" /* yacc.c:1646 */
break;
- case 186:
-#line 1754 "glsl_parser.yy" /* yacc.c:1646 */
+ case 181:
+#line 1690 "glsl_parser.yy" /* yacc.c:1646 */
{
STATIC_ASSERT(sizeof((yyval.type_qualifier).flags.q) <= sizeof((yyval.type_qualifier).flags.i));
memset(& (yyval.type_qualifier), 0, sizeof((yyval.type_qualifier)));
(yyval.type_qualifier).flags.q.restrict_flag = 1;
}
-#line 4923 "glsl_parser.cpp" /* yacc.c:1646 */
+#line 4838 "glsl_parser.cpp" /* yacc.c:1646 */
break;
- case 187:
-#line 1760 "glsl_parser.yy" /* yacc.c:1646 */
+ case 182:
+#line 1696 "glsl_parser.yy" /* yacc.c:1646 */
{
memset(& (yyval.type_qualifier), 0, sizeof((yyval.type_qualifier)));
(yyval.type_qualifier).flags.q.read_only = 1;
}
-#line 4932 "glsl_parser.cpp" /* yacc.c:1646 */
+#line 4847 "glsl_parser.cpp" /* yacc.c:1646 */
break;
- case 188:
-#line 1765 "glsl_parser.yy" /* yacc.c:1646 */
+ case 183:
+#line 1701 "glsl_parser.yy" /* yacc.c:1646 */
{
memset(& (yyval.type_qualifier), 0, sizeof((yyval.type_qualifier)));
(yyval.type_qualifier).flags.q.write_only = 1;
}
-#line 4941 "glsl_parser.cpp" /* yacc.c:1646 */
+#line 4856 "glsl_parser.cpp" /* yacc.c:1646 */
break;
- case 189:
-#line 1773 "glsl_parser.yy" /* yacc.c:1646 */
+ case 184:
+#line 1709 "glsl_parser.yy" /* yacc.c:1646 */
{
void *ctx = state;
(yyval.array_specifier) = new(ctx) ast_array_specifier((yylsp[-1]));
(yyval.array_specifier)->set_location_range((yylsp[-1]), (yylsp[0]));
}
-#line 4951 "glsl_parser.cpp" /* yacc.c:1646 */
+#line 4866 "glsl_parser.cpp" /* yacc.c:1646 */
break;
- case 190:
-#line 1779 "glsl_parser.yy" /* yacc.c:1646 */
+ case 185:
+#line 1715 "glsl_parser.yy" /* yacc.c:1646 */
{
void *ctx = state;
(yyval.array_specifier) = new(ctx) ast_array_specifier((yylsp[-2]), (yyvsp[-1].expression));
(yyval.array_specifier)->set_location_range((yylsp[-2]), (yylsp[0]));
}
-#line 4961 "glsl_parser.cpp" /* yacc.c:1646 */
+#line 4876 "glsl_parser.cpp" /* yacc.c:1646 */
break;
- case 191:
-#line 1785 "glsl_parser.yy" /* yacc.c:1646 */
+ case 186:
+#line 1721 "glsl_parser.yy" /* yacc.c:1646 */
{
(yyval.array_specifier) = (yyvsp[-2].array_specifier);
@@ -4975,11 +4890,11 @@ yyreduce:
"be unsized");
}
}
-#line 4979 "glsl_parser.cpp" /* yacc.c:1646 */
+#line 4894 "glsl_parser.cpp" /* yacc.c:1646 */
break;
- case 192:
-#line 1799 "glsl_parser.yy" /* yacc.c:1646 */
+ case 187:
+#line 1735 "glsl_parser.yy" /* yacc.c:1646 */
{
(yyval.array_specifier) = (yyvsp[-3].array_specifier);
@@ -4991,722 +4906,722 @@ yyreduce:
(yyval.array_specifier)->add_dimension((yyvsp[-1].expression));
}
-#line 4995 "glsl_parser.cpp" /* yacc.c:1646 */
+#line 4910 "glsl_parser.cpp" /* yacc.c:1646 */
break;
- case 194:
-#line 1815 "glsl_parser.yy" /* yacc.c:1646 */
+ case 189:
+#line 1751 "glsl_parser.yy" /* yacc.c:1646 */
{
(yyval.type_specifier) = (yyvsp[-1].type_specifier);
(yyval.type_specifier)->array_specifier = (yyvsp[0].array_specifier);
}
-#line 5004 "glsl_parser.cpp" /* yacc.c:1646 */
+#line 4919 "glsl_parser.cpp" /* yacc.c:1646 */
break;
- case 195:
-#line 1823 "glsl_parser.yy" /* yacc.c:1646 */
+ case 190:
+#line 1759 "glsl_parser.yy" /* yacc.c:1646 */
{
void *ctx = state;
(yyval.type_specifier) = new(ctx) ast_type_specifier((yyvsp[0].identifier));
(yyval.type_specifier)->set_location((yylsp[0]));
}
-#line 5014 "glsl_parser.cpp" /* yacc.c:1646 */
+#line 4929 "glsl_parser.cpp" /* yacc.c:1646 */
break;
- case 196:
-#line 1829 "glsl_parser.yy" /* yacc.c:1646 */
+ case 191:
+#line 1765 "glsl_parser.yy" /* yacc.c:1646 */
{
void *ctx = state;
(yyval.type_specifier) = new(ctx) ast_type_specifier((yyvsp[0].struct_specifier));
(yyval.type_specifier)->set_location((yylsp[0]));
}
-#line 5024 "glsl_parser.cpp" /* yacc.c:1646 */
+#line 4939 "glsl_parser.cpp" /* yacc.c:1646 */
break;
- case 197:
-#line 1835 "glsl_parser.yy" /* yacc.c:1646 */
+ case 192:
+#line 1771 "glsl_parser.yy" /* yacc.c:1646 */
{
void *ctx = state;
(yyval.type_specifier) = new(ctx) ast_type_specifier((yyvsp[0].identifier));
(yyval.type_specifier)->set_location((yylsp[0]));
}
-#line 5034 "glsl_parser.cpp" /* yacc.c:1646 */
+#line 4949 "glsl_parser.cpp" /* yacc.c:1646 */
break;
- case 198:
-#line 1843 "glsl_parser.yy" /* yacc.c:1646 */
+ case 193:
+#line 1779 "glsl_parser.yy" /* yacc.c:1646 */
{ (yyval.identifier) = "void"; }
-#line 5040 "glsl_parser.cpp" /* yacc.c:1646 */
+#line 4955 "glsl_parser.cpp" /* yacc.c:1646 */
break;
- case 199:
-#line 1844 "glsl_parser.yy" /* yacc.c:1646 */
+ case 194:
+#line 1780 "glsl_parser.yy" /* yacc.c:1646 */
{ (yyval.identifier) = "float"; }
-#line 5046 "glsl_parser.cpp" /* yacc.c:1646 */
+#line 4961 "glsl_parser.cpp" /* yacc.c:1646 */
break;
- case 200:
-#line 1845 "glsl_parser.yy" /* yacc.c:1646 */
+ case 195:
+#line 1781 "glsl_parser.yy" /* yacc.c:1646 */
{ (yyval.identifier) = "int"; }
-#line 5052 "glsl_parser.cpp" /* yacc.c:1646 */
+#line 4967 "glsl_parser.cpp" /* yacc.c:1646 */
break;
- case 201:
-#line 1846 "glsl_parser.yy" /* yacc.c:1646 */
+ case 196:
+#line 1782 "glsl_parser.yy" /* yacc.c:1646 */
{ (yyval.identifier) = "uint"; }
-#line 5058 "glsl_parser.cpp" /* yacc.c:1646 */
+#line 4973 "glsl_parser.cpp" /* yacc.c:1646 */
break;
- case 202:
-#line 1847 "glsl_parser.yy" /* yacc.c:1646 */
+ case 197:
+#line 1783 "glsl_parser.yy" /* yacc.c:1646 */
{ (yyval.identifier) = "bool"; }
-#line 5064 "glsl_parser.cpp" /* yacc.c:1646 */
+#line 4979 "glsl_parser.cpp" /* yacc.c:1646 */
break;
- case 203:
-#line 1848 "glsl_parser.yy" /* yacc.c:1646 */
+ case 198:
+#line 1784 "glsl_parser.yy" /* yacc.c:1646 */
{ (yyval.identifier) = "vec2"; }
-#line 5070 "glsl_parser.cpp" /* yacc.c:1646 */
+#line 4985 "glsl_parser.cpp" /* yacc.c:1646 */
break;
- case 204:
-#line 1849 "glsl_parser.yy" /* yacc.c:1646 */
+ case 199:
+#line 1785 "glsl_parser.yy" /* yacc.c:1646 */
{ (yyval.identifier) = "vec3"; }
-#line 5076 "glsl_parser.cpp" /* yacc.c:1646 */
+#line 4991 "glsl_parser.cpp" /* yacc.c:1646 */
break;
- case 205:
-#line 1850 "glsl_parser.yy" /* yacc.c:1646 */
+ case 200:
+#line 1786 "glsl_parser.yy" /* yacc.c:1646 */
{ (yyval.identifier) = "vec4"; }
-#line 5082 "glsl_parser.cpp" /* yacc.c:1646 */
+#line 4997 "glsl_parser.cpp" /* yacc.c:1646 */
break;
- case 206:
-#line 1851 "glsl_parser.yy" /* yacc.c:1646 */
+ case 201:
+#line 1787 "glsl_parser.yy" /* yacc.c:1646 */
{ (yyval.identifier) = "bvec2"; }
-#line 5088 "glsl_parser.cpp" /* yacc.c:1646 */
+#line 5003 "glsl_parser.cpp" /* yacc.c:1646 */
break;
- case 207:
-#line 1852 "glsl_parser.yy" /* yacc.c:1646 */
+ case 202:
+#line 1788 "glsl_parser.yy" /* yacc.c:1646 */
{ (yyval.identifier) = "bvec3"; }
-#line 5094 "glsl_parser.cpp" /* yacc.c:1646 */
+#line 5009 "glsl_parser.cpp" /* yacc.c:1646 */
break;
- case 208:
-#line 1853 "glsl_parser.yy" /* yacc.c:1646 */
+ case 203:
+#line 1789 "glsl_parser.yy" /* yacc.c:1646 */
{ (yyval.identifier) = "bvec4"; }
-#line 5100 "glsl_parser.cpp" /* yacc.c:1646 */
+#line 5015 "glsl_parser.cpp" /* yacc.c:1646 */
break;
- case 209:
-#line 1854 "glsl_parser.yy" /* yacc.c:1646 */
+ case 204:
+#line 1790 "glsl_parser.yy" /* yacc.c:1646 */
{ (yyval.identifier) = "ivec2"; }
-#line 5106 "glsl_parser.cpp" /* yacc.c:1646 */
+#line 5021 "glsl_parser.cpp" /* yacc.c:1646 */
break;
- case 210:
-#line 1855 "glsl_parser.yy" /* yacc.c:1646 */
+ case 205:
+#line 1791 "glsl_parser.yy" /* yacc.c:1646 */
{ (yyval.identifier) = "ivec3"; }
-#line 5112 "glsl_parser.cpp" /* yacc.c:1646 */
+#line 5027 "glsl_parser.cpp" /* yacc.c:1646 */
break;
- case 211:
-#line 1856 "glsl_parser.yy" /* yacc.c:1646 */
+ case 206:
+#line 1792 "glsl_parser.yy" /* yacc.c:1646 */
{ (yyval.identifier) = "ivec4"; }
-#line 5118 "glsl_parser.cpp" /* yacc.c:1646 */
+#line 5033 "glsl_parser.cpp" /* yacc.c:1646 */
break;
- case 212:
-#line 1857 "glsl_parser.yy" /* yacc.c:1646 */
+ case 207:
+#line 1793 "glsl_parser.yy" /* yacc.c:1646 */
{ (yyval.identifier) = "uvec2"; }
-#line 5124 "glsl_parser.cpp" /* yacc.c:1646 */
+#line 5039 "glsl_parser.cpp" /* yacc.c:1646 */
break;
- case 213:
-#line 1858 "glsl_parser.yy" /* yacc.c:1646 */
+ case 208:
+#line 1794 "glsl_parser.yy" /* yacc.c:1646 */
{ (yyval.identifier) = "uvec3"; }
-#line 5130 "glsl_parser.cpp" /* yacc.c:1646 */
+#line 5045 "glsl_parser.cpp" /* yacc.c:1646 */
break;
- case 214:
-#line 1859 "glsl_parser.yy" /* yacc.c:1646 */
+ case 209:
+#line 1795 "glsl_parser.yy" /* yacc.c:1646 */
{ (yyval.identifier) = "uvec4"; }
-#line 5136 "glsl_parser.cpp" /* yacc.c:1646 */
+#line 5051 "glsl_parser.cpp" /* yacc.c:1646 */
break;
- case 215:
-#line 1860 "glsl_parser.yy" /* yacc.c:1646 */
+ case 210:
+#line 1796 "glsl_parser.yy" /* yacc.c:1646 */
{ (yyval.identifier) = "mat2"; }
-#line 5142 "glsl_parser.cpp" /* yacc.c:1646 */
+#line 5057 "glsl_parser.cpp" /* yacc.c:1646 */
break;
- case 216:
-#line 1861 "glsl_parser.yy" /* yacc.c:1646 */
+ case 211:
+#line 1797 "glsl_parser.yy" /* yacc.c:1646 */
{ (yyval.identifier) = "mat2x3"; }
-#line 5148 "glsl_parser.cpp" /* yacc.c:1646 */
+#line 5063 "glsl_parser.cpp" /* yacc.c:1646 */
break;
- case 217:
-#line 1862 "glsl_parser.yy" /* yacc.c:1646 */
+ case 212:
+#line 1798 "glsl_parser.yy" /* yacc.c:1646 */
{ (yyval.identifier) = "mat2x4"; }
-#line 5154 "glsl_parser.cpp" /* yacc.c:1646 */
+#line 5069 "glsl_parser.cpp" /* yacc.c:1646 */
break;
- case 218:
-#line 1863 "glsl_parser.yy" /* yacc.c:1646 */
+ case 213:
+#line 1799 "glsl_parser.yy" /* yacc.c:1646 */
{ (yyval.identifier) = "mat3x2"; }
-#line 5160 "glsl_parser.cpp" /* yacc.c:1646 */
+#line 5075 "glsl_parser.cpp" /* yacc.c:1646 */
break;
- case 219:
-#line 1864 "glsl_parser.yy" /* yacc.c:1646 */
+ case 214:
+#line 1800 "glsl_parser.yy" /* yacc.c:1646 */
{ (yyval.identifier) = "mat3"; }
-#line 5166 "glsl_parser.cpp" /* yacc.c:1646 */
+#line 5081 "glsl_parser.cpp" /* yacc.c:1646 */
break;
- case 220:
-#line 1865 "glsl_parser.yy" /* yacc.c:1646 */
+ case 215:
+#line 1801 "glsl_parser.yy" /* yacc.c:1646 */
{ (yyval.identifier) = "mat3x4"; }
-#line 5172 "glsl_parser.cpp" /* yacc.c:1646 */
+#line 5087 "glsl_parser.cpp" /* yacc.c:1646 */
break;
- case 221:
-#line 1866 "glsl_parser.yy" /* yacc.c:1646 */
+ case 216:
+#line 1802 "glsl_parser.yy" /* yacc.c:1646 */
{ (yyval.identifier) = "mat4x2"; }
-#line 5178 "glsl_parser.cpp" /* yacc.c:1646 */
+#line 5093 "glsl_parser.cpp" /* yacc.c:1646 */
break;
- case 222:
-#line 1867 "glsl_parser.yy" /* yacc.c:1646 */
+ case 217:
+#line 1803 "glsl_parser.yy" /* yacc.c:1646 */
{ (yyval.identifier) = "mat4x3"; }
-#line 5184 "glsl_parser.cpp" /* yacc.c:1646 */
+#line 5099 "glsl_parser.cpp" /* yacc.c:1646 */
break;
- case 223:
-#line 1868 "glsl_parser.yy" /* yacc.c:1646 */
+ case 218:
+#line 1804 "glsl_parser.yy" /* yacc.c:1646 */
{ (yyval.identifier) = "mat4"; }
-#line 5190 "glsl_parser.cpp" /* yacc.c:1646 */
+#line 5105 "glsl_parser.cpp" /* yacc.c:1646 */
break;
- case 224:
-#line 1869 "glsl_parser.yy" /* yacc.c:1646 */
+ case 219:
+#line 1805 "glsl_parser.yy" /* yacc.c:1646 */
{ (yyval.identifier) = "sampler1D"; }
-#line 5196 "glsl_parser.cpp" /* yacc.c:1646 */
+#line 5111 "glsl_parser.cpp" /* yacc.c:1646 */
break;
- case 225:
-#line 1870 "glsl_parser.yy" /* yacc.c:1646 */
+ case 220:
+#line 1806 "glsl_parser.yy" /* yacc.c:1646 */
{ (yyval.identifier) = "sampler2D"; }
-#line 5202 "glsl_parser.cpp" /* yacc.c:1646 */
+#line 5117 "glsl_parser.cpp" /* yacc.c:1646 */
break;
- case 226:
-#line 1871 "glsl_parser.yy" /* yacc.c:1646 */
+ case 221:
+#line 1807 "glsl_parser.yy" /* yacc.c:1646 */
{ (yyval.identifier) = "sampler2DRect"; }
-#line 5208 "glsl_parser.cpp" /* yacc.c:1646 */
+#line 5123 "glsl_parser.cpp" /* yacc.c:1646 */
break;
- case 227:
-#line 1872 "glsl_parser.yy" /* yacc.c:1646 */
+ case 222:
+#line 1808 "glsl_parser.yy" /* yacc.c:1646 */
{ (yyval.identifier) = "sampler3D"; }
-#line 5214 "glsl_parser.cpp" /* yacc.c:1646 */
+#line 5129 "glsl_parser.cpp" /* yacc.c:1646 */
break;
- case 228:
-#line 1873 "glsl_parser.yy" /* yacc.c:1646 */
+ case 223:
+#line 1809 "glsl_parser.yy" /* yacc.c:1646 */
{ (yyval.identifier) = "samplerCube"; }
-#line 5220 "glsl_parser.cpp" /* yacc.c:1646 */
+#line 5135 "glsl_parser.cpp" /* yacc.c:1646 */
break;
- case 229:
-#line 1874 "glsl_parser.yy" /* yacc.c:1646 */
+ case 224:
+#line 1810 "glsl_parser.yy" /* yacc.c:1646 */
{ (yyval.identifier) = "samplerExternalOES"; }
-#line 5226 "glsl_parser.cpp" /* yacc.c:1646 */
+#line 5141 "glsl_parser.cpp" /* yacc.c:1646 */
break;
- case 230:
-#line 1875 "glsl_parser.yy" /* yacc.c:1646 */
+ case 225:
+#line 1811 "glsl_parser.yy" /* yacc.c:1646 */
{ (yyval.identifier) = "sampler1DShadow"; }
-#line 5232 "glsl_parser.cpp" /* yacc.c:1646 */
+#line 5147 "glsl_parser.cpp" /* yacc.c:1646 */
break;
- case 231:
-#line 1876 "glsl_parser.yy" /* yacc.c:1646 */
+ case 226:
+#line 1812 "glsl_parser.yy" /* yacc.c:1646 */
{ (yyval.identifier) = "sampler2DShadow"; }
-#line 5238 "glsl_parser.cpp" /* yacc.c:1646 */
+#line 5153 "glsl_parser.cpp" /* yacc.c:1646 */
break;
- case 232:
-#line 1877 "glsl_parser.yy" /* yacc.c:1646 */
+ case 227:
+#line 1813 "glsl_parser.yy" /* yacc.c:1646 */
{ (yyval.identifier) = "sampler2DRectShadow"; }
-#line 5244 "glsl_parser.cpp" /* yacc.c:1646 */
+#line 5159 "glsl_parser.cpp" /* yacc.c:1646 */
break;
- case 233:
-#line 1878 "glsl_parser.yy" /* yacc.c:1646 */
+ case 228:
+#line 1814 "glsl_parser.yy" /* yacc.c:1646 */
{ (yyval.identifier) = "samplerCubeShadow"; }
-#line 5250 "glsl_parser.cpp" /* yacc.c:1646 */
+#line 5165 "glsl_parser.cpp" /* yacc.c:1646 */
break;
- case 234:
-#line 1879 "glsl_parser.yy" /* yacc.c:1646 */
+ case 229:
+#line 1815 "glsl_parser.yy" /* yacc.c:1646 */
{ (yyval.identifier) = "sampler1DArray"; }
-#line 5256 "glsl_parser.cpp" /* yacc.c:1646 */
+#line 5171 "glsl_parser.cpp" /* yacc.c:1646 */
break;
- case 235:
-#line 1880 "glsl_parser.yy" /* yacc.c:1646 */
+ case 230:
+#line 1816 "glsl_parser.yy" /* yacc.c:1646 */
{ (yyval.identifier) = "sampler2DArray"; }
-#line 5262 "glsl_parser.cpp" /* yacc.c:1646 */
+#line 5177 "glsl_parser.cpp" /* yacc.c:1646 */
break;
- case 236:
-#line 1881 "glsl_parser.yy" /* yacc.c:1646 */
+ case 231:
+#line 1817 "glsl_parser.yy" /* yacc.c:1646 */
{ (yyval.identifier) = "sampler1DArrayShadow"; }
-#line 5268 "glsl_parser.cpp" /* yacc.c:1646 */
+#line 5183 "glsl_parser.cpp" /* yacc.c:1646 */
break;
- case 237:
-#line 1882 "glsl_parser.yy" /* yacc.c:1646 */
+ case 232:
+#line 1818 "glsl_parser.yy" /* yacc.c:1646 */
{ (yyval.identifier) = "sampler2DArrayShadow"; }
-#line 5274 "glsl_parser.cpp" /* yacc.c:1646 */
+#line 5189 "glsl_parser.cpp" /* yacc.c:1646 */
break;
- case 238:
-#line 1883 "glsl_parser.yy" /* yacc.c:1646 */
+ case 233:
+#line 1819 "glsl_parser.yy" /* yacc.c:1646 */
{ (yyval.identifier) = "samplerBuffer"; }
-#line 5280 "glsl_parser.cpp" /* yacc.c:1646 */
+#line 5195 "glsl_parser.cpp" /* yacc.c:1646 */
break;
- case 239:
-#line 1884 "glsl_parser.yy" /* yacc.c:1646 */
+ case 234:
+#line 1820 "glsl_parser.yy" /* yacc.c:1646 */
{ (yyval.identifier) = "samplerCubeArray"; }
-#line 5286 "glsl_parser.cpp" /* yacc.c:1646 */
+#line 5201 "glsl_parser.cpp" /* yacc.c:1646 */
break;
- case 240:
-#line 1885 "glsl_parser.yy" /* yacc.c:1646 */
+ case 235:
+#line 1821 "glsl_parser.yy" /* yacc.c:1646 */
{ (yyval.identifier) = "samplerCubeArrayShadow"; }
-#line 5292 "glsl_parser.cpp" /* yacc.c:1646 */
+#line 5207 "glsl_parser.cpp" /* yacc.c:1646 */
break;
- case 241:
-#line 1886 "glsl_parser.yy" /* yacc.c:1646 */
+ case 236:
+#line 1822 "glsl_parser.yy" /* yacc.c:1646 */
{ (yyval.identifier) = "isampler1D"; }
-#line 5298 "glsl_parser.cpp" /* yacc.c:1646 */
+#line 5213 "glsl_parser.cpp" /* yacc.c:1646 */
break;
- case 242:
-#line 1887 "glsl_parser.yy" /* yacc.c:1646 */
+ case 237:
+#line 1823 "glsl_parser.yy" /* yacc.c:1646 */
{ (yyval.identifier) = "isampler2D"; }
-#line 5304 "glsl_parser.cpp" /* yacc.c:1646 */
+#line 5219 "glsl_parser.cpp" /* yacc.c:1646 */
break;
- case 243:
-#line 1888 "glsl_parser.yy" /* yacc.c:1646 */
+ case 238:
+#line 1824 "glsl_parser.yy" /* yacc.c:1646 */
{ (yyval.identifier) = "isampler2DRect"; }
-#line 5310 "glsl_parser.cpp" /* yacc.c:1646 */
+#line 5225 "glsl_parser.cpp" /* yacc.c:1646 */
break;
- case 244:
-#line 1889 "glsl_parser.yy" /* yacc.c:1646 */
+ case 239:
+#line 1825 "glsl_parser.yy" /* yacc.c:1646 */
{ (yyval.identifier) = "isampler3D"; }
-#line 5316 "glsl_parser.cpp" /* yacc.c:1646 */
+#line 5231 "glsl_parser.cpp" /* yacc.c:1646 */
break;
- case 245:
-#line 1890 "glsl_parser.yy" /* yacc.c:1646 */
+ case 240:
+#line 1826 "glsl_parser.yy" /* yacc.c:1646 */
{ (yyval.identifier) = "isamplerCube"; }
-#line 5322 "glsl_parser.cpp" /* yacc.c:1646 */
+#line 5237 "glsl_parser.cpp" /* yacc.c:1646 */
break;
- case 246:
-#line 1891 "glsl_parser.yy" /* yacc.c:1646 */
+ case 241:
+#line 1827 "glsl_parser.yy" /* yacc.c:1646 */
{ (yyval.identifier) = "isampler1DArray"; }
-#line 5328 "glsl_parser.cpp" /* yacc.c:1646 */
+#line 5243 "glsl_parser.cpp" /* yacc.c:1646 */
break;
- case 247:
-#line 1892 "glsl_parser.yy" /* yacc.c:1646 */
+ case 242:
+#line 1828 "glsl_parser.yy" /* yacc.c:1646 */
{ (yyval.identifier) = "isampler2DArray"; }
-#line 5334 "glsl_parser.cpp" /* yacc.c:1646 */
+#line 5249 "glsl_parser.cpp" /* yacc.c:1646 */
break;
- case 248:
-#line 1893 "glsl_parser.yy" /* yacc.c:1646 */
+ case 243:
+#line 1829 "glsl_parser.yy" /* yacc.c:1646 */
{ (yyval.identifier) = "isamplerBuffer"; }
-#line 5340 "glsl_parser.cpp" /* yacc.c:1646 */
+#line 5255 "glsl_parser.cpp" /* yacc.c:1646 */
break;
- case 249:
-#line 1894 "glsl_parser.yy" /* yacc.c:1646 */
+ case 244:
+#line 1830 "glsl_parser.yy" /* yacc.c:1646 */
{ (yyval.identifier) = "isamplerCubeArray"; }
-#line 5346 "glsl_parser.cpp" /* yacc.c:1646 */
+#line 5261 "glsl_parser.cpp" /* yacc.c:1646 */
break;
- case 250:
-#line 1895 "glsl_parser.yy" /* yacc.c:1646 */
+ case 245:
+#line 1831 "glsl_parser.yy" /* yacc.c:1646 */
{ (yyval.identifier) = "usampler1D"; }
-#line 5352 "glsl_parser.cpp" /* yacc.c:1646 */
+#line 5267 "glsl_parser.cpp" /* yacc.c:1646 */
break;
- case 251:
-#line 1896 "glsl_parser.yy" /* yacc.c:1646 */
+ case 246:
+#line 1832 "glsl_parser.yy" /* yacc.c:1646 */
{ (yyval.identifier) = "usampler2D"; }
-#line 5358 "glsl_parser.cpp" /* yacc.c:1646 */
+#line 5273 "glsl_parser.cpp" /* yacc.c:1646 */
break;
- case 252:
-#line 1897 "glsl_parser.yy" /* yacc.c:1646 */
+ case 247:
+#line 1833 "glsl_parser.yy" /* yacc.c:1646 */
{ (yyval.identifier) = "usampler2DRect"; }
-#line 5364 "glsl_parser.cpp" /* yacc.c:1646 */
+#line 5279 "glsl_parser.cpp" /* yacc.c:1646 */
break;
- case 253:
-#line 1898 "glsl_parser.yy" /* yacc.c:1646 */
+ case 248:
+#line 1834 "glsl_parser.yy" /* yacc.c:1646 */
{ (yyval.identifier) = "usampler3D"; }
-#line 5370 "glsl_parser.cpp" /* yacc.c:1646 */
+#line 5285 "glsl_parser.cpp" /* yacc.c:1646 */
break;
- case 254:
-#line 1899 "glsl_parser.yy" /* yacc.c:1646 */
+ case 249:
+#line 1835 "glsl_parser.yy" /* yacc.c:1646 */
{ (yyval.identifier) = "usamplerCube"; }
-#line 5376 "glsl_parser.cpp" /* yacc.c:1646 */
+#line 5291 "glsl_parser.cpp" /* yacc.c:1646 */
break;
- case 255:
-#line 1900 "glsl_parser.yy" /* yacc.c:1646 */
+ case 250:
+#line 1836 "glsl_parser.yy" /* yacc.c:1646 */
{ (yyval.identifier) = "usampler1DArray"; }
-#line 5382 "glsl_parser.cpp" /* yacc.c:1646 */
+#line 5297 "glsl_parser.cpp" /* yacc.c:1646 */
break;
- case 256:
-#line 1901 "glsl_parser.yy" /* yacc.c:1646 */
+ case 251:
+#line 1837 "glsl_parser.yy" /* yacc.c:1646 */
{ (yyval.identifier) = "usampler2DArray"; }
-#line 5388 "glsl_parser.cpp" /* yacc.c:1646 */
+#line 5303 "glsl_parser.cpp" /* yacc.c:1646 */
break;
- case 257:
-#line 1902 "glsl_parser.yy" /* yacc.c:1646 */
+ case 252:
+#line 1838 "glsl_parser.yy" /* yacc.c:1646 */
{ (yyval.identifier) = "usamplerBuffer"; }
-#line 5394 "glsl_parser.cpp" /* yacc.c:1646 */
+#line 5309 "glsl_parser.cpp" /* yacc.c:1646 */
break;
- case 258:
-#line 1903 "glsl_parser.yy" /* yacc.c:1646 */
+ case 253:
+#line 1839 "glsl_parser.yy" /* yacc.c:1646 */
{ (yyval.identifier) = "usamplerCubeArray"; }
-#line 5400 "glsl_parser.cpp" /* yacc.c:1646 */
+#line 5315 "glsl_parser.cpp" /* yacc.c:1646 */
break;
- case 259:
-#line 1904 "glsl_parser.yy" /* yacc.c:1646 */
+ case 254:
+#line 1840 "glsl_parser.yy" /* yacc.c:1646 */
{ (yyval.identifier) = "sampler2DMS"; }
-#line 5406 "glsl_parser.cpp" /* yacc.c:1646 */
+#line 5321 "glsl_parser.cpp" /* yacc.c:1646 */
break;
- case 260:
-#line 1905 "glsl_parser.yy" /* yacc.c:1646 */
+ case 255:
+#line 1841 "glsl_parser.yy" /* yacc.c:1646 */
{ (yyval.identifier) = "isampler2DMS"; }
-#line 5412 "glsl_parser.cpp" /* yacc.c:1646 */
+#line 5327 "glsl_parser.cpp" /* yacc.c:1646 */
break;
- case 261:
-#line 1906 "glsl_parser.yy" /* yacc.c:1646 */
+ case 256:
+#line 1842 "glsl_parser.yy" /* yacc.c:1646 */
{ (yyval.identifier) = "usampler2DMS"; }
-#line 5418 "glsl_parser.cpp" /* yacc.c:1646 */
+#line 5333 "glsl_parser.cpp" /* yacc.c:1646 */
break;
- case 262:
-#line 1907 "glsl_parser.yy" /* yacc.c:1646 */
+ case 257:
+#line 1843 "glsl_parser.yy" /* yacc.c:1646 */
{ (yyval.identifier) = "sampler2DMSArray"; }
-#line 5424 "glsl_parser.cpp" /* yacc.c:1646 */
+#line 5339 "glsl_parser.cpp" /* yacc.c:1646 */
break;
- case 263:
-#line 1908 "glsl_parser.yy" /* yacc.c:1646 */
+ case 258:
+#line 1844 "glsl_parser.yy" /* yacc.c:1646 */
{ (yyval.identifier) = "isampler2DMSArray"; }
-#line 5430 "glsl_parser.cpp" /* yacc.c:1646 */
+#line 5345 "glsl_parser.cpp" /* yacc.c:1646 */
break;
- case 264:
-#line 1909 "glsl_parser.yy" /* yacc.c:1646 */
+ case 259:
+#line 1845 "glsl_parser.yy" /* yacc.c:1646 */
{ (yyval.identifier) = "usampler2DMSArray"; }
-#line 5436 "glsl_parser.cpp" /* yacc.c:1646 */
+#line 5351 "glsl_parser.cpp" /* yacc.c:1646 */
break;
- case 265:
-#line 1910 "glsl_parser.yy" /* yacc.c:1646 */
+ case 260:
+#line 1846 "glsl_parser.yy" /* yacc.c:1646 */
{ (yyval.identifier) = "image1D"; }
-#line 5442 "glsl_parser.cpp" /* yacc.c:1646 */
+#line 5357 "glsl_parser.cpp" /* yacc.c:1646 */
break;
- case 266:
-#line 1911 "glsl_parser.yy" /* yacc.c:1646 */
+ case 261:
+#line 1847 "glsl_parser.yy" /* yacc.c:1646 */
{ (yyval.identifier) = "image2D"; }
-#line 5448 "glsl_parser.cpp" /* yacc.c:1646 */
+#line 5363 "glsl_parser.cpp" /* yacc.c:1646 */
break;
- case 267:
-#line 1912 "glsl_parser.yy" /* yacc.c:1646 */
+ case 262:
+#line 1848 "glsl_parser.yy" /* yacc.c:1646 */
{ (yyval.identifier) = "image3D"; }
-#line 5454 "glsl_parser.cpp" /* yacc.c:1646 */
+#line 5369 "glsl_parser.cpp" /* yacc.c:1646 */
break;
- case 268:
-#line 1913 "glsl_parser.yy" /* yacc.c:1646 */
+ case 263:
+#line 1849 "glsl_parser.yy" /* yacc.c:1646 */
{ (yyval.identifier) = "image2DRect"; }
-#line 5460 "glsl_parser.cpp" /* yacc.c:1646 */
+#line 5375 "glsl_parser.cpp" /* yacc.c:1646 */
break;
- case 269:
-#line 1914 "glsl_parser.yy" /* yacc.c:1646 */
+ case 264:
+#line 1850 "glsl_parser.yy" /* yacc.c:1646 */
{ (yyval.identifier) = "imageCube"; }
-#line 5466 "glsl_parser.cpp" /* yacc.c:1646 */
+#line 5381 "glsl_parser.cpp" /* yacc.c:1646 */
break;
- case 270:
-#line 1915 "glsl_parser.yy" /* yacc.c:1646 */
+ case 265:
+#line 1851 "glsl_parser.yy" /* yacc.c:1646 */
{ (yyval.identifier) = "imageBuffer"; }
-#line 5472 "glsl_parser.cpp" /* yacc.c:1646 */
+#line 5387 "glsl_parser.cpp" /* yacc.c:1646 */
break;
- case 271:
-#line 1916 "glsl_parser.yy" /* yacc.c:1646 */
+ case 266:
+#line 1852 "glsl_parser.yy" /* yacc.c:1646 */
{ (yyval.identifier) = "image1DArray"; }
-#line 5478 "glsl_parser.cpp" /* yacc.c:1646 */
+#line 5393 "glsl_parser.cpp" /* yacc.c:1646 */
break;
- case 272:
-#line 1917 "glsl_parser.yy" /* yacc.c:1646 */
+ case 267:
+#line 1853 "glsl_parser.yy" /* yacc.c:1646 */
{ (yyval.identifier) = "image2DArray"; }
-#line 5484 "glsl_parser.cpp" /* yacc.c:1646 */
+#line 5399 "glsl_parser.cpp" /* yacc.c:1646 */
break;
- case 273:
-#line 1918 "glsl_parser.yy" /* yacc.c:1646 */
+ case 268:
+#line 1854 "glsl_parser.yy" /* yacc.c:1646 */
{ (yyval.identifier) = "imageCubeArray"; }
-#line 5490 "glsl_parser.cpp" /* yacc.c:1646 */
+#line 5405 "glsl_parser.cpp" /* yacc.c:1646 */
break;
- case 274:
-#line 1919 "glsl_parser.yy" /* yacc.c:1646 */
+ case 269:
+#line 1855 "glsl_parser.yy" /* yacc.c:1646 */
{ (yyval.identifier) = "image2DMS"; }
-#line 5496 "glsl_parser.cpp" /* yacc.c:1646 */
+#line 5411 "glsl_parser.cpp" /* yacc.c:1646 */
break;
- case 275:
-#line 1920 "glsl_parser.yy" /* yacc.c:1646 */
+ case 270:
+#line 1856 "glsl_parser.yy" /* yacc.c:1646 */
{ (yyval.identifier) = "image2DMSArray"; }
-#line 5502 "glsl_parser.cpp" /* yacc.c:1646 */
+#line 5417 "glsl_parser.cpp" /* yacc.c:1646 */
break;
- case 276:
-#line 1921 "glsl_parser.yy" /* yacc.c:1646 */
+ case 271:
+#line 1857 "glsl_parser.yy" /* yacc.c:1646 */
{ (yyval.identifier) = "iimage1D"; }
-#line 5508 "glsl_parser.cpp" /* yacc.c:1646 */
+#line 5423 "glsl_parser.cpp" /* yacc.c:1646 */
break;
- case 277:
-#line 1922 "glsl_parser.yy" /* yacc.c:1646 */
+ case 272:
+#line 1858 "glsl_parser.yy" /* yacc.c:1646 */
{ (yyval.identifier) = "iimage2D"; }
-#line 5514 "glsl_parser.cpp" /* yacc.c:1646 */
+#line 5429 "glsl_parser.cpp" /* yacc.c:1646 */
break;
- case 278:
-#line 1923 "glsl_parser.yy" /* yacc.c:1646 */
+ case 273:
+#line 1859 "glsl_parser.yy" /* yacc.c:1646 */
{ (yyval.identifier) = "iimage3D"; }
-#line 5520 "glsl_parser.cpp" /* yacc.c:1646 */
+#line 5435 "glsl_parser.cpp" /* yacc.c:1646 */
break;
- case 279:
-#line 1924 "glsl_parser.yy" /* yacc.c:1646 */
+ case 274:
+#line 1860 "glsl_parser.yy" /* yacc.c:1646 */
{ (yyval.identifier) = "iimage2DRect"; }
-#line 5526 "glsl_parser.cpp" /* yacc.c:1646 */
+#line 5441 "glsl_parser.cpp" /* yacc.c:1646 */
break;
- case 280:
-#line 1925 "glsl_parser.yy" /* yacc.c:1646 */
+ case 275:
+#line 1861 "glsl_parser.yy" /* yacc.c:1646 */
{ (yyval.identifier) = "iimageCube"; }
-#line 5532 "glsl_parser.cpp" /* yacc.c:1646 */
+#line 5447 "glsl_parser.cpp" /* yacc.c:1646 */
break;
- case 281:
-#line 1926 "glsl_parser.yy" /* yacc.c:1646 */
+ case 276:
+#line 1862 "glsl_parser.yy" /* yacc.c:1646 */
{ (yyval.identifier) = "iimageBuffer"; }
-#line 5538 "glsl_parser.cpp" /* yacc.c:1646 */
+#line 5453 "glsl_parser.cpp" /* yacc.c:1646 */
break;
- case 282:
-#line 1927 "glsl_parser.yy" /* yacc.c:1646 */
+ case 277:
+#line 1863 "glsl_parser.yy" /* yacc.c:1646 */
{ (yyval.identifier) = "iimage1DArray"; }
-#line 5544 "glsl_parser.cpp" /* yacc.c:1646 */
+#line 5459 "glsl_parser.cpp" /* yacc.c:1646 */
break;
- case 283:
-#line 1928 "glsl_parser.yy" /* yacc.c:1646 */
+ case 278:
+#line 1864 "glsl_parser.yy" /* yacc.c:1646 */
{ (yyval.identifier) = "iimage2DArray"; }
-#line 5550 "glsl_parser.cpp" /* yacc.c:1646 */
+#line 5465 "glsl_parser.cpp" /* yacc.c:1646 */
break;
- case 284:
-#line 1929 "glsl_parser.yy" /* yacc.c:1646 */
+ case 279:
+#line 1865 "glsl_parser.yy" /* yacc.c:1646 */
{ (yyval.identifier) = "iimageCubeArray"; }
-#line 5556 "glsl_parser.cpp" /* yacc.c:1646 */
+#line 5471 "glsl_parser.cpp" /* yacc.c:1646 */
break;
- case 285:
-#line 1930 "glsl_parser.yy" /* yacc.c:1646 */
+ case 280:
+#line 1866 "glsl_parser.yy" /* yacc.c:1646 */
{ (yyval.identifier) = "iimage2DMS"; }
-#line 5562 "glsl_parser.cpp" /* yacc.c:1646 */
+#line 5477 "glsl_parser.cpp" /* yacc.c:1646 */
break;
- case 286:
-#line 1931 "glsl_parser.yy" /* yacc.c:1646 */
+ case 281:
+#line 1867 "glsl_parser.yy" /* yacc.c:1646 */
{ (yyval.identifier) = "iimage2DMSArray"; }
-#line 5568 "glsl_parser.cpp" /* yacc.c:1646 */
+#line 5483 "glsl_parser.cpp" /* yacc.c:1646 */
break;
- case 287:
-#line 1932 "glsl_parser.yy" /* yacc.c:1646 */
+ case 282:
+#line 1868 "glsl_parser.yy" /* yacc.c:1646 */
{ (yyval.identifier) = "uimage1D"; }
-#line 5574 "glsl_parser.cpp" /* yacc.c:1646 */
+#line 5489 "glsl_parser.cpp" /* yacc.c:1646 */
break;
- case 288:
-#line 1933 "glsl_parser.yy" /* yacc.c:1646 */
+ case 283:
+#line 1869 "glsl_parser.yy" /* yacc.c:1646 */
{ (yyval.identifier) = "uimage2D"; }
-#line 5580 "glsl_parser.cpp" /* yacc.c:1646 */
+#line 5495 "glsl_parser.cpp" /* yacc.c:1646 */
break;
- case 289:
-#line 1934 "glsl_parser.yy" /* yacc.c:1646 */
+ case 284:
+#line 1870 "glsl_parser.yy" /* yacc.c:1646 */
{ (yyval.identifier) = "uimage3D"; }
-#line 5586 "glsl_parser.cpp" /* yacc.c:1646 */
+#line 5501 "glsl_parser.cpp" /* yacc.c:1646 */
break;
- case 290:
-#line 1935 "glsl_parser.yy" /* yacc.c:1646 */
+ case 285:
+#line 1871 "glsl_parser.yy" /* yacc.c:1646 */
{ (yyval.identifier) = "uimage2DRect"; }
-#line 5592 "glsl_parser.cpp" /* yacc.c:1646 */
+#line 5507 "glsl_parser.cpp" /* yacc.c:1646 */
break;
- case 291:
-#line 1936 "glsl_parser.yy" /* yacc.c:1646 */
+ case 286:
+#line 1872 "glsl_parser.yy" /* yacc.c:1646 */
{ (yyval.identifier) = "uimageCube"; }
-#line 5598 "glsl_parser.cpp" /* yacc.c:1646 */
+#line 5513 "glsl_parser.cpp" /* yacc.c:1646 */
break;
- case 292:
-#line 1937 "glsl_parser.yy" /* yacc.c:1646 */
+ case 287:
+#line 1873 "glsl_parser.yy" /* yacc.c:1646 */
{ (yyval.identifier) = "uimageBuffer"; }
-#line 5604 "glsl_parser.cpp" /* yacc.c:1646 */
+#line 5519 "glsl_parser.cpp" /* yacc.c:1646 */
break;
- case 293:
-#line 1938 "glsl_parser.yy" /* yacc.c:1646 */
+ case 288:
+#line 1874 "glsl_parser.yy" /* yacc.c:1646 */
{ (yyval.identifier) = "uimage1DArray"; }
-#line 5610 "glsl_parser.cpp" /* yacc.c:1646 */
+#line 5525 "glsl_parser.cpp" /* yacc.c:1646 */
break;
- case 294:
-#line 1939 "glsl_parser.yy" /* yacc.c:1646 */
+ case 289:
+#line 1875 "glsl_parser.yy" /* yacc.c:1646 */
{ (yyval.identifier) = "uimage2DArray"; }
-#line 5616 "glsl_parser.cpp" /* yacc.c:1646 */
+#line 5531 "glsl_parser.cpp" /* yacc.c:1646 */
break;
- case 295:
-#line 1940 "glsl_parser.yy" /* yacc.c:1646 */
+ case 290:
+#line 1876 "glsl_parser.yy" /* yacc.c:1646 */
{ (yyval.identifier) = "uimageCubeArray"; }
-#line 5622 "glsl_parser.cpp" /* yacc.c:1646 */
+#line 5537 "glsl_parser.cpp" /* yacc.c:1646 */
break;
- case 296:
-#line 1941 "glsl_parser.yy" /* yacc.c:1646 */
+ case 291:
+#line 1877 "glsl_parser.yy" /* yacc.c:1646 */
{ (yyval.identifier) = "uimage2DMS"; }
-#line 5628 "glsl_parser.cpp" /* yacc.c:1646 */
+#line 5543 "glsl_parser.cpp" /* yacc.c:1646 */
break;
- case 297:
-#line 1942 "glsl_parser.yy" /* yacc.c:1646 */
+ case 292:
+#line 1878 "glsl_parser.yy" /* yacc.c:1646 */
{ (yyval.identifier) = "uimage2DMSArray"; }
-#line 5634 "glsl_parser.cpp" /* yacc.c:1646 */
+#line 5549 "glsl_parser.cpp" /* yacc.c:1646 */
break;
- case 298:
-#line 1943 "glsl_parser.yy" /* yacc.c:1646 */
+ case 293:
+#line 1879 "glsl_parser.yy" /* yacc.c:1646 */
{ (yyval.identifier) = "atomic_uint"; }
-#line 5640 "glsl_parser.cpp" /* yacc.c:1646 */
+#line 5555 "glsl_parser.cpp" /* yacc.c:1646 */
break;
- case 299:
-#line 1948 "glsl_parser.yy" /* yacc.c:1646 */
+ case 294:
+#line 1884 "glsl_parser.yy" /* yacc.c:1646 */
{
state->check_precision_qualifiers_allowed(&(yylsp[0]));
(yyval.n) = ast_precision_high;
}
-#line 5649 "glsl_parser.cpp" /* yacc.c:1646 */
+#line 5564 "glsl_parser.cpp" /* yacc.c:1646 */
break;
- case 300:
-#line 1953 "glsl_parser.yy" /* yacc.c:1646 */
+ case 295:
+#line 1889 "glsl_parser.yy" /* yacc.c:1646 */
{
state->check_precision_qualifiers_allowed(&(yylsp[0]));
(yyval.n) = ast_precision_medium;
}
-#line 5658 "glsl_parser.cpp" /* yacc.c:1646 */
+#line 5573 "glsl_parser.cpp" /* yacc.c:1646 */
break;
- case 301:
-#line 1958 "glsl_parser.yy" /* yacc.c:1646 */
+ case 296:
+#line 1894 "glsl_parser.yy" /* yacc.c:1646 */
{
state->check_precision_qualifiers_allowed(&(yylsp[0]));
(yyval.n) = ast_precision_low;
}
-#line 5667 "glsl_parser.cpp" /* yacc.c:1646 */
+#line 5582 "glsl_parser.cpp" /* yacc.c:1646 */
break;
- case 302:
-#line 1966 "glsl_parser.yy" /* yacc.c:1646 */
+ case 297:
+#line 1902 "glsl_parser.yy" /* yacc.c:1646 */
{
void *ctx = state;
(yyval.struct_specifier) = new(ctx) ast_struct_specifier((yyvsp[-3].identifier), (yyvsp[-1].declarator_list));
(yyval.struct_specifier)->set_location_range((yylsp[-3]), (yylsp[0]));
state->symbols->add_type((yyvsp[-3].identifier), glsl_type::void_type);
}
-#line 5678 "glsl_parser.cpp" /* yacc.c:1646 */
+#line 5593 "glsl_parser.cpp" /* yacc.c:1646 */
break;
- case 303:
-#line 1973 "glsl_parser.yy" /* yacc.c:1646 */
+ case 298:
+#line 1909 "glsl_parser.yy" /* yacc.c:1646 */
{
void *ctx = state;
(yyval.struct_specifier) = new(ctx) ast_struct_specifier(NULL, (yyvsp[-1].declarator_list));
(yyval.struct_specifier)->set_location_range((yylsp[-2]), (yylsp[0]));
}
-#line 5688 "glsl_parser.cpp" /* yacc.c:1646 */
+#line 5603 "glsl_parser.cpp" /* yacc.c:1646 */
break;
- case 304:
-#line 1982 "glsl_parser.yy" /* yacc.c:1646 */
+ case 299:
+#line 1918 "glsl_parser.yy" /* yacc.c:1646 */
{
(yyval.declarator_list) = (yyvsp[0].declarator_list);
(yyvsp[0].declarator_list)->link.self_link();
}
-#line 5697 "glsl_parser.cpp" /* yacc.c:1646 */
+#line 5612 "glsl_parser.cpp" /* yacc.c:1646 */
break;
- case 305:
-#line 1987 "glsl_parser.yy" /* yacc.c:1646 */
+ case 300:
+#line 1923 "glsl_parser.yy" /* yacc.c:1646 */
{
(yyval.declarator_list) = (yyvsp[-1].declarator_list);
(yyval.declarator_list)->link.insert_before(& (yyvsp[0].declarator_list)->link);
}
-#line 5706 "glsl_parser.cpp" /* yacc.c:1646 */
+#line 5621 "glsl_parser.cpp" /* yacc.c:1646 */
break;
- case 306:
-#line 1995 "glsl_parser.yy" /* yacc.c:1646 */
+ case 301:
+#line 1931 "glsl_parser.yy" /* yacc.c:1646 */
{
void *ctx = state;
ast_fully_specified_type *const type = (yyvsp[-2].fully_specified_type);
@@ -5722,145 +5637,145 @@ yyreduce:
(yyval.declarator_list)->declarations.push_degenerate_list_at_head(& (yyvsp[-1].declaration)->link);
}
-#line 5726 "glsl_parser.cpp" /* yacc.c:1646 */
+#line 5641 "glsl_parser.cpp" /* yacc.c:1646 */
break;
- case 307:
-#line 2014 "glsl_parser.yy" /* yacc.c:1646 */
+ case 302:
+#line 1950 "glsl_parser.yy" /* yacc.c:1646 */
{
(yyval.declaration) = (yyvsp[0].declaration);
(yyvsp[0].declaration)->link.self_link();
}
-#line 5735 "glsl_parser.cpp" /* yacc.c:1646 */
+#line 5650 "glsl_parser.cpp" /* yacc.c:1646 */
break;
- case 308:
-#line 2019 "glsl_parser.yy" /* yacc.c:1646 */
+ case 303:
+#line 1955 "glsl_parser.yy" /* yacc.c:1646 */
{
(yyval.declaration) = (yyvsp[-2].declaration);
(yyval.declaration)->link.insert_before(& (yyvsp[0].declaration)->link);
}
-#line 5744 "glsl_parser.cpp" /* yacc.c:1646 */
+#line 5659 "glsl_parser.cpp" /* yacc.c:1646 */
break;
- case 309:
-#line 2027 "glsl_parser.yy" /* yacc.c:1646 */
+ case 304:
+#line 1963 "glsl_parser.yy" /* yacc.c:1646 */
{
void *ctx = state;
(yyval.declaration) = new(ctx) ast_declaration((yyvsp[0].identifier), NULL, NULL);
(yyval.declaration)->set_location((yylsp[0]));
}
-#line 5754 "glsl_parser.cpp" /* yacc.c:1646 */
+#line 5669 "glsl_parser.cpp" /* yacc.c:1646 */
break;
- case 310:
-#line 2033 "glsl_parser.yy" /* yacc.c:1646 */
+ case 305:
+#line 1969 "glsl_parser.yy" /* yacc.c:1646 */
{
void *ctx = state;
(yyval.declaration) = new(ctx) ast_declaration((yyvsp[-1].identifier), (yyvsp[0].array_specifier), NULL);
(yyval.declaration)->set_location_range((yylsp[-1]), (yylsp[0]));
}
-#line 5764 "glsl_parser.cpp" /* yacc.c:1646 */
+#line 5679 "glsl_parser.cpp" /* yacc.c:1646 */
break;
- case 312:
-#line 2043 "glsl_parser.yy" /* yacc.c:1646 */
+ case 307:
+#line 1979 "glsl_parser.yy" /* yacc.c:1646 */
{
(yyval.expression) = (yyvsp[-1].expression);
}
-#line 5772 "glsl_parser.cpp" /* yacc.c:1646 */
+#line 5687 "glsl_parser.cpp" /* yacc.c:1646 */
break;
- case 313:
-#line 2047 "glsl_parser.yy" /* yacc.c:1646 */
+ case 308:
+#line 1983 "glsl_parser.yy" /* yacc.c:1646 */
{
(yyval.expression) = (yyvsp[-2].expression);
}
-#line 5780 "glsl_parser.cpp" /* yacc.c:1646 */
+#line 5695 "glsl_parser.cpp" /* yacc.c:1646 */
break;
- case 314:
-#line 2054 "glsl_parser.yy" /* yacc.c:1646 */
+ case 309:
+#line 1990 "glsl_parser.yy" /* yacc.c:1646 */
{
void *ctx = state;
(yyval.expression) = new(ctx) ast_aggregate_initializer();
(yyval.expression)->set_location((yylsp[0]));
(yyval.expression)->expressions.push_tail(& (yyvsp[0].expression)->link);
}
-#line 5791 "glsl_parser.cpp" /* yacc.c:1646 */
+#line 5706 "glsl_parser.cpp" /* yacc.c:1646 */
break;
- case 315:
-#line 2061 "glsl_parser.yy" /* yacc.c:1646 */
+ case 310:
+#line 1997 "glsl_parser.yy" /* yacc.c:1646 */
{
(yyvsp[-2].expression)->expressions.push_tail(& (yyvsp[0].expression)->link);
}
-#line 5799 "glsl_parser.cpp" /* yacc.c:1646 */
+#line 5714 "glsl_parser.cpp" /* yacc.c:1646 */
break;
- case 317:
-#line 2073 "glsl_parser.yy" /* yacc.c:1646 */
+ case 312:
+#line 2009 "glsl_parser.yy" /* yacc.c:1646 */
{ (yyval.node) = (ast_node *) (yyvsp[0].compound_statement); }
-#line 5805 "glsl_parser.cpp" /* yacc.c:1646 */
+#line 5720 "glsl_parser.cpp" /* yacc.c:1646 */
break;
- case 325:
-#line 2088 "glsl_parser.yy" /* yacc.c:1646 */
+ case 320:
+#line 2024 "glsl_parser.yy" /* yacc.c:1646 */
{
void *ctx = state;
(yyval.compound_statement) = new(ctx) ast_compound_statement(true, NULL);
(yyval.compound_statement)->set_location_range((yylsp[-1]), (yylsp[0]));
}
-#line 5815 "glsl_parser.cpp" /* yacc.c:1646 */
+#line 5730 "glsl_parser.cpp" /* yacc.c:1646 */
break;
- case 326:
-#line 2094 "glsl_parser.yy" /* yacc.c:1646 */
+ case 321:
+#line 2030 "glsl_parser.yy" /* yacc.c:1646 */
{
state->symbols->push_scope();
}
-#line 5823 "glsl_parser.cpp" /* yacc.c:1646 */
+#line 5738 "glsl_parser.cpp" /* yacc.c:1646 */
break;
- case 327:
-#line 2098 "glsl_parser.yy" /* yacc.c:1646 */
+ case 322:
+#line 2034 "glsl_parser.yy" /* yacc.c:1646 */
{
void *ctx = state;
(yyval.compound_statement) = new(ctx) ast_compound_statement(true, (yyvsp[-1].node));
(yyval.compound_statement)->set_location_range((yylsp[-3]), (yylsp[0]));
state->symbols->pop_scope();
}
-#line 5834 "glsl_parser.cpp" /* yacc.c:1646 */
+#line 5749 "glsl_parser.cpp" /* yacc.c:1646 */
break;
- case 328:
-#line 2107 "glsl_parser.yy" /* yacc.c:1646 */
+ case 323:
+#line 2043 "glsl_parser.yy" /* yacc.c:1646 */
{ (yyval.node) = (ast_node *) (yyvsp[0].compound_statement); }
-#line 5840 "glsl_parser.cpp" /* yacc.c:1646 */
+#line 5755 "glsl_parser.cpp" /* yacc.c:1646 */
break;
- case 330:
-#line 2113 "glsl_parser.yy" /* yacc.c:1646 */
+ case 325:
+#line 2049 "glsl_parser.yy" /* yacc.c:1646 */
{
void *ctx = state;
(yyval.compound_statement) = new(ctx) ast_compound_statement(false, NULL);
(yyval.compound_statement)->set_location_range((yylsp[-1]), (yylsp[0]));
}
-#line 5850 "glsl_parser.cpp" /* yacc.c:1646 */
+#line 5765 "glsl_parser.cpp" /* yacc.c:1646 */
break;
- case 331:
-#line 2119 "glsl_parser.yy" /* yacc.c:1646 */
+ case 326:
+#line 2055 "glsl_parser.yy" /* yacc.c:1646 */
{
void *ctx = state;
(yyval.compound_statement) = new(ctx) ast_compound_statement(false, (yyvsp[-1].node));
(yyval.compound_statement)->set_location_range((yylsp[-2]), (yylsp[0]));
}
-#line 5860 "glsl_parser.cpp" /* yacc.c:1646 */
+#line 5775 "glsl_parser.cpp" /* yacc.c:1646 */
break;
- case 332:
-#line 2128 "glsl_parser.yy" /* yacc.c:1646 */
+ case 327:
+#line 2064 "glsl_parser.yy" /* yacc.c:1646 */
{
if ((yyvsp[0].node) == NULL) {
_mesa_glsl_error(& (yylsp[0]), state, "<nil> statement");
@@ -5870,11 +5785,11 @@ yyreduce:
(yyval.node) = (yyvsp[0].node);
(yyval.node)->link.self_link();
}
-#line 5874 "glsl_parser.cpp" /* yacc.c:1646 */
+#line 5789 "glsl_parser.cpp" /* yacc.c:1646 */
break;
- case 333:
-#line 2138 "glsl_parser.yy" /* yacc.c:1646 */
+ case 328:
+#line 2074 "glsl_parser.yy" /* yacc.c:1646 */
{
if ((yyvsp[0].node) == NULL) {
_mesa_glsl_error(& (yylsp[0]), state, "<nil> statement");
@@ -5883,67 +5798,67 @@ yyreduce:
(yyval.node) = (yyvsp[-1].node);
(yyval.node)->link.insert_before(& (yyvsp[0].node)->link);
}
-#line 5887 "glsl_parser.cpp" /* yacc.c:1646 */
+#line 5802 "glsl_parser.cpp" /* yacc.c:1646 */
break;
- case 334:
-#line 2150 "glsl_parser.yy" /* yacc.c:1646 */
+ case 329:
+#line 2086 "glsl_parser.yy" /* yacc.c:1646 */
{
void *ctx = state;
(yyval.node) = new(ctx) ast_expression_statement(NULL);
(yyval.node)->set_location((yylsp[0]));
}
-#line 5897 "glsl_parser.cpp" /* yacc.c:1646 */
+#line 5812 "glsl_parser.cpp" /* yacc.c:1646 */
break;
- case 335:
-#line 2156 "glsl_parser.yy" /* yacc.c:1646 */
+ case 330:
+#line 2092 "glsl_parser.yy" /* yacc.c:1646 */
{
void *ctx = state;
(yyval.node) = new(ctx) ast_expression_statement((yyvsp[-1].expression));
(yyval.node)->set_location((yylsp[-1]));
}
-#line 5907 "glsl_parser.cpp" /* yacc.c:1646 */
+#line 5822 "glsl_parser.cpp" /* yacc.c:1646 */
break;
- case 336:
-#line 2165 "glsl_parser.yy" /* yacc.c:1646 */
+ case 331:
+#line 2101 "glsl_parser.yy" /* yacc.c:1646 */
{
(yyval.node) = new(state) ast_selection_statement((yyvsp[-2].expression), (yyvsp[0].selection_rest_statement).then_statement,
(yyvsp[0].selection_rest_statement).else_statement);
(yyval.node)->set_location_range((yylsp[-4]), (yylsp[0]));
}
-#line 5917 "glsl_parser.cpp" /* yacc.c:1646 */
+#line 5832 "glsl_parser.cpp" /* yacc.c:1646 */
break;
- case 337:
-#line 2174 "glsl_parser.yy" /* yacc.c:1646 */
+ case 332:
+#line 2110 "glsl_parser.yy" /* yacc.c:1646 */
{
(yyval.selection_rest_statement).then_statement = (yyvsp[-2].node);
(yyval.selection_rest_statement).else_statement = (yyvsp[0].node);
}
-#line 5926 "glsl_parser.cpp" /* yacc.c:1646 */
+#line 5841 "glsl_parser.cpp" /* yacc.c:1646 */
break;
- case 338:
-#line 2179 "glsl_parser.yy" /* yacc.c:1646 */
+ case 333:
+#line 2115 "glsl_parser.yy" /* yacc.c:1646 */
{
(yyval.selection_rest_statement).then_statement = (yyvsp[0].node);
(yyval.selection_rest_statement).else_statement = NULL;
}
-#line 5935 "glsl_parser.cpp" /* yacc.c:1646 */
+#line 5850 "glsl_parser.cpp" /* yacc.c:1646 */
break;
- case 339:
-#line 2187 "glsl_parser.yy" /* yacc.c:1646 */
+ case 334:
+#line 2123 "glsl_parser.yy" /* yacc.c:1646 */
{
(yyval.node) = (ast_node *) (yyvsp[0].expression);
}
-#line 5943 "glsl_parser.cpp" /* yacc.c:1646 */
+#line 5858 "glsl_parser.cpp" /* yacc.c:1646 */
break;
- case 340:
-#line 2191 "glsl_parser.yy" /* yacc.c:1646 */
+ case 335:
+#line 2127 "glsl_parser.yy" /* yacc.c:1646 */
{
void *ctx = state;
ast_declaration *decl = new(ctx) ast_declaration((yyvsp[-2].identifier), NULL, (yyvsp[0].expression));
@@ -5954,56 +5869,56 @@ yyreduce:
declarator->declarations.push_tail(&decl->link);
(yyval.node) = declarator;
}
-#line 5958 "glsl_parser.cpp" /* yacc.c:1646 */
+#line 5873 "glsl_parser.cpp" /* yacc.c:1646 */
break;
- case 341:
-#line 2209 "glsl_parser.yy" /* yacc.c:1646 */
+ case 336:
+#line 2145 "glsl_parser.yy" /* yacc.c:1646 */
{
(yyval.node) = new(state) ast_switch_statement((yyvsp[-2].expression), (yyvsp[0].switch_body));
(yyval.node)->set_location_range((yylsp[-4]), (yylsp[0]));
}
-#line 5967 "glsl_parser.cpp" /* yacc.c:1646 */
+#line 5882 "glsl_parser.cpp" /* yacc.c:1646 */
break;
- case 342:
-#line 2217 "glsl_parser.yy" /* yacc.c:1646 */
+ case 337:
+#line 2153 "glsl_parser.yy" /* yacc.c:1646 */
{
(yyval.switch_body) = new(state) ast_switch_body(NULL);
(yyval.switch_body)->set_location_range((yylsp[-1]), (yylsp[0]));
}
-#line 5976 "glsl_parser.cpp" /* yacc.c:1646 */
+#line 5891 "glsl_parser.cpp" /* yacc.c:1646 */
break;
- case 343:
-#line 2222 "glsl_parser.yy" /* yacc.c:1646 */
+ case 338:
+#line 2158 "glsl_parser.yy" /* yacc.c:1646 */
{
(yyval.switch_body) = new(state) ast_switch_body((yyvsp[-1].case_statement_list));
(yyval.switch_body)->set_location_range((yylsp[-2]), (yylsp[0]));
}
-#line 5985 "glsl_parser.cpp" /* yacc.c:1646 */
+#line 5900 "glsl_parser.cpp" /* yacc.c:1646 */
break;
- case 344:
-#line 2230 "glsl_parser.yy" /* yacc.c:1646 */
+ case 339:
+#line 2166 "glsl_parser.yy" /* yacc.c:1646 */
{
(yyval.case_label) = new(state) ast_case_label((yyvsp[-1].expression));
(yyval.case_label)->set_location((yylsp[-1]));
}
-#line 5994 "glsl_parser.cpp" /* yacc.c:1646 */
+#line 5909 "glsl_parser.cpp" /* yacc.c:1646 */
break;
- case 345:
-#line 2235 "glsl_parser.yy" /* yacc.c:1646 */
+ case 340:
+#line 2171 "glsl_parser.yy" /* yacc.c:1646 */
{
(yyval.case_label) = new(state) ast_case_label(NULL);
(yyval.case_label)->set_location((yylsp[0]));
}
-#line 6003 "glsl_parser.cpp" /* yacc.c:1646 */
+#line 5918 "glsl_parser.cpp" /* yacc.c:1646 */
break;
- case 346:
-#line 2243 "glsl_parser.yy" /* yacc.c:1646 */
+ case 341:
+#line 2179 "glsl_parser.yy" /* yacc.c:1646 */
{
ast_case_label_list *labels = new(state) ast_case_label_list();
@@ -6011,20 +5926,20 @@ yyreduce:
(yyval.case_label_list) = labels;
(yyval.case_label_list)->set_location((yylsp[0]));
}
-#line 6015 "glsl_parser.cpp" /* yacc.c:1646 */
+#line 5930 "glsl_parser.cpp" /* yacc.c:1646 */
break;
- case 347:
-#line 2251 "glsl_parser.yy" /* yacc.c:1646 */
+ case 342:
+#line 2187 "glsl_parser.yy" /* yacc.c:1646 */
{
(yyval.case_label_list) = (yyvsp[-1].case_label_list);
(yyval.case_label_list)->labels.push_tail(& (yyvsp[0].case_label)->link);
}
-#line 6024 "glsl_parser.cpp" /* yacc.c:1646 */
+#line 5939 "glsl_parser.cpp" /* yacc.c:1646 */
break;
- case 348:
-#line 2259 "glsl_parser.yy" /* yacc.c:1646 */
+ case 343:
+#line 2195 "glsl_parser.yy" /* yacc.c:1646 */
{
ast_case_statement *stmts = new(state) ast_case_statement((yyvsp[-1].case_label_list));
stmts->set_location((yylsp[0]));
@@ -6032,20 +5947,20 @@ yyreduce:
stmts->stmts.push_tail(& (yyvsp[0].node)->link);
(yyval.case_statement) = stmts;
}
-#line 6036 "glsl_parser.cpp" /* yacc.c:1646 */
+#line 5951 "glsl_parser.cpp" /* yacc.c:1646 */
break;
- case 349:
-#line 2267 "glsl_parser.yy" /* yacc.c:1646 */
+ case 344:
+#line 2203 "glsl_parser.yy" /* yacc.c:1646 */
{
(yyval.case_statement) = (yyvsp[-1].case_statement);
(yyval.case_statement)->stmts.push_tail(& (yyvsp[0].node)->link);
}
-#line 6045 "glsl_parser.cpp" /* yacc.c:1646 */
+#line 5960 "glsl_parser.cpp" /* yacc.c:1646 */
break;
- case 350:
-#line 2275 "glsl_parser.yy" /* yacc.c:1646 */
+ case 345:
+#line 2211 "glsl_parser.yy" /* yacc.c:1646 */
{
ast_case_statement_list *cases= new(state) ast_case_statement_list();
cases->set_location((yylsp[0]));
@@ -6053,153 +5968,153 @@ yyreduce:
cases->cases.push_tail(& (yyvsp[0].case_statement)->link);
(yyval.case_statement_list) = cases;
}
-#line 6057 "glsl_parser.cpp" /* yacc.c:1646 */
+#line 5972 "glsl_parser.cpp" /* yacc.c:1646 */
break;
- case 351:
-#line 2283 "glsl_parser.yy" /* yacc.c:1646 */
+ case 346:
+#line 2219 "glsl_parser.yy" /* yacc.c:1646 */
{
(yyval.case_statement_list) = (yyvsp[-1].case_statement_list);
(yyval.case_statement_list)->cases.push_tail(& (yyvsp[0].case_statement)->link);
}
-#line 6066 "glsl_parser.cpp" /* yacc.c:1646 */
+#line 5981 "glsl_parser.cpp" /* yacc.c:1646 */
break;
- case 352:
-#line 2291 "glsl_parser.yy" /* yacc.c:1646 */
+ case 347:
+#line 2227 "glsl_parser.yy" /* yacc.c:1646 */
{
void *ctx = state;
(yyval.node) = new(ctx) ast_iteration_statement(ast_iteration_statement::ast_while,
NULL, (yyvsp[-2].node), NULL, (yyvsp[0].node));
(yyval.node)->set_location_range((yylsp[-4]), (yylsp[-1]));
}
-#line 6077 "glsl_parser.cpp" /* yacc.c:1646 */
+#line 5992 "glsl_parser.cpp" /* yacc.c:1646 */
break;
- case 353:
-#line 2298 "glsl_parser.yy" /* yacc.c:1646 */
+ case 348:
+#line 2234 "glsl_parser.yy" /* yacc.c:1646 */
{
void *ctx = state;
(yyval.node) = new(ctx) ast_iteration_statement(ast_iteration_statement::ast_do_while,
NULL, (yyvsp[-2].expression), NULL, (yyvsp[-5].node));
(yyval.node)->set_location_range((yylsp[-6]), (yylsp[-1]));
}
-#line 6088 "glsl_parser.cpp" /* yacc.c:1646 */
+#line 6003 "glsl_parser.cpp" /* yacc.c:1646 */
break;
- case 354:
-#line 2305 "glsl_parser.yy" /* yacc.c:1646 */
+ case 349:
+#line 2241 "glsl_parser.yy" /* yacc.c:1646 */
{
void *ctx = state;
(yyval.node) = new(ctx) ast_iteration_statement(ast_iteration_statement::ast_for,
(yyvsp[-3].node), (yyvsp[-2].for_rest_statement).cond, (yyvsp[-2].for_rest_statement).rest, (yyvsp[0].node));
(yyval.node)->set_location_range((yylsp[-5]), (yylsp[0]));
}
-#line 6099 "glsl_parser.cpp" /* yacc.c:1646 */
+#line 6014 "glsl_parser.cpp" /* yacc.c:1646 */
break;
- case 358:
-#line 2321 "glsl_parser.yy" /* yacc.c:1646 */
+ case 353:
+#line 2257 "glsl_parser.yy" /* yacc.c:1646 */
{
(yyval.node) = NULL;
}
-#line 6107 "glsl_parser.cpp" /* yacc.c:1646 */
+#line 6022 "glsl_parser.cpp" /* yacc.c:1646 */
break;
- case 359:
-#line 2328 "glsl_parser.yy" /* yacc.c:1646 */
+ case 354:
+#line 2264 "glsl_parser.yy" /* yacc.c:1646 */
{
(yyval.for_rest_statement).cond = (yyvsp[-1].node);
(yyval.for_rest_statement).rest = NULL;
}
-#line 6116 "glsl_parser.cpp" /* yacc.c:1646 */
+#line 6031 "glsl_parser.cpp" /* yacc.c:1646 */
break;
- case 360:
-#line 2333 "glsl_parser.yy" /* yacc.c:1646 */
+ case 355:
+#line 2269 "glsl_parser.yy" /* yacc.c:1646 */
{
(yyval.for_rest_statement).cond = (yyvsp[-2].node);
(yyval.for_rest_statement).rest = (yyvsp[0].expression);
}
-#line 6125 "glsl_parser.cpp" /* yacc.c:1646 */
+#line 6040 "glsl_parser.cpp" /* yacc.c:1646 */
break;
- case 361:
-#line 2342 "glsl_parser.yy" /* yacc.c:1646 */
+ case 356:
+#line 2278 "glsl_parser.yy" /* yacc.c:1646 */
{
void *ctx = state;
(yyval.node) = new(ctx) ast_jump_statement(ast_jump_statement::ast_continue, NULL);
(yyval.node)->set_location((yylsp[-1]));
}
-#line 6135 "glsl_parser.cpp" /* yacc.c:1646 */
+#line 6050 "glsl_parser.cpp" /* yacc.c:1646 */
break;
- case 362:
-#line 2348 "glsl_parser.yy" /* yacc.c:1646 */
+ case 357:
+#line 2284 "glsl_parser.yy" /* yacc.c:1646 */
{
void *ctx = state;
(yyval.node) = new(ctx) ast_jump_statement(ast_jump_statement::ast_break, NULL);
(yyval.node)->set_location((yylsp[-1]));
}
-#line 6145 "glsl_parser.cpp" /* yacc.c:1646 */
+#line 6060 "glsl_parser.cpp" /* yacc.c:1646 */
break;
- case 363:
-#line 2354 "glsl_parser.yy" /* yacc.c:1646 */
+ case 358:
+#line 2290 "glsl_parser.yy" /* yacc.c:1646 */
{
void *ctx = state;
(yyval.node) = new(ctx) ast_jump_statement(ast_jump_statement::ast_return, NULL);
(yyval.node)->set_location((yylsp[-1]));
}
-#line 6155 "glsl_parser.cpp" /* yacc.c:1646 */
+#line 6070 "glsl_parser.cpp" /* yacc.c:1646 */
break;
- case 364:
-#line 2360 "glsl_parser.yy" /* yacc.c:1646 */
+ case 359:
+#line 2296 "glsl_parser.yy" /* yacc.c:1646 */
{
void *ctx = state;
(yyval.node) = new(ctx) ast_jump_statement(ast_jump_statement::ast_return, (yyvsp[-1].expression));
(yyval.node)->set_location_range((yylsp[-2]), (yylsp[-1]));
}
-#line 6165 "glsl_parser.cpp" /* yacc.c:1646 */
+#line 6080 "glsl_parser.cpp" /* yacc.c:1646 */
break;
- case 365:
-#line 2366 "glsl_parser.yy" /* yacc.c:1646 */
+ case 360:
+#line 2302 "glsl_parser.yy" /* yacc.c:1646 */
{
void *ctx = state;
(yyval.node) = new(ctx) ast_jump_statement(ast_jump_statement::ast_discard, NULL);
(yyval.node)->set_location((yylsp[-1]));
}
-#line 6175 "glsl_parser.cpp" /* yacc.c:1646 */
+#line 6090 "glsl_parser.cpp" /* yacc.c:1646 */
break;
- case 366:
-#line 2374 "glsl_parser.yy" /* yacc.c:1646 */
+ case 361:
+#line 2310 "glsl_parser.yy" /* yacc.c:1646 */
{ (yyval.node) = (yyvsp[0].function_definition); }
-#line 6181 "glsl_parser.cpp" /* yacc.c:1646 */
+#line 6096 "glsl_parser.cpp" /* yacc.c:1646 */
break;
- case 367:
-#line 2375 "glsl_parser.yy" /* yacc.c:1646 */
+ case 362:
+#line 2311 "glsl_parser.yy" /* yacc.c:1646 */
{ (yyval.node) = (yyvsp[0].node); }
-#line 6187 "glsl_parser.cpp" /* yacc.c:1646 */
+#line 6102 "glsl_parser.cpp" /* yacc.c:1646 */
break;
- case 368:
-#line 2376 "glsl_parser.yy" /* yacc.c:1646 */
+ case 363:
+#line 2312 "glsl_parser.yy" /* yacc.c:1646 */
{ (yyval.node) = NULL; }
-#line 6193 "glsl_parser.cpp" /* yacc.c:1646 */
+#line 6108 "glsl_parser.cpp" /* yacc.c:1646 */
break;
- case 369:
-#line 2377 "glsl_parser.yy" /* yacc.c:1646 */
+ case 364:
+#line 2313 "glsl_parser.yy" /* yacc.c:1646 */
{ (yyval.node) = (yyvsp[0].node); }
-#line 6199 "glsl_parser.cpp" /* yacc.c:1646 */
+#line 6114 "glsl_parser.cpp" /* yacc.c:1646 */
break;
- case 370:
-#line 2382 "glsl_parser.yy" /* yacc.c:1646 */
+ case 365:
+#line 2318 "glsl_parser.yy" /* yacc.c:1646 */
{
void *ctx = state;
(yyval.function_definition) = new(ctx) ast_function_definition();
@@ -6209,43 +6124,31 @@ yyreduce:
state->symbols->pop_scope();
}
-#line 6213 "glsl_parser.cpp" /* yacc.c:1646 */
+#line 6128 "glsl_parser.cpp" /* yacc.c:1646 */
break;
- case 371:
-#line 2396 "glsl_parser.yy" /* yacc.c:1646 */
+ case 366:
+#line 2332 "glsl_parser.yy" /* yacc.c:1646 */
{
(yyval.node) = (yyvsp[0].interface_block);
}
-#line 6221 "glsl_parser.cpp" /* yacc.c:1646 */
+#line 6136 "glsl_parser.cpp" /* yacc.c:1646 */
break;
- case 372:
-#line 2400 "glsl_parser.yy" /* yacc.c:1646 */
+ case 367:
+#line 2336 "glsl_parser.yy" /* yacc.c:1646 */
{
ast_interface_block *block = (yyvsp[0].interface_block);
if (!block->layout.merge_qualifier(& (yylsp[-1]), state, (yyvsp[-1].type_qualifier))) {
YYERROR;
}
-
- foreach_list_typed (ast_declarator_list, member, link, &block->declarations) {
- ast_type_qualifier& qualifier = member->type->qualifier;
- if (qualifier.flags.q.stream && qualifier.stream != block->layout.stream) {
- _mesa_glsl_error(& (yylsp[-1]), state,
- "stream layout qualifier on "
- "interface block member does not match "
- "the interface block (%d vs %d)",
- qualifier.stream, block->layout.stream);
- YYERROR;
- }
- }
(yyval.node) = block;
}
-#line 6245 "glsl_parser.cpp" /* yacc.c:1646 */
+#line 6148 "glsl_parser.cpp" /* yacc.c:1646 */
break;
- case 373:
-#line 2423 "glsl_parser.yy" /* yacc.c:1646 */
+ case 368:
+#line 2347 "glsl_parser.yy" /* yacc.c:1646 */
{
ast_interface_block *const block = (yyvsp[-1].interface_block);
@@ -6313,14 +6216,6 @@ yyreduce:
block->layout.flags.i |= block_interface_qualifier;
- if (state->stage == MESA_SHADER_GEOMETRY &&
- state->has_explicit_attrib_stream()) {
- /* Assign global layout's stream value. */
- block->layout.flags.q.stream = 1;
- block->layout.flags.q.explicit_stream = 0;
- block->layout.stream = state->out_qualifier->stream;
- }
-
foreach_list_typed (ast_declarator_list, member, link, &block->declarations) {
ast_type_qualifier& qualifier = member->type->qualifier;
if ((qualifier.flags.i & interface_type_mask) == 0) {
@@ -6347,85 +6242,85 @@ yyreduce:
(yyval.interface_block) = block;
}
-#line 6351 "glsl_parser.cpp" /* yacc.c:1646 */
+#line 6246 "glsl_parser.cpp" /* yacc.c:1646 */
break;
- case 374:
-#line 2528 "glsl_parser.yy" /* yacc.c:1646 */
+ case 369:
+#line 2444 "glsl_parser.yy" /* yacc.c:1646 */
{
memset(& (yyval.type_qualifier), 0, sizeof((yyval.type_qualifier)));
(yyval.type_qualifier).flags.q.in = 1;
}
-#line 6360 "glsl_parser.cpp" /* yacc.c:1646 */
+#line 6255 "glsl_parser.cpp" /* yacc.c:1646 */
break;
- case 375:
-#line 2533 "glsl_parser.yy" /* yacc.c:1646 */
+ case 370:
+#line 2449 "glsl_parser.yy" /* yacc.c:1646 */
{
memset(& (yyval.type_qualifier), 0, sizeof((yyval.type_qualifier)));
(yyval.type_qualifier).flags.q.out = 1;
}
-#line 6369 "glsl_parser.cpp" /* yacc.c:1646 */
+#line 6264 "glsl_parser.cpp" /* yacc.c:1646 */
break;
- case 376:
-#line 2538 "glsl_parser.yy" /* yacc.c:1646 */
+ case 371:
+#line 2454 "glsl_parser.yy" /* yacc.c:1646 */
{
memset(& (yyval.type_qualifier), 0, sizeof((yyval.type_qualifier)));
(yyval.type_qualifier).flags.q.uniform = 1;
}
-#line 6378 "glsl_parser.cpp" /* yacc.c:1646 */
+#line 6273 "glsl_parser.cpp" /* yacc.c:1646 */
break;
- case 377:
-#line 2546 "glsl_parser.yy" /* yacc.c:1646 */
+ case 372:
+#line 2462 "glsl_parser.yy" /* yacc.c:1646 */
{
(yyval.interface_block) = new(state) ast_interface_block(*state->default_uniform_qualifier,
NULL, NULL);
}
-#line 6387 "glsl_parser.cpp" /* yacc.c:1646 */
+#line 6282 "glsl_parser.cpp" /* yacc.c:1646 */
break;
- case 378:
-#line 2551 "glsl_parser.yy" /* yacc.c:1646 */
+ case 373:
+#line 2467 "glsl_parser.yy" /* yacc.c:1646 */
{
(yyval.interface_block) = new(state) ast_interface_block(*state->default_uniform_qualifier,
(yyvsp[0].identifier), NULL);
(yyval.interface_block)->set_location((yylsp[0]));
}
-#line 6397 "glsl_parser.cpp" /* yacc.c:1646 */
+#line 6292 "glsl_parser.cpp" /* yacc.c:1646 */
break;
- case 379:
-#line 2557 "glsl_parser.yy" /* yacc.c:1646 */
+ case 374:
+#line 2473 "glsl_parser.yy" /* yacc.c:1646 */
{
(yyval.interface_block) = new(state) ast_interface_block(*state->default_uniform_qualifier,
(yyvsp[-1].identifier), (yyvsp[0].array_specifier));
(yyval.interface_block)->set_location_range((yylsp[-1]), (yylsp[0]));
}
-#line 6407 "glsl_parser.cpp" /* yacc.c:1646 */
+#line 6302 "glsl_parser.cpp" /* yacc.c:1646 */
break;
- case 380:
-#line 2566 "glsl_parser.yy" /* yacc.c:1646 */
+ case 375:
+#line 2482 "glsl_parser.yy" /* yacc.c:1646 */
{
(yyval.declarator_list) = (yyvsp[0].declarator_list);
(yyvsp[0].declarator_list)->link.self_link();
}
-#line 6416 "glsl_parser.cpp" /* yacc.c:1646 */
+#line 6311 "glsl_parser.cpp" /* yacc.c:1646 */
break;
- case 381:
-#line 2571 "glsl_parser.yy" /* yacc.c:1646 */
+ case 376:
+#line 2487 "glsl_parser.yy" /* yacc.c:1646 */
{
(yyval.declarator_list) = (yyvsp[-1].declarator_list);
(yyvsp[0].declarator_list)->link.insert_before(& (yyval.declarator_list)->link);
}
-#line 6425 "glsl_parser.cpp" /* yacc.c:1646 */
+#line 6320 "glsl_parser.cpp" /* yacc.c:1646 */
break;
- case 382:
-#line 2579 "glsl_parser.yy" /* yacc.c:1646 */
+ case 377:
+#line 2495 "glsl_parser.yy" /* yacc.c:1646 */
{
void *ctx = state;
ast_fully_specified_type *type = (yyvsp[-2].fully_specified_type);
@@ -6446,33 +6341,33 @@ yyreduce:
(yyval.declarator_list)->declarations.push_degenerate_list_at_head(& (yyvsp[-1].declaration)->link);
}
-#line 6450 "glsl_parser.cpp" /* yacc.c:1646 */
+#line 6345 "glsl_parser.cpp" /* yacc.c:1646 */
break;
- case 383:
-#line 2603 "glsl_parser.yy" /* yacc.c:1646 */
+ case 378:
+#line 2519 "glsl_parser.yy" /* yacc.c:1646 */
{
if (!state->default_uniform_qualifier->merge_qualifier(& (yylsp[-2]), state, (yyvsp[-2].type_qualifier))) {
YYERROR;
}
(yyval.node) = NULL;
}
-#line 6461 "glsl_parser.cpp" /* yacc.c:1646 */
+#line 6356 "glsl_parser.cpp" /* yacc.c:1646 */
break;
- case 384:
-#line 2611 "glsl_parser.yy" /* yacc.c:1646 */
+ case 379:
+#line 2527 "glsl_parser.yy" /* yacc.c:1646 */
{
(yyval.node) = NULL;
if (!state->in_qualifier->merge_in_qualifier(& (yylsp[-2]), state, (yyvsp[-2].type_qualifier), (yyval.node))) {
YYERROR;
}
}
-#line 6472 "glsl_parser.cpp" /* yacc.c:1646 */
+#line 6367 "glsl_parser.cpp" /* yacc.c:1646 */
break;
- case 385:
-#line 2619 "glsl_parser.yy" /* yacc.c:1646 */
+ case 380:
+#line 2535 "glsl_parser.yy" /* yacc.c:1646 */
{
if (state->stage != MESA_SHADER_GEOMETRY) {
_mesa_glsl_error(& (yylsp[-2]), state,
@@ -6494,17 +6389,14 @@ yyreduce:
}
if (!state->out_qualifier->merge_qualifier(& (yylsp[-2]), state, (yyvsp[-2].type_qualifier)))
YYERROR;
-
- /* Allow future assigments of global out's stream id value */
- state->out_qualifier->flags.q.explicit_stream = 0;
}
(yyval.node) = NULL;
}
-#line 6504 "glsl_parser.cpp" /* yacc.c:1646 */
+#line 6396 "glsl_parser.cpp" /* yacc.c:1646 */
break;
-#line 6508 "glsl_parser.cpp" /* yacc.c:1646 */
+#line 6400 "glsl_parser.cpp" /* yacc.c:1646 */
default: break;
}
/* User semantic actions sometimes alter yychar, and that requires
diff --git a/dist/Mesa/src/glsl/glsl_parser.h b/dist/Mesa/src/glsl/glsl_parser.h
index 1309b9e04..7e27e1c41 100644
--- a/dist/Mesa/src/glsl/glsl_parser.h
+++ b/dist/Mesa/src/glsl/glsl_parser.h
@@ -80,193 +80,193 @@ extern int _mesa_glsl_debug;
INOUT_TOK = 290,
UNIFORM = 291,
VARYING = 292,
- SAMPLE = 293,
- NOPERSPECTIVE = 294,
- FLAT = 295,
- SMOOTH = 296,
- MAT2X2 = 297,
- MAT2X3 = 298,
- MAT2X4 = 299,
- MAT3X2 = 300,
- MAT3X3 = 301,
- MAT3X4 = 302,
- MAT4X2 = 303,
- MAT4X3 = 304,
- MAT4X4 = 305,
- SAMPLER1D = 306,
- SAMPLER2D = 307,
- SAMPLER3D = 308,
- SAMPLERCUBE = 309,
- SAMPLER1DSHADOW = 310,
- SAMPLER2DSHADOW = 311,
- SAMPLERCUBESHADOW = 312,
- SAMPLER1DARRAY = 313,
- SAMPLER2DARRAY = 314,
- SAMPLER1DARRAYSHADOW = 315,
- SAMPLER2DARRAYSHADOW = 316,
- SAMPLERCUBEARRAY = 317,
- SAMPLERCUBEARRAYSHADOW = 318,
- ISAMPLER1D = 319,
- ISAMPLER2D = 320,
- ISAMPLER3D = 321,
- ISAMPLERCUBE = 322,
- ISAMPLER1DARRAY = 323,
- ISAMPLER2DARRAY = 324,
- ISAMPLERCUBEARRAY = 325,
- USAMPLER1D = 326,
- USAMPLER2D = 327,
- USAMPLER3D = 328,
- USAMPLERCUBE = 329,
- USAMPLER1DARRAY = 330,
- USAMPLER2DARRAY = 331,
- USAMPLERCUBEARRAY = 332,
- SAMPLER2DRECT = 333,
- ISAMPLER2DRECT = 334,
- USAMPLER2DRECT = 335,
- SAMPLER2DRECTSHADOW = 336,
- SAMPLERBUFFER = 337,
- ISAMPLERBUFFER = 338,
- USAMPLERBUFFER = 339,
- SAMPLER2DMS = 340,
- ISAMPLER2DMS = 341,
- USAMPLER2DMS = 342,
- SAMPLER2DMSARRAY = 343,
- ISAMPLER2DMSARRAY = 344,
- USAMPLER2DMSARRAY = 345,
- SAMPLEREXTERNALOES = 346,
- IMAGE1D = 347,
- IMAGE2D = 348,
- IMAGE3D = 349,
- IMAGE2DRECT = 350,
- IMAGECUBE = 351,
- IMAGEBUFFER = 352,
- IMAGE1DARRAY = 353,
- IMAGE2DARRAY = 354,
- IMAGECUBEARRAY = 355,
- IMAGE2DMS = 356,
- IMAGE2DMSARRAY = 357,
- IIMAGE1D = 358,
- IIMAGE2D = 359,
- IIMAGE3D = 360,
- IIMAGE2DRECT = 361,
- IIMAGECUBE = 362,
- IIMAGEBUFFER = 363,
- IIMAGE1DARRAY = 364,
- IIMAGE2DARRAY = 365,
- IIMAGECUBEARRAY = 366,
- IIMAGE2DMS = 367,
- IIMAGE2DMSARRAY = 368,
- UIMAGE1D = 369,
- UIMAGE2D = 370,
- UIMAGE3D = 371,
- UIMAGE2DRECT = 372,
- UIMAGECUBE = 373,
- UIMAGEBUFFER = 374,
- UIMAGE1DARRAY = 375,
- UIMAGE2DARRAY = 376,
- UIMAGECUBEARRAY = 377,
- UIMAGE2DMS = 378,
- UIMAGE2DMSARRAY = 379,
- IMAGE1DSHADOW = 380,
- IMAGE2DSHADOW = 381,
- IMAGE1DARRAYSHADOW = 382,
- IMAGE2DARRAYSHADOW = 383,
- COHERENT = 384,
- VOLATILE = 385,
- RESTRICT = 386,
- READONLY = 387,
- WRITEONLY = 388,
- ATOMIC_UINT = 389,
- STRUCT = 390,
- VOID_TOK = 391,
- WHILE = 392,
- IDENTIFIER = 393,
- TYPE_IDENTIFIER = 394,
- NEW_IDENTIFIER = 395,
- FLOATCONSTANT = 396,
- INTCONSTANT = 397,
- UINTCONSTANT = 398,
- BOOLCONSTANT = 399,
- FIELD_SELECTION = 400,
- LEFT_OP = 401,
- RIGHT_OP = 402,
- INC_OP = 403,
- DEC_OP = 404,
- LE_OP = 405,
- GE_OP = 406,
- EQ_OP = 407,
- NE_OP = 408,
- AND_OP = 409,
- OR_OP = 410,
- XOR_OP = 411,
- MUL_ASSIGN = 412,
- DIV_ASSIGN = 413,
- ADD_ASSIGN = 414,
- MOD_ASSIGN = 415,
- LEFT_ASSIGN = 416,
- RIGHT_ASSIGN = 417,
- AND_ASSIGN = 418,
- XOR_ASSIGN = 419,
- OR_ASSIGN = 420,
- SUB_ASSIGN = 421,
- INVARIANT = 422,
- PRECISE = 423,
- LOWP = 424,
- MEDIUMP = 425,
- HIGHP = 426,
- SUPERP = 427,
- PRECISION = 428,
- VERSION_TOK = 429,
- EXTENSION = 430,
- LINE = 431,
- COLON = 432,
- EOL = 433,
- INTERFACE = 434,
- OUTPUT = 435,
- PRAGMA_DEBUG_ON = 436,
- PRAGMA_DEBUG_OFF = 437,
- PRAGMA_OPTIMIZE_ON = 438,
- PRAGMA_OPTIMIZE_OFF = 439,
- PRAGMA_INVARIANT_ALL = 440,
- LAYOUT_TOK = 441,
- ASM = 442,
- CLASS = 443,
- UNION = 444,
- ENUM = 445,
- TYPEDEF = 446,
- TEMPLATE = 447,
- THIS = 448,
- PACKED_TOK = 449,
- GOTO = 450,
- INLINE_TOK = 451,
- NOINLINE = 452,
- PUBLIC_TOK = 453,
- STATIC = 454,
- EXTERN = 455,
- EXTERNAL = 456,
- LONG_TOK = 457,
- SHORT_TOK = 458,
- DOUBLE_TOK = 459,
- HALF = 460,
- FIXED_TOK = 461,
- UNSIGNED = 462,
- INPUT_TOK = 463,
- HVEC2 = 464,
- HVEC3 = 465,
- HVEC4 = 466,
- DVEC2 = 467,
- DVEC3 = 468,
- DVEC4 = 469,
- FVEC2 = 470,
- FVEC3 = 471,
- FVEC4 = 472,
- SAMPLER3DRECT = 473,
- SIZEOF = 474,
- CAST = 475,
- NAMESPACE = 476,
- USING = 477,
- RESOURCE = 478,
- PATCH = 479,
+ NOPERSPECTIVE = 293,
+ FLAT = 294,
+ SMOOTH = 295,
+ MAT2X2 = 296,
+ MAT2X3 = 297,
+ MAT2X4 = 298,
+ MAT3X2 = 299,
+ MAT3X3 = 300,
+ MAT3X4 = 301,
+ MAT4X2 = 302,
+ MAT4X3 = 303,
+ MAT4X4 = 304,
+ SAMPLER1D = 305,
+ SAMPLER2D = 306,
+ SAMPLER3D = 307,
+ SAMPLERCUBE = 308,
+ SAMPLER1DSHADOW = 309,
+ SAMPLER2DSHADOW = 310,
+ SAMPLERCUBESHADOW = 311,
+ SAMPLER1DARRAY = 312,
+ SAMPLER2DARRAY = 313,
+ SAMPLER1DARRAYSHADOW = 314,
+ SAMPLER2DARRAYSHADOW = 315,
+ SAMPLERCUBEARRAY = 316,
+ SAMPLERCUBEARRAYSHADOW = 317,
+ ISAMPLER1D = 318,
+ ISAMPLER2D = 319,
+ ISAMPLER3D = 320,
+ ISAMPLERCUBE = 321,
+ ISAMPLER1DARRAY = 322,
+ ISAMPLER2DARRAY = 323,
+ ISAMPLERCUBEARRAY = 324,
+ USAMPLER1D = 325,
+ USAMPLER2D = 326,
+ USAMPLER3D = 327,
+ USAMPLERCUBE = 328,
+ USAMPLER1DARRAY = 329,
+ USAMPLER2DARRAY = 330,
+ USAMPLERCUBEARRAY = 331,
+ SAMPLER2DRECT = 332,
+ ISAMPLER2DRECT = 333,
+ USAMPLER2DRECT = 334,
+ SAMPLER2DRECTSHADOW = 335,
+ SAMPLERBUFFER = 336,
+ ISAMPLERBUFFER = 337,
+ USAMPLERBUFFER = 338,
+ SAMPLER2DMS = 339,
+ ISAMPLER2DMS = 340,
+ USAMPLER2DMS = 341,
+ SAMPLER2DMSARRAY = 342,
+ ISAMPLER2DMSARRAY = 343,
+ USAMPLER2DMSARRAY = 344,
+ SAMPLEREXTERNALOES = 345,
+ IMAGE1D = 346,
+ IMAGE2D = 347,
+ IMAGE3D = 348,
+ IMAGE2DRECT = 349,
+ IMAGECUBE = 350,
+ IMAGEBUFFER = 351,
+ IMAGE1DARRAY = 352,
+ IMAGE2DARRAY = 353,
+ IMAGECUBEARRAY = 354,
+ IMAGE2DMS = 355,
+ IMAGE2DMSARRAY = 356,
+ IIMAGE1D = 357,
+ IIMAGE2D = 358,
+ IIMAGE3D = 359,
+ IIMAGE2DRECT = 360,
+ IIMAGECUBE = 361,
+ IIMAGEBUFFER = 362,
+ IIMAGE1DARRAY = 363,
+ IIMAGE2DARRAY = 364,
+ IIMAGECUBEARRAY = 365,
+ IIMAGE2DMS = 366,
+ IIMAGE2DMSARRAY = 367,
+ UIMAGE1D = 368,
+ UIMAGE2D = 369,
+ UIMAGE3D = 370,
+ UIMAGE2DRECT = 371,
+ UIMAGECUBE = 372,
+ UIMAGEBUFFER = 373,
+ UIMAGE1DARRAY = 374,
+ UIMAGE2DARRAY = 375,
+ UIMAGECUBEARRAY = 376,
+ UIMAGE2DMS = 377,
+ UIMAGE2DMSARRAY = 378,
+ IMAGE1DSHADOW = 379,
+ IMAGE2DSHADOW = 380,
+ IMAGE1DARRAYSHADOW = 381,
+ IMAGE2DARRAYSHADOW = 382,
+ COHERENT = 383,
+ VOLATILE = 384,
+ RESTRICT = 385,
+ READONLY = 386,
+ WRITEONLY = 387,
+ ATOMIC_UINT = 388,
+ STRUCT = 389,
+ VOID_TOK = 390,
+ WHILE = 391,
+ IDENTIFIER = 392,
+ TYPE_IDENTIFIER = 393,
+ NEW_IDENTIFIER = 394,
+ FLOATCONSTANT = 395,
+ INTCONSTANT = 396,
+ UINTCONSTANT = 397,
+ BOOLCONSTANT = 398,
+ FIELD_SELECTION = 399,
+ LEFT_OP = 400,
+ RIGHT_OP = 401,
+ INC_OP = 402,
+ DEC_OP = 403,
+ LE_OP = 404,
+ GE_OP = 405,
+ EQ_OP = 406,
+ NE_OP = 407,
+ AND_OP = 408,
+ OR_OP = 409,
+ XOR_OP = 410,
+ MUL_ASSIGN = 411,
+ DIV_ASSIGN = 412,
+ ADD_ASSIGN = 413,
+ MOD_ASSIGN = 414,
+ LEFT_ASSIGN = 415,
+ RIGHT_ASSIGN = 416,
+ AND_ASSIGN = 417,
+ XOR_ASSIGN = 418,
+ OR_ASSIGN = 419,
+ SUB_ASSIGN = 420,
+ INVARIANT = 421,
+ LOWP = 422,
+ MEDIUMP = 423,
+ HIGHP = 424,
+ SUPERP = 425,
+ PRECISION = 426,
+ VERSION_TOK = 427,
+ EXTENSION = 428,
+ LINE = 429,
+ COLON = 430,
+ EOL = 431,
+ INTERFACE = 432,
+ OUTPUT = 433,
+ PRAGMA_DEBUG_ON = 434,
+ PRAGMA_DEBUG_OFF = 435,
+ PRAGMA_OPTIMIZE_ON = 436,
+ PRAGMA_OPTIMIZE_OFF = 437,
+ PRAGMA_INVARIANT_ALL = 438,
+ LAYOUT_TOK = 439,
+ ASM = 440,
+ CLASS = 441,
+ UNION = 442,
+ ENUM = 443,
+ TYPEDEF = 444,
+ TEMPLATE = 445,
+ THIS = 446,
+ PACKED_TOK = 447,
+ GOTO = 448,
+ INLINE_TOK = 449,
+ NOINLINE = 450,
+ PUBLIC_TOK = 451,
+ STATIC = 452,
+ EXTERN = 453,
+ EXTERNAL = 454,
+ LONG_TOK = 455,
+ SHORT_TOK = 456,
+ DOUBLE_TOK = 457,
+ HALF = 458,
+ FIXED_TOK = 459,
+ UNSIGNED = 460,
+ INPUT_TOK = 461,
+ OUPTUT = 462,
+ HVEC2 = 463,
+ HVEC3 = 464,
+ HVEC4 = 465,
+ DVEC2 = 466,
+ DVEC3 = 467,
+ DVEC4 = 468,
+ FVEC2 = 469,
+ FVEC3 = 470,
+ FVEC4 = 471,
+ SAMPLER3DRECT = 472,
+ SIZEOF = 473,
+ CAST = 474,
+ NAMESPACE = 475,
+ USING = 476,
+ RESOURCE = 477,
+ PATCH = 478,
+ SAMPLE = 479,
SUBROUTINE = 480,
ERROR_TOK = 481,
COMMON = 482,
@@ -283,7 +283,7 @@ extern int _mesa_glsl_debug;
typedef union YYSTYPE YYSTYPE;
union YYSTYPE
{
-#line 94 "glsl_parser.yy" /* yacc.c:1909 */
+#line 91 "glsl_parser.yy" /* yacc.c:1909 */
int n;
float real;
diff --git a/dist/Mesa/src/glsl/glsl_parser.yy b/dist/Mesa/src/glsl/glsl_parser.yy
index 6160e265e..b09d6e536 100644
--- a/dist/Mesa/src/glsl/glsl_parser.yy
+++ b/dist/Mesa/src/glsl/glsl_parser.yy
@@ -24,9 +24,6 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-#ifndef _MSC_VER
-#include <strings.h>
-#endif
#include <assert.h>
#include "ast.h"
@@ -131,7 +128,7 @@ static bool match_layout_qualifier(const char *s1, const char *s2,
%token ATTRIBUTE CONST_TOK BOOL_TOK FLOAT_TOK INT_TOK UINT_TOK
%token BREAK CONTINUE DO ELSE FOR IF DISCARD RETURN SWITCH CASE DEFAULT
%token BVEC2 BVEC3 BVEC4 IVEC2 IVEC3 IVEC4 UVEC2 UVEC3 UVEC4 VEC2 VEC3 VEC4
-%token CENTROID IN_TOK OUT_TOK INOUT_TOK UNIFORM VARYING SAMPLE
+%token CENTROID IN_TOK OUT_TOK INOUT_TOK UNIFORM VARYING
%token NOPERSPECTIVE FLAT SMOOTH
%token MAT2X2 MAT2X3 MAT2X4
%token MAT3X2 MAT3X3 MAT3X4
@@ -169,7 +166,7 @@ static bool match_layout_qualifier(const char *s1, const char *s2,
%token AND_OP OR_OP XOR_OP MUL_ASSIGN DIV_ASSIGN ADD_ASSIGN
%token MOD_ASSIGN LEFT_ASSIGN RIGHT_ASSIGN AND_ASSIGN XOR_ASSIGN OR_ASSIGN
%token SUB_ASSIGN
-%token INVARIANT PRECISE
+%token INVARIANT
%token LOWP MEDIUMP HIGHP SUPERP PRECISION
%token VERSION_TOK EXTENSION LINE COLON EOL INTERFACE OUTPUT
@@ -182,11 +179,11 @@ static bool match_layout_qualifier(const char *s1, const char *s2,
*/
%token ASM CLASS UNION ENUM TYPEDEF TEMPLATE THIS PACKED_TOK GOTO
%token INLINE_TOK NOINLINE PUBLIC_TOK STATIC EXTERN EXTERNAL
-%token LONG_TOK SHORT_TOK DOUBLE_TOK HALF FIXED_TOK UNSIGNED INPUT_TOK
+%token LONG_TOK SHORT_TOK DOUBLE_TOK HALF FIXED_TOK UNSIGNED INPUT_TOK OUPTUT
%token HVEC2 HVEC3 HVEC4 DVEC2 DVEC3 DVEC4 FVEC2 FVEC3 FVEC4
%token SAMPLER3DRECT
%token SIZEOF CAST NAMESPACE USING
-%token RESOURCE PATCH
+%token RESOURCE PATCH SAMPLE
%token SUBROUTINE
%token ERROR_TOK
@@ -379,14 +376,6 @@ external_declaration_list:
if ($2 != NULL)
state->translation_unit.push_tail(& $2->link);
}
- | external_declaration_list extension_statement {
- if (!state->allow_extension_directive_midshader) {
- _mesa_glsl_error(& @2, state,
- "#extension directive is not allowed "
- "in the middle of a shader");
- YYERROR;
- }
- }
;
variable_identifier:
@@ -942,22 +931,14 @@ parameter_qualifier:
$$ = $2;
$$.flags.q.constant = 1;
}
- | PRECISE parameter_qualifier
- {
- if ($2.flags.q.precise)
- _mesa_glsl_error(&@1, state, "duplicate precise qualifier");
-
- $$ = $2;
- $$.flags.q.precise = 1;
- }
| parameter_direction_qualifier parameter_qualifier
{
if (($1.flags.q.in || $1.flags.q.out) && ($2.flags.q.in || $2.flags.q.out))
_mesa_glsl_error(&@1, state, "duplicate in/out/inout qualifier");
if (!state->ARB_shading_language_420pack_enable && $2.flags.q.constant)
- _mesa_glsl_error(&@1, state, "in/out/inout must come after const "
- "or precise");
+ _mesa_glsl_error(&@1, state, "const must be specified before "
+ "in/out/inout");
$$ = $1;
$$.merge_qualifier(&@1, state, $2);
@@ -1090,7 +1071,7 @@ single_declaration:
$$->set_location_range(@1, @2);
$$->declarations.push_tail(&decl->link);
}
- | INVARIANT variable_identifier
+ | INVARIANT variable_identifier // Vertex only.
{
void *ctx = state;
ast_declaration *decl = new(ctx) ast_declaration($2, NULL, NULL);
@@ -1102,18 +1083,6 @@ single_declaration:
$$->declarations.push_tail(&decl->link);
}
- | PRECISE variable_identifier
- {
- void *ctx = state;
- ast_declaration *decl = new(ctx) ast_declaration($2, NULL, NULL);
- decl->set_location(@2);
-
- $$ = new(ctx) ast_declarator_list(NULL);
- $$->set_location_range(@1, @2);
- $$->precise = true;
-
- $$->declarations.push_tail(&decl->link);
- }
;
fully_specified_type:
@@ -1406,22 +1375,6 @@ layout_qualifier_id:
}
}
- if (state->stage == MESA_SHADER_GEOMETRY) {
- if (match_layout_qualifier("stream", $1, state) == 0 &&
- state->check_explicit_attrib_stream_allowed(& @3)) {
- $$.flags.q.stream = 1;
-
- if ($3 < 0) {
- _mesa_glsl_error(& @3, state,
- "invalid stream %d specified", $3);
- YYERROR;
- } else {
- $$.flags.q.explicit_stream = 1;
- $$.stream = $3;
- }
- }
- }
-
static const char * const local_size_qualifiers[3] = {
"local_size_x",
"local_size_y",
@@ -1545,11 +1498,6 @@ type_qualifier:
memset(& $$, 0, sizeof($$));
$$.flags.q.invariant = 1;
}
- | PRECISE
- {
- memset(& $$, 0, sizeof($$));
- $$.flags.q.precise = 1;
- }
| auxiliary_storage_qualifier
| storage_qualifier
| interpolation_qualifier
@@ -1570,24 +1518,17 @@ type_qualifier:
* Each qualifier's rule ensures that the accumulated qualifiers on the right
* side don't contain any that must appear on the left hand side.
* For example, when processing a storage qualifier, we check that there are
- * no auxiliary, interpolation, layout, invariant, or precise qualifiers to the right.
+ * no auxiliary, interpolation, layout, or invariant qualifiers to the right.
*/
- | PRECISE type_qualifier
- {
- if ($2.flags.q.precise)
- _mesa_glsl_error(&@1, state, "duplicate \"precise\" qualifier");
-
- $$ = $2;
- $$.flags.q.precise = 1;
- }
| INVARIANT type_qualifier
{
if ($2.flags.q.invariant)
_mesa_glsl_error(&@1, state, "duplicate \"invariant\" qualifier");
- if (!state->ARB_shading_language_420pack_enable && $2.flags.q.precise)
+ if ($2.has_layout()) {
_mesa_glsl_error(&@1, state,
- "\"invariant\" must come after \"precise\"");
+ "\"invariant\" cannot be used with layout(...)");
+ }
$$ = $2;
$$.flags.q.invariant = 1;
@@ -1607,10 +1548,14 @@ type_qualifier:
if ($2.has_interpolation())
_mesa_glsl_error(&@1, state, "duplicate interpolation qualifier");
- if (!state->ARB_shading_language_420pack_enable &&
- ($2.flags.q.precise || $2.flags.q.invariant)) {
+ if ($2.has_layout()) {
+ _mesa_glsl_error(&@1, state, "interpolation qualifiers cannot be used "
+ "with layout(...)");
+ }
+
+ if (!state->ARB_shading_language_420pack_enable && $2.flags.q.invariant) {
_mesa_glsl_error(&@1, state, "interpolation qualifiers must come "
- "after \"precise\" or \"invariant\"");
+ "after \"invariant\"");
}
$$ = $1;
@@ -1618,18 +1563,24 @@ type_qualifier:
}
| layout_qualifier type_qualifier
{
- /* In the absence of ARB_shading_language_420pack, layout qualifiers may
- * appear no later than auxiliary storage qualifiers. There is no
- * particularly clear spec language mandating this, but in all examples
- * the layout qualifier precedes the storage qualifier.
- *
- * We allow combinations of layout with interpolation, invariant or
- * precise qualifiers since these are useful in ARB_separate_shader_objects.
- * There is no clear spec guidance on this either.
+ /* The GLSL 1.50 grammar indicates that a layout(...) declaration can be
+ * used standalone or immediately before a storage qualifier. It cannot
+ * be used with interpolation qualifiers or invariant. There does not
+ * appear to be any text indicating that it must come before the storage
+ * qualifier, but always seems to in examples.
*/
if (!state->ARB_shading_language_420pack_enable && $2.has_layout())
_mesa_glsl_error(&@1, state, "duplicate layout(...) qualifiers");
+ if ($2.flags.q.invariant)
+ _mesa_glsl_error(&@1, state, "layout(...) cannot be used with "
+ "the \"invariant\" qualifier");
+
+ if ($2.has_interpolation()) {
+ _mesa_glsl_error(&@1, state, "layout(...) cannot be used with "
+ "interpolation qualifiers");
+ }
+
$$ = $1;
$$.merge_qualifier(&@1, state, $2);
}
@@ -1641,8 +1592,7 @@ type_qualifier:
}
if (!state->ARB_shading_language_420pack_enable &&
- ($2.flags.q.precise || $2.flags.q.invariant ||
- $2.has_interpolation() || $2.has_layout())) {
+ ($2.flags.q.invariant || $2.has_interpolation() || $2.has_layout())) {
_mesa_glsl_error(&@1, state, "auxiliary storage qualifiers must come "
"just before storage qualifiers");
}
@@ -1659,10 +1609,10 @@ type_qualifier:
_mesa_glsl_error(&@1, state, "duplicate storage qualifier");
if (!state->ARB_shading_language_420pack_enable &&
- ($2.flags.q.precise || $2.flags.q.invariant || $2.has_interpolation() ||
- $2.has_layout() || $2.has_auxiliary_storage())) {
+ ($2.flags.q.invariant || $2.has_interpolation() || $2.has_layout() ||
+ $2.has_auxiliary_storage())) {
_mesa_glsl_error(&@1, state, "storage qualifiers must come after "
- "precise, invariant, interpolation, layout and auxiliary "
+ "invariant, interpolation, layout and auxiliary "
"storage qualifiers");
}
@@ -1720,20 +1670,6 @@ storage_qualifier:
{
memset(& $$, 0, sizeof($$));
$$.flags.q.out = 1;
-
- if (state->stage == MESA_SHADER_GEOMETRY &&
- state->has_explicit_attrib_stream()) {
- /* Section 4.3.8.2 (Output Layout Qualifiers) of the GLSL 4.00
- * spec says:
- *
- * "If the block or variable is declared with the stream
- * identifier, it is associated with the specified stream;
- * otherwise, it is associated with the current default stream."
- */
- $$.flags.q.stream = 1;
- $$.flags.q.explicit_stream = 0;
- $$.stream = state->out_qualifier->stream;
- }
}
| UNIFORM
{
@@ -2201,7 +2137,7 @@ condition:
;
/*
- * switch_statement grammar is based on the syntax described in the body
+ * siwtch_statement grammar is based on the syntax described in the body
* of the GLSL spec, not in it's appendix!!!
*/
switch_statement:
@@ -2402,18 +2338,6 @@ interface_block:
if (!block->layout.merge_qualifier(& @1, state, $1)) {
YYERROR;
}
-
- foreach_list_typed (ast_declarator_list, member, link, &block->declarations) {
- ast_type_qualifier& qualifier = member->type->qualifier;
- if (qualifier.flags.q.stream && qualifier.stream != block->layout.stream) {
- _mesa_glsl_error(& @1, state,
- "stream layout qualifier on "
- "interface block member does not match "
- "the interface block (%d vs %d)",
- qualifier.stream, block->layout.stream);
- YYERROR;
- }
- }
$$ = block;
}
;
@@ -2487,14 +2411,6 @@ basic_interface_block:
block->layout.flags.i |= block_interface_qualifier;
- if (state->stage == MESA_SHADER_GEOMETRY &&
- state->has_explicit_attrib_stream()) {
- /* Assign global layout's stream value. */
- block->layout.flags.q.stream = 1;
- block->layout.flags.q.explicit_stream = 0;
- block->layout.stream = state->out_qualifier->stream;
- }
-
foreach_list_typed (ast_declarator_list, member, link, &block->declarations) {
ast_type_qualifier& qualifier = member->type->qualifier;
if ((qualifier.flags.i & interface_type_mask) == 0) {
@@ -2637,9 +2553,6 @@ layout_defaults:
}
if (!state->out_qualifier->merge_qualifier(& @1, state, $1))
YYERROR;
-
- /* Allow future assigments of global out's stream id value */
- state->out_qualifier->flags.q.explicit_stream = 0;
}
$$ = NULL;
}
diff --git a/dist/Mesa/src/glsl/glsl_parser_extras.cpp b/dist/Mesa/src/glsl/glsl_parser_extras.cpp
index 2fc37da10..d3339e779 100644
--- a/dist/Mesa/src/glsl/glsl_parser_extras.cpp
+++ b/dist/Mesa/src/glsl/glsl_parser_extras.cpp
@@ -31,7 +31,7 @@ extern "C" {
#include "main/shaderobj.h"
}
-#include "util/ralloc.h"
+#include "ralloc.h"
#include "ast.h"
#include "glsl_parser_extras.h"
#include "glsl_parser.h"
@@ -134,9 +134,6 @@ _mesa_glsl_parse_state::_mesa_glsl_parse_state(struct gl_context *_ctx,
this->Const.MaxFragmentImageUniforms = ctx->Const.Program[MESA_SHADER_FRAGMENT].MaxImageUniforms;
this->Const.MaxCombinedImageUniforms = ctx->Const.MaxCombinedImageUniforms;
- /* ARB_viewport_array */
- this->Const.MaxViewports = ctx->Const.MaxViewports;
-
this->current_function = NULL;
this->toplevel_ir = NULL;
this->found_return = false;
@@ -213,8 +210,6 @@ _mesa_glsl_parse_state::_mesa_glsl_parse_state(struct gl_context *_ctx,
this->early_fragment_tests = false;
memset(this->atomic_counter_offsets, 0,
sizeof(this->atomic_counter_offsets));
- this->allow_extension_directive_midshader =
- ctx->Const.AllowGLSLExtensionDirectiveMidShader;
}
/**
@@ -517,13 +512,10 @@ static const _mesa_glsl_extension _mesa_glsl_supported_extensions[] = {
EXT(ARB_arrays_of_arrays, true, false, ARB_arrays_of_arrays),
EXT(ARB_compute_shader, true, false, ARB_compute_shader),
EXT(ARB_conservative_depth, true, false, ARB_conservative_depth),
- EXT(ARB_derivative_control, true, false, ARB_derivative_control),
EXT(ARB_draw_buffers, true, false, dummy_true),
EXT(ARB_draw_instanced, true, false, ARB_draw_instanced),
EXT(ARB_explicit_attrib_location, true, false, ARB_explicit_attrib_location),
- EXT(ARB_explicit_uniform_location, true, false, ARB_explicit_uniform_location),
EXT(ARB_fragment_coord_conventions, true, false, ARB_fragment_coord_conventions),
- EXT(ARB_fragment_layer_viewport, true, false, ARB_fragment_layer_viewport),
EXT(ARB_gpu_shader5, true, false, ARB_gpu_shader5),
EXT(ARB_sample_shading, true, false, ARB_sample_shading),
EXT(ARB_separate_shader_objects, true, false, dummy_true),
@@ -558,7 +550,6 @@ static const _mesa_glsl_extension _mesa_glsl_supported_extensions[] = {
EXT(AMD_shader_stencil_export, true, false, ARB_shader_stencil_export),
EXT(AMD_shader_trinary_minmax, true, false, dummy_true),
EXT(AMD_vertex_shader_layer, true, false, AMD_vertex_shader_layer),
- EXT(AMD_vertex_shader_viewport_index, true, false, AMD_vertex_shader_viewport_index),
EXT(EXT_separate_shader_objects, false, true, dummy_true),
EXT(EXT_shader_integer_mix, true, true, EXT_shader_integer_mix),
EXT(EXT_texture_array, true, false, EXT_texture_array),
@@ -851,7 +842,8 @@ ast_compound_statement::print(void) const
{
printf("{\n");
- foreach_list_typed(ast_node, ast, link, &this->statements) {
+ foreach_list_const(n, &this->statements) {
+ ast_node *ast = exec_node_data(ast_node, n, link);
ast->print();
}
@@ -930,10 +922,11 @@ ast_expression::print(void) const
subexpressions[0]->print();
printf("( ");
- foreach_list_typed (ast_node, ast, link, &this->expressions) {
- if (&ast->link != this->expressions.get_head())
+ foreach_list_const (n, &this->expressions) {
+ if (n != this->expressions.get_head())
printf(", ");
+ ast_node *ast = exec_node_data(ast_node, n, link);
ast->print();
}
@@ -965,10 +958,11 @@ ast_expression::print(void) const
case ast_sequence: {
printf("( ");
- foreach_list_typed (ast_node, ast, link, & this->expressions) {
- if (&ast->link != this->expressions.get_head())
+ foreach_list_const(n, & this->expressions) {
+ if (n != this->expressions.get_head())
printf(", ");
+ ast_node *ast = exec_node_data(ast_node, n, link);
ast->print();
}
printf(") ");
@@ -977,10 +971,11 @@ ast_expression::print(void) const
case ast_aggregate: {
printf("{ ");
- foreach_list_typed (ast_node, ast, link, & this->expressions) {
- if (&ast->link != this->expressions.get_head())
+ foreach_list_const(n, & this->expressions) {
+ if (n != this->expressions.get_head())
printf(", ");
+ ast_node *ast = exec_node_data(ast_node, n, link);
ast->print();
}
printf("} ");
@@ -1030,7 +1025,8 @@ ast_function::print(void) const
return_type->print();
printf(" %s (", identifier);
- foreach_list_typed(ast_node, ast, link, & this->parameters) {
+ foreach_list_const(n, & this->parameters) {
+ ast_node *ast = exec_node_data(ast_node, n, link);
ast->print();
}
@@ -1102,15 +1098,14 @@ ast_declarator_list::print(void) const
if (type)
type->print();
- else if (invariant)
- printf("invariant ");
else
- printf("precise ");
+ printf("invariant ");
- foreach_list_typed (ast_node, ast, link, & this->declarations) {
- if (&ast->link != this->declarations.get_head())
+ foreach_list_const (ptr, & this->declarations) {
+ if (ptr != this->declarations.get_head())
printf(", ");
+ ast_node *ast = exec_node_data(ast_node, ptr, link);
ast->print();
}
@@ -1122,7 +1117,6 @@ ast_declarator_list::ast_declarator_list(ast_fully_specified_type *type)
{
this->type = type;
this->invariant = false;
- this->precise = false;
}
void
@@ -1242,7 +1236,8 @@ ast_case_label::ast_case_label(ast_expression *test_value)
void ast_case_label_list::print(void) const
{
- foreach_list_typed(ast_node, ast, link, & this->labels) {
+ foreach_list_const(n, & this->labels) {
+ ast_node *ast = exec_node_data(ast_node, n, link);
ast->print();
}
printf("\n");
@@ -1257,7 +1252,8 @@ ast_case_label_list::ast_case_label_list(void)
void ast_case_statement::print(void) const
{
labels->print();
- foreach_list_typed(ast_node, ast, link, & this->stmts) {
+ foreach_list_const(n, & this->stmts) {
+ ast_node *ast = exec_node_data(ast_node, n, link);
ast->print();
printf("\n");
}
@@ -1272,7 +1268,8 @@ ast_case_statement::ast_case_statement(ast_case_label_list *labels)
void ast_case_statement_list::print(void) const
{
- foreach_list_typed(ast_node, ast, link, & this->cases) {
+ foreach_list_const(n, & this->cases) {
+ ast_node *ast = exec_node_data(ast_node, n, link);
ast->print();
}
}
@@ -1342,7 +1339,8 @@ void
ast_struct_specifier::print(void) const
{
printf("struct %s { ", name);
- foreach_list_typed(ast_node, ast, link, &this->declarations) {
+ foreach_list_const(n, &this->declarations) {
+ ast_node *ast = exec_node_data(ast_node, n, link);
ast->print();
}
printf("} ");
@@ -1353,15 +1351,9 @@ ast_struct_specifier::ast_struct_specifier(const char *identifier,
ast_declarator_list *declarator_list)
{
if (identifier == NULL) {
- static mtx_t mutex = _MTX_INITIALIZER_NP;
static unsigned anon_count = 1;
- unsigned count;
-
- mtx_lock(&mutex);
- count = anon_count++;
- mtx_unlock(&mutex);
-
- identifier = ralloc_asprintf(this, "#anon_struct_%04x", count);
+ identifier = ralloc_asprintf(this, "#anon_struct_%04x", anon_count);
+ anon_count++;
}
name = identifier;
this->declarations.push_degenerate_list_at_head(&declarator_list->link);
@@ -1449,9 +1441,6 @@ _mesa_glsl_compile_shader(struct gl_context *ctx, struct gl_shader *shader,
new(shader) _mesa_glsl_parse_state(ctx, shader->Stage, shader);
const char *source = shader->Source;
- if (ctx->Const.GenerateTemporaryNames)
- ir_variable::temporaries_allocate_names = true;
-
state->error = glcpp_preprocess(state, &source, &state->info_log,
&ctx->Extensions, ctx);
@@ -1462,7 +1451,8 @@ _mesa_glsl_compile_shader(struct gl_context *ctx, struct gl_shader *shader,
}
if (dump_ast) {
- foreach_list_typed(ast_node, ast, link, &state->translation_unit) {
+ foreach_list_const(n, &state->translation_unit) {
+ ast_node *ast = exec_node_data(ast_node, n, link);
ast->print();
}
printf("\n\n");
@@ -1485,7 +1475,7 @@ _mesa_glsl_compile_shader(struct gl_context *ctx, struct gl_shader *shader,
if (!state->error && !shader->ir->is_empty()) {
struct gl_shader_compiler_options *options =
- &ctx->Const.ShaderCompilerOptions[shader->Stage];
+ &ctx->ShaderCompilerOptions[shader->Stage];
/* Do some optimization at compile time to reduce shader IR size
* and reduce later work if the same shader is linked multiple times
@@ -1495,32 +1485,12 @@ _mesa_glsl_compile_shader(struct gl_context *ctx, struct gl_shader *shader,
;
validate_ir_tree(shader->ir);
-
- enum ir_variable_mode other;
- switch (shader->Stage) {
- case MESA_SHADER_VERTEX:
- other = ir_var_shader_in;
- break;
- case MESA_SHADER_FRAGMENT:
- other = ir_var_shader_out;
- break;
- default:
- /* Something invalid to ensure optimize_dead_builtin_uniforms
- * doesn't remove anything other than uniforms or constants.
- */
- other = ir_var_mode_count;
- break;
- }
-
- optimize_dead_builtin_variables(shader->ir, other);
-
- validate_ir_tree(shader->ir);
}
if (shader->InfoLog)
ralloc_free(shader->InfoLog);
- shader->symbols = new(shader->ir) glsl_symbol_table;
+ shader->symbols = state->symbols;
shader->CompileStatus = !state->error;
shader->InfoLog = state->info_log;
shader->Version = state->language_version;
@@ -1533,34 +1503,6 @@ _mesa_glsl_compile_shader(struct gl_context *ctx, struct gl_shader *shader,
/* Retain any live IR, but trash the rest. */
reparent_ir(shader->ir, shader->ir);
- /* Destroy the symbol table. Create a new symbol table that contains only
- * the variables and functions that still exist in the IR. The symbol
- * table will be used later during linking.
- *
- * There must NOT be any freed objects still referenced by the symbol
- * table. That could cause the linker to dereference freed memory.
- *
- * We don't have to worry about types or interface-types here because those
- * are fly-weights that are looked up by glsl_type.
- */
- foreach_in_list (ir_instruction, ir, shader->ir) {
- switch (ir->ir_type) {
- case ir_type_function:
- shader->symbols->add_function((ir_function *) ir);
- break;
- case ir_type_variable: {
- ir_variable *const var = (ir_variable *) ir;
-
- if (var->data.mode != ir_var_temporary)
- shader->symbols->add_variable(var);
- break;
- }
- default:
- break;
- }
- }
-
- delete state->symbols;
ralloc_free(state);
}
@@ -1622,10 +1564,8 @@ do_common_optimization(exec_list *ir, bool linked,
else
progress = do_constant_variable_unlinked(ir) || progress;
progress = do_constant_folding(ir) || progress;
- progress = do_minmax_prune(ir) || progress;
progress = do_cse(ir) || progress;
- progress = do_rebalance_tree(ir) || progress;
- progress = do_algebraic(ir, native_integers, options) || progress;
+ progress = do_algebraic(ir, native_integers) || progress;
progress = do_lower_jumps(ir) || progress;
progress = do_vec_index_to_swizzle(ir) || progress;
progress = lower_vector_insert(ir, false) || progress;
diff --git a/dist/Mesa/src/glsl/glsl_parser_extras.h b/dist/Mesa/src/glsl/glsl_parser_extras.h
index c87c0e1ad..0416a9c72 100644
--- a/dist/Mesa/src/glsl/glsl_parser_extras.h
+++ b/dist/Mesa/src/glsl/glsl_parser_extras.h
@@ -40,14 +40,9 @@ struct glsl_switch_state {
/** Temporary variables needed for switch statement. */
ir_variable *test_var;
ir_variable *is_fallthru_var;
+ ir_variable *is_break_var;
class ast_switch_statement *switch_nesting_ast;
- /** Used to detect if 'continue' was called inside a switch. */
- ir_variable *continue_inside;
-
- /** Used to set condition if 'default' label should be chosen. */
- ir_variable *run_default;
-
/** Table of constant values already used in case labels */
struct hash_table *labels_ht;
class ast_case_label *previous_default;
@@ -124,19 +119,6 @@ struct _mesa_glsl_parse_state {
return check_version(130, 300, locp, "bit-wise operations are forbidden");
}
- bool check_explicit_attrib_stream_allowed(YYLTYPE *locp)
- {
- if (!this->has_explicit_attrib_stream()) {
- const char *const requirement = "GL_ARB_gpu_shader5 extension or GLSL 400";
-
- _mesa_glsl_error(locp, this, "explicit stream requires %s",
- requirement);
- return false;
- }
-
- return true;
- }
-
bool check_explicit_attrib_location_allowed(YYLTYPE *locp,
const ir_variable *var)
{
@@ -169,26 +151,6 @@ struct _mesa_glsl_parse_state {
return true;
}
- bool check_explicit_uniform_location_allowed(YYLTYPE *locp,
- const ir_variable *)
- {
- if (!this->has_explicit_attrib_location() ||
- !this->ARB_explicit_uniform_location_enable) {
- _mesa_glsl_error(locp, this,
- "uniform explicit location requires "
- "GL_ARB_explicit_uniform_location and either "
- "GL_ARB_explicit_attrib_location or GLSL 330.");
- return false;
- }
-
- return true;
- }
-
- bool has_explicit_attrib_stream() const
- {
- return ARB_gpu_shader5_enable || is_version(400, 0);
- }
-
bool has_explicit_attrib_location() const
{
return ARB_explicit_attrib_location_enable || is_version(330, 300);
@@ -226,7 +188,7 @@ struct _mesa_glsl_parse_state {
/**
* Number of nested struct_specifier levels
*
- * Outside a struct_specifier, this is zero.
+ * Outside a struct_specifer, this is zero.
*/
unsigned struct_specifier_depth;
@@ -343,9 +305,6 @@ struct _mesa_glsl_parse_state {
unsigned MaxGeometryImageUniforms;
unsigned MaxFragmentImageUniforms;
unsigned MaxCombinedImageUniforms;
-
- /* ARB_viewport_array */
- unsigned MaxViewports;
} Const;
/**
@@ -398,20 +357,14 @@ struct _mesa_glsl_parse_state {
bool ARB_compute_shader_warn;
bool ARB_conservative_depth_enable;
bool ARB_conservative_depth_warn;
- bool ARB_derivative_control_enable;
- bool ARB_derivative_control_warn;
bool ARB_draw_buffers_enable;
bool ARB_draw_buffers_warn;
bool ARB_draw_instanced_enable;
bool ARB_draw_instanced_warn;
bool ARB_explicit_attrib_location_enable;
bool ARB_explicit_attrib_location_warn;
- bool ARB_explicit_uniform_location_enable;
- bool ARB_explicit_uniform_location_warn;
bool ARB_fragment_coord_conventions_enable;
bool ARB_fragment_coord_conventions_warn;
- bool ARB_fragment_layer_viewport_enable;
- bool ARB_fragment_layer_viewport_warn;
bool ARB_gpu_shader5_enable;
bool ARB_gpu_shader5_warn;
bool ARB_sample_shading_enable;
@@ -471,8 +424,6 @@ struct _mesa_glsl_parse_state {
bool AMD_shader_trinary_minmax_warn;
bool AMD_vertex_shader_layer_enable;
bool AMD_vertex_shader_layer_warn;
- bool AMD_vertex_shader_viewport_index_enable;
- bool AMD_vertex_shader_viewport_index_warn;
bool EXT_separate_shader_objects_enable;
bool EXT_separate_shader_objects_warn;
bool EXT_shader_integer_mix_enable;
@@ -500,8 +451,6 @@ struct _mesa_glsl_parse_state {
/** Atomic counter offsets by binding */
unsigned atomic_counter_offsets[MAX_COMBINED_ATOMIC_BUFFERS];
-
- bool allow_extension_directive_midshader;
};
# define YYLLOC_DEFAULT(Current, Rhs, N) \
diff --git a/dist/Mesa/src/glsl/glsl_symbol_table.cpp b/dist/Mesa/src/glsl/glsl_symbol_table.cpp
index 2294dda42..a05236203 100644
--- a/dist/Mesa/src/glsl/glsl_symbol_table.cpp
+++ b/dist/Mesa/src/glsl/glsl_symbol_table.cpp
@@ -124,8 +124,6 @@ bool glsl_symbol_table::name_declared_this_scope(const char *name)
bool glsl_symbol_table::add_variable(ir_variable *v)
{
- assert(v->data.mode != ir_var_temporary);
-
if (this->separate_function_namespace) {
/* In 1.10, functions and variables have separate namespaces. */
symbol_table_entry *existing = get_entry(v->name);
diff --git a/dist/Mesa/src/glsl/glsl_types.cpp b/dist/Mesa/src/glsl/glsl_types.cpp
index 5f9919348..849a79af4 100644
--- a/dist/Mesa/src/glsl/glsl_types.cpp
+++ b/dist/Mesa/src/glsl/glsl_types.cpp
@@ -22,14 +22,15 @@
*/
#include <stdio.h>
-#include "main/core.h" /* for Elements, MAX2 */
+#include <stdlib.h>
+#include "main/core.h" /* for Elements */
+#include "glsl_symbol_table.h"
#include "glsl_parser_extras.h"
#include "glsl_types.h"
extern "C" {
#include "program/hash_table.h"
}
-mtx_t glsl_type::mutex = _MTX_INITIALIZER_NP;
hash_table *glsl_type::array_types = NULL;
hash_table *glsl_type::record_types = NULL;
hash_table *glsl_type::interface_types = NULL;
@@ -54,14 +55,9 @@ glsl_type::glsl_type(GLenum gl_type,
vector_elements(vector_elements), matrix_columns(matrix_columns),
length(0)
{
- mtx_lock(&glsl_type::mutex);
-
init_ralloc_type_ctx();
assert(name != NULL);
this->name = ralloc_strdup(this->mem_ctx, name);
-
- mtx_unlock(&glsl_type::mutex);
-
/* Neither dimension is zero or both dimensions are zero.
*/
assert((vector_elements == 0) == (matrix_columns == 0));
@@ -77,14 +73,9 @@ glsl_type::glsl_type(GLenum gl_type, glsl_base_type base_type,
sampler_array(array), sampler_type(type), interface_packing(0),
length(0)
{
- mtx_lock(&glsl_type::mutex);
-
init_ralloc_type_ctx();
assert(name != NULL);
this->name = ralloc_strdup(this->mem_ctx, name);
-
- mtx_unlock(&glsl_type::mutex);
-
memset(& fields, 0, sizeof(fields));
if (base_type == GLSL_TYPE_SAMPLER) {
@@ -106,14 +97,11 @@ glsl_type::glsl_type(const glsl_struct_field *fields, unsigned num_fields,
{
unsigned int i;
- mtx_lock(&glsl_type::mutex);
-
init_ralloc_type_ctx();
assert(name != NULL);
this->name = ralloc_strdup(this->mem_ctx, name);
this->fields.structure = ralloc_array(this->mem_ctx,
glsl_struct_field, length);
-
for (i = 0; i < length; i++) {
this->fields.structure[i].type = fields[i].type;
this->fields.structure[i].name = ralloc_strdup(this->fields.structure,
@@ -122,10 +110,8 @@ glsl_type::glsl_type(const glsl_struct_field *fields, unsigned num_fields,
this->fields.structure[i].interpolation = fields[i].interpolation;
this->fields.structure[i].centroid = fields[i].centroid;
this->fields.structure[i].sample = fields[i].sample;
- this->fields.structure[i].matrix_layout = fields[i].matrix_layout;
+ this->fields.structure[i].row_major = fields[i].row_major;
}
-
- mtx_unlock(&glsl_type::mutex);
}
glsl_type::glsl_type(const glsl_struct_field *fields, unsigned num_fields,
@@ -139,8 +125,6 @@ glsl_type::glsl_type(const glsl_struct_field *fields, unsigned num_fields,
{
unsigned int i;
- mtx_lock(&glsl_type::mutex);
-
init_ralloc_type_ctx();
assert(name != NULL);
this->name = ralloc_strdup(this->mem_ctx, name);
@@ -154,10 +138,8 @@ glsl_type::glsl_type(const glsl_struct_field *fields, unsigned num_fields,
this->fields.structure[i].interpolation = fields[i].interpolation;
this->fields.structure[i].centroid = fields[i].centroid;
this->fields.structure[i].sample = fields[i].sample;
- this->fields.structure[i].matrix_layout = fields[i].matrix_layout;
+ this->fields.structure[i].row_major = fields[i].row_major;
}
-
- mtx_unlock(&glsl_type::mutex);
}
@@ -305,8 +287,6 @@ const glsl_type *glsl_type::get_scalar_type() const
void
_mesa_glsl_release_types(void)
{
- mtx_lock(&glsl_type::mutex);
-
if (glsl_type::array_types != NULL) {
hash_table_dtor(glsl_type::array_types);
glsl_type::array_types = NULL;
@@ -316,8 +296,6 @@ _mesa_glsl_release_types(void)
hash_table_dtor(glsl_type::record_types);
glsl_type::record_types = NULL;
}
-
- mtx_unlock(&glsl_type::mutex);
}
@@ -326,7 +304,7 @@ glsl_type::glsl_type(const glsl_type *array, unsigned length) :
sampler_dimensionality(0), sampler_shadow(0), sampler_array(0),
sampler_type(0), interface_packing(0),
vector_elements(0), matrix_columns(0),
- length(length), name(NULL)
+ name(NULL), length(length)
{
this->fields.array = array;
/* Inherit the gl type of the base. The GL type is used for
@@ -340,10 +318,7 @@ glsl_type::glsl_type(const glsl_type *array, unsigned length) :
* NUL.
*/
const unsigned name_length = strlen(array->name) + 10 + 3;
-
- mtx_lock(&glsl_type::mutex);
char *const n = (char *) ralloc_size(this->mem_ctx, name_length);
- mtx_unlock(&glsl_type::mutex);
if (length == 0)
snprintf(n, name_length, "%s[]", array->name);
@@ -479,6 +454,12 @@ glsl_type::get_instance(unsigned base_type, unsigned rows, unsigned columns)
const glsl_type *
glsl_type::get_array_instance(const glsl_type *base, unsigned array_size)
{
+
+ if (array_types == NULL) {
+ array_types = hash_table_ctor(64, hash_table_string_hash,
+ hash_table_string_compare);
+ }
+
/* Generate a name using the base type pointer in the key. This is
* done because the name of the base type may not be unique across
* shaders. For example, two shaders may have different record types
@@ -487,19 +468,9 @@ glsl_type::get_array_instance(const glsl_type *base, unsigned array_size)
char key[128];
snprintf(key, sizeof(key), "%p[%u]", (void *) base, array_size);
- mtx_lock(&glsl_type::mutex);
-
- if (array_types == NULL) {
- array_types = hash_table_ctor(64, hash_table_string_hash,
- hash_table_string_compare);
- }
-
const glsl_type *t = (glsl_type *) hash_table_find(array_types, key);
-
if (t == NULL) {
- mtx_unlock(&glsl_type::mutex);
t = new glsl_type(base, array_size);
- mtx_lock(&glsl_type::mutex);
hash_table_insert(array_types, (void *) t, ralloc_strdup(mem_ctx, key));
}
@@ -508,8 +479,6 @@ glsl_type::get_array_instance(const glsl_type *base, unsigned array_size)
assert(t->length == array_size);
assert(t->fields.array == base);
- mtx_unlock(&glsl_type::mutex);
-
return t;
}
@@ -523,28 +492,14 @@ glsl_type::record_compare(const glsl_type *b) const
if (this->interface_packing != b->interface_packing)
return false;
- /* From the GLSL 4.20 specification (Sec 4.2):
- *
- * "Structures must have the same name, sequence of type names, and
- * type definitions, and field names to be considered the same type."
- *
- * GLSL ES behaves the same (Ver 1.00 Sec 4.2.4, Ver 3.00 Sec 4.2.5).
- *
- * Note that we cannot force type name check when comparing unnamed
- * structure types, these have a unique name assigned during parsing.
- */
- if (!this->is_anonymous() && !b->is_anonymous())
- if (strcmp(this->name, b->name) != 0)
- return false;
-
for (unsigned i = 0; i < this->length; i++) {
if (this->fields.structure[i].type != b->fields.structure[i].type)
return false;
if (strcmp(this->fields.structure[i].name,
b->fields.structure[i].name) != 0)
return false;
- if (this->fields.structure[i].matrix_layout
- != b->fields.structure[i].matrix_layout)
+ if (this->fields.structure[i].row_major
+ != b->fields.structure[i].row_major)
return false;
if (this->fields.structure[i].location
!= b->fields.structure[i].location)
@@ -608,17 +563,13 @@ glsl_type::get_record_instance(const glsl_struct_field *fields,
{
const glsl_type key(fields, num_fields, name);
- mtx_lock(&glsl_type::mutex);
-
if (record_types == NULL) {
record_types = hash_table_ctor(64, record_key_hash, record_key_compare);
}
const glsl_type *t = (glsl_type *) hash_table_find(record_types, & key);
if (t == NULL) {
- mtx_unlock(&glsl_type::mutex);
t = new glsl_type(fields, num_fields, name);
- mtx_lock(&glsl_type::mutex);
hash_table_insert(record_types, (void *) t, t);
}
@@ -627,8 +578,6 @@ glsl_type::get_record_instance(const glsl_struct_field *fields,
assert(t->length == num_fields);
assert(strcmp(t->name, name) == 0);
- mtx_unlock(&glsl_type::mutex);
-
return t;
}
@@ -641,17 +590,13 @@ glsl_type::get_interface_instance(const glsl_struct_field *fields,
{
const glsl_type key(fields, num_fields, packing, block_name);
- mtx_lock(&glsl_type::mutex);
-
if (interface_types == NULL) {
interface_types = hash_table_ctor(64, record_key_hash, record_key_compare);
}
const glsl_type *t = (glsl_type *) hash_table_find(interface_types, & key);
if (t == NULL) {
- mtx_unlock(&glsl_type::mutex);
t = new glsl_type(fields, num_fields, packing, block_name);
- mtx_lock(&glsl_type::mutex);
hash_table_insert(interface_types, (void *) t, t);
}
@@ -660,8 +605,6 @@ glsl_type::get_interface_instance(const glsl_struct_field *fields,
assert(t->length == num_fields);
assert(strcmp(t->name, block_name) == 0);
- mtx_unlock(&glsl_type::mutex);
-
return t;
}
@@ -734,35 +677,8 @@ glsl_type::component_slots() const
return 0;
}
-unsigned
-glsl_type::uniform_locations() const
-{
- unsigned size = 0;
-
- switch (this->base_type) {
- case GLSL_TYPE_UINT:
- case GLSL_TYPE_INT:
- case GLSL_TYPE_FLOAT:
- case GLSL_TYPE_BOOL:
- case GLSL_TYPE_SAMPLER:
- case GLSL_TYPE_IMAGE:
- return 1;
-
- case GLSL_TYPE_STRUCT:
- case GLSL_TYPE_INTERFACE:
- for (unsigned i = 0; i < this->length; i++)
- size += this->fields.structure[i].type->uniform_locations();
- return size;
- case GLSL_TYPE_ARRAY:
- return this->length * this->fields.array->uniform_locations();
- default:
- return 0;
- }
-}
-
bool
-glsl_type::can_implicitly_convert_to(const glsl_type *desired,
- _mesa_glsl_parse_state *state) const
+glsl_type::can_implicitly_convert_to(const glsl_type *desired) const
{
if (this == desired)
return true;
@@ -771,23 +687,10 @@ glsl_type::can_implicitly_convert_to(const glsl_type *desired,
if (this->matrix_columns > 1 || desired->matrix_columns > 1)
return false;
- /* Vector size must match. */
- if (this->vector_elements != desired->vector_elements)
- return false;
-
/* int and uint can be converted to float. */
- if (desired->is_float() && this->is_integer())
- return true;
-
- /* With GLSL 4.0 / ARB_gpu_shader5, int can be converted to uint.
- * Note that state may be NULL here, when resolving function calls in the
- * linker. By this time, all the state-dependent checks have already
- * happened though, so allow anything that's allowed in any shader version. */
- if ((!state || state->is_version(400, 0) || state->ARB_gpu_shader5_enable) &&
- desired->base_type == GLSL_TYPE_UINT && this->base_type == GLSL_TYPE_INT)
- return true;
-
- return false;
+ return desired->is_float()
+ && this->is_integer()
+ && this->vector_elements == desired->vector_elements;
}
unsigned
@@ -885,18 +788,9 @@ glsl_type::std140_base_alignment(bool row_major) const
if (this->is_record()) {
unsigned base_alignment = 16;
for (unsigned i = 0; i < this->length; i++) {
- bool field_row_major = row_major;
- const enum glsl_matrix_layout matrix_layout =
- glsl_matrix_layout(this->fields.structure[i].matrix_layout);
- if (matrix_layout == GLSL_MATRIX_LAYOUT_ROW_MAJOR) {
- field_row_major = true;
- } else if (matrix_layout == GLSL_MATRIX_LAYOUT_COLUMN_MAJOR) {
- field_row_major = false;
- }
-
const struct glsl_type *field_type = this->fields.structure[i].type;
base_alignment = MAX2(base_alignment,
- field_type->std140_base_alignment(field_row_major));
+ field_type->std140_base_alignment(row_major));
}
return base_alignment;
}
@@ -940,7 +834,8 @@ glsl_type::std140_size(bool row_major) const
* and <R> rows, the matrix is stored identically to a row of <S>*<R>
* row vectors with <C> components each, according to rule (4).
*/
- if (this->without_array()->is_matrix()) {
+ if (this->is_matrix() || (this->is_array() &&
+ this->fields.array->is_matrix())) {
const struct glsl_type *element_type;
const struct glsl_type *vec_type;
unsigned int array_len;
@@ -1002,29 +897,14 @@ glsl_type::std140_size(bool row_major) const
*/
if (this->is_record()) {
unsigned size = 0;
- unsigned max_align = 0;
-
for (unsigned i = 0; i < this->length; i++) {
- bool field_row_major = row_major;
- const enum glsl_matrix_layout matrix_layout =
- glsl_matrix_layout(this->fields.structure[i].matrix_layout);
- if (matrix_layout == GLSL_MATRIX_LAYOUT_ROW_MAJOR) {
- field_row_major = true;
- } else if (matrix_layout == GLSL_MATRIX_LAYOUT_COLUMN_MAJOR) {
- field_row_major = false;
- }
-
const struct glsl_type *field_type = this->fields.structure[i].type;
- unsigned align = field_type->std140_base_alignment(field_row_major);
+ unsigned align = field_type->std140_base_alignment(row_major);
size = glsl_align(size, align);
- size += field_type->std140_size(field_row_major);
-
- max_align = MAX2(align, max_align);
-
- if (field_type->is_record() && (i + 1 < this->length))
- size = glsl_align(size, 16);
+ size += field_type->std140_size(row_major);
}
- size = glsl_align(size, MAX2(max_align, 16));
+ size = glsl_align(size,
+ this->fields.structure[0].type->std140_base_alignment(row_major));
return size;
}
diff --git a/dist/Mesa/src/glsl/glsl_types.h b/dist/Mesa/src/glsl/glsl_types.h
index 474b12914..dca5492ac 100644
--- a/dist/Mesa/src/glsl/glsl_types.h
+++ b/dist/Mesa/src/glsl/glsl_types.h
@@ -79,30 +79,9 @@ enum glsl_interface_packing {
GLSL_INTERFACE_PACKING_PACKED
};
-enum glsl_matrix_layout {
- /**
- * The layout of the matrix is inherited from the object containing the
- * matrix (the top level structure or the uniform block).
- */
- GLSL_MATRIX_LAYOUT_INHERITED,
-
- /**
- * Explicit column-major layout
- *
- * If a uniform block doesn't have an explicit layout set, it will default
- * to this layout.
- */
- GLSL_MATRIX_LAYOUT_COLUMN_MAJOR,
-
- /**
- * Row-major layout
- */
- GLSL_MATRIX_LAYOUT_ROW_MAJOR
-};
-
#ifdef __cplusplus
#include "GL/gl.h"
-#include "util/ralloc.h"
+#include "ralloc.h"
struct glsl_type {
GLenum gl_type;
@@ -122,18 +101,16 @@ struct glsl_type {
* easier to just ralloc_free 'mem_ctx' (or any of its ancestors). */
static void* operator new(size_t size)
{
- mtx_lock(&glsl_type::mutex);
-
- /* mem_ctx should have been created by the static members */
- assert(glsl_type::mem_ctx != NULL);
+ if (glsl_type::mem_ctx == NULL) {
+ glsl_type::mem_ctx = ralloc_context(NULL);
+ assert(glsl_type::mem_ctx != NULL);
+ }
void *type;
type = ralloc_size(glsl_type::mem_ctx, size);
assert(type != NULL);
- mtx_unlock(&glsl_type::mutex);
-
return type;
}
@@ -141,9 +118,7 @@ struct glsl_type {
* ralloc_free in that case. */
static void operator delete(void *type)
{
- mtx_lock(&glsl_type::mutex);
ralloc_free(type);
- mtx_unlock(&glsl_type::mutex);
}
/**
@@ -153,11 +128,18 @@ struct glsl_type {
* these will be 0.
*/
/*@{*/
- uint8_t vector_elements; /**< 1, 2, 3, or 4 vector elements. */
- uint8_t matrix_columns; /**< 1, 2, 3, or 4 matrix columns. */
+ unsigned vector_elements:3; /**< 1, 2, 3, or 4 vector elements. */
+ unsigned matrix_columns:3; /**< 1, 2, 3, or 4 matrix columns. */
/*@}*/
/**
+ * Name of the data type
+ *
+ * Will never be \c NULL.
+ */
+ const char *name;
+
+ /**
* For \c GLSL_TYPE_ARRAY, this is the length of the array. For
* \c GLSL_TYPE_STRUCT or \c GLSL_TYPE_INTERFACE, it is the number of
* elements in the structure and the number of values pointed to by
@@ -166,13 +148,6 @@ struct glsl_type {
unsigned length;
/**
- * Name of the data type
- *
- * Will never be \c NULL.
- */
- const char *name;
-
- /**
* Subtype of composite data types.
*/
union {
@@ -281,15 +256,6 @@ struct glsl_type {
unsigned component_slots() const;
/**
- * Calculate the number of unique values from glGetUniformLocation for the
- * elements of the type.
- *
- * This is used to allocate slots in the UniformRemapTable, the amount of
- * locations may not match with actual used storage space by the driver.
- */
- unsigned uniform_locations() const;
-
- /**
* Calculate the number of attribute slots required to hold this type
*
* This implements the language rules of GLSL 1.50 for counting the number
@@ -348,8 +314,7 @@ struct glsl_type {
* integers.
* \endverbatim
*/
- bool can_implicitly_convert_to(const glsl_type *desired,
- _mesa_glsl_parse_state *state) const;
+ bool can_implicitly_convert_to(const glsl_type *desired) const;
/**
* Query whether or not a type is a scalar (non-vector and non-matrix).
@@ -493,26 +458,6 @@ struct glsl_type {
}
/**
- * Query if a type is unnamed/anonymous (named by the parser)
- */
- bool is_anonymous() const
- {
- return !strncmp(name, "#anon", 5);
- }
-
- /**
- * Get the type stripped of any arrays
- *
- * \return
- * Pointer to the type of elements of the first non-array type for array
- * types, or pointer to itself for non-array types.
- */
- const glsl_type *without_array() const
- {
- return this->is_array() ? this->fields.array : this;
- }
-
- /**
* Return the amount of atomic counter storage required for a type.
*/
unsigned atomic_size() const
@@ -622,9 +567,6 @@ struct glsl_type {
bool record_compare(const glsl_type *b) const;
private:
-
- static mtx_t mutex;
-
/**
* ralloc context for all glsl_type allocations
*
@@ -694,6 +636,7 @@ private:
struct glsl_struct_field {
const struct glsl_type *type;
const char *name;
+ bool row_major;
/**
* For interface blocks, gl_varying_slot corresponding to the input/output
@@ -721,17 +664,6 @@ struct glsl_struct_field {
* in ir_variable::sample). 0 otherwise.
*/
unsigned sample:1;
-
- /**
- * Layout of the matrix. Uses glsl_matrix_layout values.
- */
- unsigned matrix_layout:2;
-
- /**
- * For interface blocks, it has a value if this variable uses multiple vertex
- * streams (as in ir_variable::stream). -1 otherwise.
- */
- int stream;
};
static inline unsigned int
diff --git a/dist/Mesa/src/glsl/ir.cpp b/dist/Mesa/src/glsl/ir.cpp
index fe5601a16..ba8a8394f 100644
--- a/dist/Mesa/src/glsl/ir.cpp
+++ b/dist/Mesa/src/glsl/ir.cpp
@@ -23,10 +23,10 @@
#include <string.h>
#include "main/core.h" /* for MAX2 */
#include "ir.h"
+#include "ir_visitor.h"
#include "glsl_types.h"
-ir_rvalue::ir_rvalue(enum ir_node_type t)
- : ir_instruction(t)
+ir_rvalue::ir_rvalue()
{
this->type = glsl_type::error_type;
}
@@ -46,6 +46,11 @@ bool ir_rvalue::is_negative_one() const
return false;
}
+bool ir_rvalue::is_basis() const
+{
+ return false;
+}
+
/**
* Modify the swizzle make to move one component to another
*
@@ -148,8 +153,8 @@ ir_assignment::whole_variable_written()
ir_assignment::ir_assignment(ir_dereference *lhs, ir_rvalue *rhs,
ir_rvalue *condition, unsigned write_mask)
- : ir_instruction(ir_type_assignment)
{
+ this->ir_type = ir_type_assignment;
this->condition = condition;
this->rhs = rhs;
this->lhs = lhs;
@@ -168,8 +173,8 @@ ir_assignment::ir_assignment(ir_dereference *lhs, ir_rvalue *rhs,
ir_assignment::ir_assignment(ir_rvalue *lhs, ir_rvalue *rhs,
ir_rvalue *condition)
- : ir_instruction(ir_type_assignment)
{
+ this->ir_type = ir_type_assignment;
this->condition = condition;
this->rhs = rhs;
@@ -193,8 +198,8 @@ ir_assignment::ir_assignment(ir_rvalue *lhs, ir_rvalue *rhs,
ir_expression::ir_expression(int op, const struct glsl_type *type,
ir_rvalue *op0, ir_rvalue *op1,
ir_rvalue *op2, ir_rvalue *op3)
- : ir_rvalue(ir_type_expression)
{
+ this->ir_type = ir_type_expression;
this->type = type;
this->operation = ir_expression_operation(op);
this->operands[0] = op0;
@@ -210,8 +215,9 @@ ir_expression::ir_expression(int op, const struct glsl_type *type,
}
ir_expression::ir_expression(int op, ir_rvalue *op0)
- : ir_rvalue(ir_type_expression)
{
+ this->ir_type = ir_type_expression;
+
this->operation = ir_expression_operation(op);
this->operands[0] = op0;
this->operands[1] = NULL;
@@ -243,14 +249,8 @@ ir_expression::ir_expression(int op, ir_rvalue *op0)
case ir_unop_sin_reduced:
case ir_unop_cos_reduced:
case ir_unop_dFdx:
- case ir_unop_dFdx_coarse:
- case ir_unop_dFdx_fine:
case ir_unop_dFdy:
- case ir_unop_dFdy_coarse:
- case ir_unop_dFdy_fine:
case ir_unop_bitfield_reverse:
- case ir_unop_interpolate_at_centroid:
- case ir_unop_saturate:
this->type = op0->type;
break;
@@ -324,8 +324,9 @@ ir_expression::ir_expression(int op, ir_rvalue *op0)
}
ir_expression::ir_expression(int op, ir_rvalue *op0, ir_rvalue *op1)
- : ir_rvalue(ir_type_expression)
{
+ this->ir_type = ir_type_expression;
+
this->operation = ir_expression_operation(op);
this->operands[0] = op0;
this->operands[1] = op1;
@@ -404,8 +405,6 @@ ir_expression::ir_expression(int op, ir_rvalue *op0, ir_rvalue *op1)
case ir_binop_rshift:
case ir_binop_bfm:
case ir_binop_ldexp:
- case ir_binop_interpolate_at_offset:
- case ir_binop_interpolate_at_sample:
this->type = op0->type;
break;
@@ -421,8 +420,9 @@ ir_expression::ir_expression(int op, ir_rvalue *op0, ir_rvalue *op1)
ir_expression::ir_expression(int op, ir_rvalue *op0, ir_rvalue *op1,
ir_rvalue *op2)
- : ir_rvalue(ir_type_expression)
{
+ this->ir_type = ir_type_expression;
+
this->operation = ir_expression_operation(op);
this->operands[0] = op0;
this->operands[1] = op1;
@@ -509,11 +509,7 @@ static const char *const operator_strs[] = {
"sin_reduced",
"cos_reduced",
"dFdx",
- "dFdxCoarse",
- "dFdxFine",
"dFdy",
- "dFdyCoarse",
- "dFdyFine",
"packSnorm2x16",
"packSnorm4x8",
"packUnorm2x16",
@@ -530,9 +526,7 @@ static const char *const operator_strs[] = {
"bit_count",
"find_msb",
"find_lsb",
- "sat",
"noise",
- "interpolate_at_centroid",
"+",
"-",
"*",
@@ -566,8 +560,6 @@ static const char *const operator_strs[] = {
"ubo_load",
"ldexp",
"vector_extract",
- "interpolate_at_offset",
- "interpolate_at_sample",
"fma",
"lrp",
"csel",
@@ -618,25 +610,25 @@ ir_expression::get_operator(const char *str)
}
ir_constant::ir_constant()
- : ir_rvalue(ir_type_constant)
{
+ this->ir_type = ir_type_constant;
}
ir_constant::ir_constant(const struct glsl_type *type,
const ir_constant_data *data)
- : ir_rvalue(ir_type_constant)
{
assert((type->base_type >= GLSL_TYPE_UINT)
&& (type->base_type <= GLSL_TYPE_BOOL));
+ this->ir_type = ir_type_constant;
this->type = type;
memcpy(& this->value, data, sizeof(this->value));
}
ir_constant::ir_constant(float f, unsigned vector_elements)
- : ir_rvalue(ir_type_constant)
{
assert(vector_elements <= 4);
+ this->ir_type = ir_type_constant;
this->type = glsl_type::get_instance(GLSL_TYPE_FLOAT, vector_elements, 1);
for (unsigned i = 0; i < vector_elements; i++) {
this->value.f[i] = f;
@@ -647,9 +639,9 @@ ir_constant::ir_constant(float f, unsigned vector_elements)
}
ir_constant::ir_constant(unsigned int u, unsigned vector_elements)
- : ir_rvalue(ir_type_constant)
{
assert(vector_elements <= 4);
+ this->ir_type = ir_type_constant;
this->type = glsl_type::get_instance(GLSL_TYPE_UINT, vector_elements, 1);
for (unsigned i = 0; i < vector_elements; i++) {
this->value.u[i] = u;
@@ -660,9 +652,9 @@ ir_constant::ir_constant(unsigned int u, unsigned vector_elements)
}
ir_constant::ir_constant(int integer, unsigned vector_elements)
- : ir_rvalue(ir_type_constant)
{
assert(vector_elements <= 4);
+ this->ir_type = ir_type_constant;
this->type = glsl_type::get_instance(GLSL_TYPE_INT, vector_elements, 1);
for (unsigned i = 0; i < vector_elements; i++) {
this->value.i[i] = integer;
@@ -673,9 +665,9 @@ ir_constant::ir_constant(int integer, unsigned vector_elements)
}
ir_constant::ir_constant(bool b, unsigned vector_elements)
- : ir_rvalue(ir_type_constant)
{
assert(vector_elements <= 4);
+ this->ir_type = ir_type_constant;
this->type = glsl_type::get_instance(GLSL_TYPE_BOOL, vector_elements, 1);
for (unsigned i = 0; i < vector_elements; i++) {
this->value.b[i] = b;
@@ -686,8 +678,8 @@ ir_constant::ir_constant(bool b, unsigned vector_elements)
}
ir_constant::ir_constant(const ir_constant *c, unsigned i)
- : ir_rvalue(ir_type_constant)
{
+ this->ir_type = ir_type_constant;
this->type = c->type->get_base_type();
switch (this->type->base_type) {
@@ -700,8 +692,8 @@ ir_constant::ir_constant(const ir_constant *c, unsigned i)
}
ir_constant::ir_constant(const struct glsl_type *type, exec_list *value_list)
- : ir_rvalue(ir_type_constant)
{
+ this->ir_type = ir_type_constant;
this->type = type;
assert(type->is_scalar() || type->is_vector() || type->is_matrix()
@@ -710,7 +702,8 @@ ir_constant::ir_constant(const struct glsl_type *type, exec_list *value_list)
if (type->is_array()) {
this->array_elements = ralloc_array(this, ir_constant *, type->length);
unsigned i = 0;
- foreach_in_list(ir_constant, value, value_list) {
+ foreach_list(node, value_list) {
+ ir_constant *value = (ir_constant *) node;
assert(value->as_constant() != NULL);
this->array_elements[i++] = value;
@@ -1011,7 +1004,9 @@ ir_constant::copy_offset(ir_constant *src, int offset)
case GLSL_TYPE_STRUCT: {
assert (src->type == this->type);
this->components.make_empty();
- foreach_in_list(ir_constant, orig, &src->components) {
+ foreach_list(node, &src->components) {
+ ir_constant *const orig = (ir_constant *) node;
+
this->components.push_tail(orig->clone(this, NULL));
}
break;
@@ -1186,6 +1181,49 @@ ir_constant::is_negative_one() const
}
bool
+ir_constant::is_basis() const
+{
+ if (!this->type->is_scalar() && !this->type->is_vector())
+ return false;
+
+ if (this->type->is_boolean())
+ return false;
+
+ unsigned ones = 0;
+ for (unsigned c = 0; c < this->type->vector_elements; c++) {
+ switch (this->type->base_type) {
+ case GLSL_TYPE_FLOAT:
+ if (this->value.f[c] == 1.0)
+ ones++;
+ else if (this->value.f[c] != 0.0)
+ return false;
+ break;
+ case GLSL_TYPE_INT:
+ if (this->value.i[c] == 1)
+ ones++;
+ else if (this->value.i[c] != 0)
+ return false;
+ break;
+ case GLSL_TYPE_UINT:
+ if (int(this->value.u[c]) == 1)
+ ones++;
+ else if (int(this->value.u[c]) != 0)
+ return false;
+ break;
+ default:
+ /* The only other base types are structures, arrays, samplers, and
+ * booleans. Samplers cannot be constants, and the others should
+ * have been filtered out above.
+ */
+ assert(!"Should not get here.");
+ return false;
+ }
+ }
+
+ return ones == 1;
+}
+
+bool
ir_constant::is_uint16_constant() const
{
if (!type->is_integer())
@@ -1195,16 +1233,16 @@ ir_constant::is_uint16_constant() const
}
ir_loop::ir_loop()
- : ir_instruction(ir_type_loop)
{
+ this->ir_type = ir_type_loop;
}
ir_dereference_variable::ir_dereference_variable(ir_variable *var)
- : ir_dereference(ir_type_dereference_variable)
{
assert(var != NULL);
+ this->ir_type = ir_type_dereference_variable;
this->var = var;
this->type = var->type;
}
@@ -1212,8 +1250,8 @@ ir_dereference_variable::ir_dereference_variable(ir_variable *var)
ir_dereference_array::ir_dereference_array(ir_rvalue *value,
ir_rvalue *array_index)
- : ir_dereference(ir_type_dereference_array)
{
+ this->ir_type = ir_type_dereference_array;
this->array_index = array_index;
this->set_array(value);
}
@@ -1221,10 +1259,10 @@ ir_dereference_array::ir_dereference_array(ir_rvalue *value,
ir_dereference_array::ir_dereference_array(ir_variable *var,
ir_rvalue *array_index)
- : ir_dereference(ir_type_dereference_array)
{
void *ctx = ralloc_parent(var);
+ this->ir_type = ir_type_dereference_array;
this->array_index = array_index;
this->set_array(new(ctx) ir_dereference_variable(var));
}
@@ -1251,10 +1289,10 @@ ir_dereference_array::set_array(ir_rvalue *value)
ir_dereference_record::ir_dereference_record(ir_rvalue *value,
const char *field)
- : ir_dereference(ir_type_dereference_record)
{
assert(value != NULL);
+ this->ir_type = ir_type_dereference_record;
this->record = value;
this->field = ralloc_strdup(this, field);
this->type = this->record->type->field_type(field);
@@ -1263,10 +1301,10 @@ ir_dereference_record::ir_dereference_record(ir_rvalue *value,
ir_dereference_record::ir_dereference_record(ir_variable *var,
const char *field)
- : ir_dereference(ir_type_dereference_record)
{
void *ctx = ralloc_parent(var);
+ this->ir_type = ir_type_dereference_record;
this->record = new(ctx) ir_dereference_variable(var);
this->field = ralloc_strdup(this, field);
this->type = this->record->type->field_type(field);
@@ -1383,22 +1421,24 @@ ir_swizzle::init_mask(const unsigned *comp, unsigned count)
ir_swizzle::ir_swizzle(ir_rvalue *val, unsigned x, unsigned y, unsigned z,
unsigned w, unsigned count)
- : ir_rvalue(ir_type_swizzle), val(val)
+ : val(val)
{
const unsigned components[4] = { x, y, z, w };
+ this->ir_type = ir_type_swizzle;
this->init_mask(components, count);
}
ir_swizzle::ir_swizzle(ir_rvalue *val, const unsigned *comp,
unsigned count)
- : ir_rvalue(ir_type_swizzle), val(val)
+ : val(val)
{
+ this->ir_type = ir_type_swizzle;
this->init_mask(comp, count);
}
ir_swizzle::ir_swizzle(ir_rvalue *val, ir_swizzle_mask mask)
- : ir_rvalue(ir_type_swizzle)
{
+ this->ir_type = ir_type_swizzle;
this->val = val;
this->mask = mask;
this->type = glsl_type::get_instance(val->type->base_type,
@@ -1495,44 +1535,18 @@ ir_swizzle::variable_referenced() const
}
-bool ir_variable::temporaries_allocate_names = false;
-
-const char ir_variable::tmp_name[] = "compiler_temp";
-
ir_variable::ir_variable(const struct glsl_type *type, const char *name,
ir_variable_mode mode)
- : ir_instruction(ir_type_variable)
+ : max_ifc_array_access(NULL)
{
+ this->ir_type = ir_type_variable;
this->type = type;
-
- if (mode == ir_var_temporary && !ir_variable::temporaries_allocate_names)
- name = NULL;
-
- /* The ir_variable clone method may call this constructor with name set to
- * tmp_name.
- */
- assert(name != NULL
- || mode == ir_var_temporary
- || mode == ir_var_function_in
- || mode == ir_var_function_out
- || mode == ir_var_function_inout);
- assert(name != ir_variable::tmp_name
- || mode == ir_var_temporary);
- if (mode == ir_var_temporary
- && (name == NULL || name == ir_variable::tmp_name)) {
- this->name = ir_variable::tmp_name;
- } else {
- this->name = ralloc_strdup(this, name);
- }
-
- this->u.max_ifc_array_access = NULL;
-
+ this->name = ralloc_strdup(this, name);
this->data.explicit_location = false;
this->data.has_initializer = false;
this->data.location = -1;
this->data.location_frac = 0;
- this->data.binding = 0;
- this->data.warn_extension_index = 0;
+ this->warn_extension = NULL;
this->constant_value = NULL;
this->constant_initializer = NULL;
this->data.origin_upper_left = false;
@@ -1547,12 +1561,13 @@ ir_variable::ir_variable(const struct glsl_type *type, const char *name,
this->data.mode = mode;
this->data.interpolation = INTERP_QUALIFIER_NONE;
this->data.max_array_access = 0;
+ this->data.atomic.buffer_index = 0;
this->data.atomic.offset = 0;
- this->data.image_read_only = false;
- this->data.image_write_only = false;
- this->data.image_coherent = false;
- this->data.image_volatile = false;
- this->data.image_restrict = false;
+ this->data.image.read_only = false;
+ this->data.image.write_only = false;
+ this->data.image.coherent = false;
+ this->data.image._volatile = false;
+ this->data.image.restrict_flag = false;
if (type != NULL) {
if (type->base_type == GLSL_TYPE_SAMPLER)
@@ -1595,39 +1610,13 @@ ir_variable::determine_interpolation_mode(bool flat_shade)
return INTERP_QUALIFIER_SMOOTH;
}
-const char *const ir_variable::warn_extension_table[] = {
- "",
- "GL_ARB_shader_stencil_export",
- "GL_AMD_shader_stencil_export",
-};
-
-void
-ir_variable::enable_extension_warning(const char *extension)
-{
- for (unsigned i = 0; i < Elements(warn_extension_table); i++) {
- if (strcmp(warn_extension_table[i], extension) == 0) {
- this->data.warn_extension_index = i;
- return;
- }
- }
-
- assert(!"Should not get here.");
- this->data.warn_extension_index = 0;
-}
-
-const char *
-ir_variable::get_extension_warning() const
-{
- return this->data.warn_extension_index == 0
- ? NULL : warn_extension_table[this->data.warn_extension_index];
-}
ir_function_signature::ir_function_signature(const glsl_type *return_type,
builtin_available_predicate b)
- : ir_instruction(ir_type_function_signature),
- return_type(return_type), is_defined(false), is_intrinsic(false),
+ : return_type(return_type), is_defined(false), is_intrinsic(false),
builtin_avail(b), _function(NULL)
{
+ this->ir_type = ir_type_function_signature;
this->origin = NULL;
}
@@ -1684,11 +1673,11 @@ ir_function_signature::qualifiers_match(exec_list *params)
a->data.interpolation != b->data.interpolation ||
a->data.centroid != b->data.centroid ||
a->data.sample != b->data.sample ||
- a->data.image_read_only != b->data.image_read_only ||
- a->data.image_write_only != b->data.image_write_only ||
- a->data.image_coherent != b->data.image_coherent ||
- a->data.image_volatile != b->data.image_volatile ||
- a->data.image_restrict != b->data.image_restrict) {
+ a->data.image.read_only != b->data.image.read_only ||
+ a->data.image.write_only != b->data.image.write_only ||
+ a->data.image.coherent != b->data.image.coherent ||
+ a->data.image._volatile != b->data.image._volatile ||
+ a->data.image.restrict_flag != b->data.image.restrict_flag) {
/* parameter a's qualifiers don't match */
return a->name;
@@ -1710,8 +1699,8 @@ ir_function_signature::replace_parameters(exec_list *new_params)
ir_function::ir_function(const char *name)
- : ir_instruction(ir_type_function)
{
+ this->ir_type = ir_type_function;
this->name = ralloc_strdup(this, name);
}
@@ -1719,7 +1708,8 @@ ir_function::ir_function(const char *name)
bool
ir_function::has_user_signature()
{
- foreach_in_list(ir_function_signature, sig, &this->signatures) {
+ foreach_list(n, &this->signatures) {
+ ir_function_signature *const sig = (ir_function_signature *) n;
if (!sig->is_builtin())
return true;
}
@@ -1730,7 +1720,7 @@ ir_function::has_user_signature()
ir_rvalue *
ir_rvalue::error_value(void *mem_ctx)
{
- ir_rvalue *v = new(mem_ctx) ir_rvalue(ir_type_unset);
+ ir_rvalue *v = new(mem_ctx) ir_rvalue;
v->type = glsl_type::error_type;
return v;
@@ -1740,8 +1730,8 @@ ir_rvalue::error_value(void *mem_ctx)
void
visit_exec_list(exec_list *list, ir_visitor *visitor)
{
- foreach_in_list_safe(ir_instruction, node, list) {
- node->accept(visitor);
+ foreach_list_safe(n, list) {
+ ((ir_instruction *) n)->accept(visitor);
}
}
@@ -1762,7 +1752,8 @@ steal_memory(ir_instruction *ir, void *new_ctx)
*/
if (constant != NULL) {
if (constant->type->is_record()) {
- foreach_in_list(ir_constant, field, &constant->components) {
+ foreach_list(n, &constant->components) {
+ ir_constant *field = (ir_constant *) n;
steal_memory(field, ir);
}
} else if (constant->type->is_array()) {
@@ -1779,8 +1770,8 @@ steal_memory(ir_instruction *ir, void *new_ctx)
void
reparent_ir(exec_list *list, void *mem_ctx)
{
- foreach_in_list(ir_instruction, node, list) {
- visit_tree(node, steal_memory, mem_ctx);
+ foreach_list(node, list) {
+ visit_tree((ir_instruction *) node, steal_memory, mem_ctx);
}
}
diff --git a/dist/Mesa/src/glsl/ir.h b/dist/Mesa/src/glsl/ir.h
index a0f48b2af..6c7c60a27 100644
--- a/dist/Mesa/src/glsl/ir.h
+++ b/dist/Mesa/src/glsl/ir.h
@@ -29,7 +29,7 @@
#include <stdio.h>
#include <stdlib.h>
-#include "util/ralloc.h"
+#include "ralloc.h"
#include "glsl_types.h"
#include "list.h"
#include "ir_visitor.h"
@@ -59,27 +59,31 @@
* types, this allows writing very straightforward, readable code.
*/
enum ir_node_type {
+ /**
+ * Zero is unused so that the IR validator can detect cases where
+ * \c ir_instruction::ir_type has not been initialized.
+ */
+ ir_type_unset,
+ ir_type_variable,
+ ir_type_assignment,
+ ir_type_call,
+ ir_type_constant,
ir_type_dereference_array,
ir_type_dereference_record,
ir_type_dereference_variable,
- ir_type_constant,
+ ir_type_discard,
ir_type_expression,
- ir_type_swizzle,
- ir_type_texture,
- ir_type_variable,
- ir_type_assignment,
- ir_type_call,
ir_type_function,
ir_type_function_signature,
ir_type_if,
ir_type_loop,
ir_type_loop_jump,
ir_type_return,
- ir_type_discard,
+ ir_type_swizzle,
+ ir_type_texture,
ir_type_emit_vertex,
ir_type_end_primitive,
- ir_type_max, /**< maximum ir_type enum number, for validation */
- ir_type_unset = ir_type_max
+ ir_type_max /**< maximum ir_type enum number, for validation */
};
@@ -117,58 +121,24 @@ public:
* Additional downcast functions will be added as needed.
*/
/*@{*/
- class ir_rvalue *as_rvalue()
- {
- if (ir_type == ir_type_dereference_array ||
- ir_type == ir_type_dereference_record ||
- ir_type == ir_type_dereference_variable ||
- ir_type == ir_type_constant ||
- ir_type == ir_type_expression ||
- ir_type == ir_type_swizzle ||
- ir_type == ir_type_texture)
- return (class ir_rvalue *) this;
- return NULL;
- }
-
- class ir_dereference *as_dereference()
- {
- if (ir_type == ir_type_dereference_array ||
- ir_type == ir_type_dereference_record ||
- ir_type == ir_type_dereference_variable)
- return (class ir_dereference *) this;
- return NULL;
- }
-
- class ir_jump *as_jump()
- {
- if (ir_type == ir_type_loop_jump ||
- ir_type == ir_type_return ||
- ir_type == ir_type_discard)
- return (class ir_jump *) this;
- return NULL;
- }
-
- #define AS_CHILD(TYPE) \
- class ir_##TYPE * as_##TYPE() \
- { \
- return ir_type == ir_type_##TYPE ? (ir_##TYPE *) this : NULL; \
- }
- AS_CHILD(variable)
- AS_CHILD(function)
- AS_CHILD(dereference_array)
- AS_CHILD(dereference_variable)
- AS_CHILD(dereference_record)
- AS_CHILD(expression)
- AS_CHILD(loop)
- AS_CHILD(assignment)
- AS_CHILD(call)
- AS_CHILD(return)
- AS_CHILD(if)
- AS_CHILD(swizzle)
- AS_CHILD(texture)
- AS_CHILD(constant)
- AS_CHILD(discard)
- #undef AS_CHILD
+ virtual class ir_variable * as_variable() { return NULL; }
+ virtual class ir_function * as_function() { return NULL; }
+ virtual class ir_dereference * as_dereference() { return NULL; }
+ virtual class ir_dereference_array * as_dereference_array() { return NULL; }
+ virtual class ir_dereference_variable *as_dereference_variable() { return NULL; }
+ virtual class ir_dereference_record *as_dereference_record() { return NULL; }
+ virtual class ir_expression * as_expression() { return NULL; }
+ virtual class ir_rvalue * as_rvalue() { return NULL; }
+ virtual class ir_loop * as_loop() { return NULL; }
+ virtual class ir_assignment * as_assignment() { return NULL; }
+ virtual class ir_call * as_call() { return NULL; }
+ virtual class ir_return * as_return() { return NULL; }
+ virtual class ir_if * as_if() { return NULL; }
+ virtual class ir_swizzle * as_swizzle() { return NULL; }
+ virtual class ir_texture * as_texture() { return NULL; }
+ virtual class ir_constant * as_constant() { return NULL; }
+ virtual class ir_discard * as_discard() { return NULL; }
+ virtual class ir_jump * as_jump() { return NULL; }
/*@}*/
/**
@@ -182,15 +152,9 @@ public:
virtual bool equals(ir_instruction *ir, enum ir_node_type ignore = ir_type_unset);
protected:
- ir_instruction(enum ir_node_type t)
- : ir_type(t)
- {
- }
-
-private:
ir_instruction()
{
- assert(!"Should not get here.");
+ ir_type = ir_type_unset;
}
};
@@ -213,6 +177,11 @@ public:
virtual ir_constant *constant_expression_value(struct hash_table *variable_context = NULL);
+ virtual ir_rvalue * as_rvalue()
+ {
+ return this;
+ }
+
ir_rvalue *as_rvalue_to_saturate();
virtual bool is_lvalue() const
@@ -251,7 +220,8 @@ public:
* for vector and scalar types that have all elements set to the value
* zero (or \c false for booleans).
*
- * \sa ir_constant::has_value, ir_rvalue::is_one, ir_rvalue::is_negative_one
+ * \sa ir_constant::has_value, ir_rvalue::is_one, ir_rvalue::is_negative_one,
+ * ir_constant::is_basis
*/
virtual bool is_zero() const;
@@ -263,7 +233,8 @@ public:
* for vector and scalar types that have all elements set to the value
* one (or \c true for booleans).
*
- * \sa ir_constant::has_value, ir_rvalue::is_zero, ir_rvalue::is_negative_one
+ * \sa ir_constant::has_value, ir_rvalue::is_zero, ir_rvalue::is_negative_one,
+ * ir_constant::is_basis
*/
virtual bool is_one() const;
@@ -276,10 +247,25 @@ public:
* negative one. For boolean types, the result is always \c false.
*
* \sa ir_constant::has_value, ir_rvalue::is_zero, ir_rvalue::is_one
+ * ir_constant::is_basis
*/
virtual bool is_negative_one() const;
/**
+ * Determine if an r-value is a basis vector
+ *
+ * The base implementation of this function always returns \c false. The
+ * \c ir_constant class over-rides this function to return \c true \b only
+ * for vector and scalar types that have one element set to the value one,
+ * and the other elements set to the value zero. For boolean types, the
+ * result is always \c false.
+ *
+ * \sa ir_constant::has_value, ir_rvalue::is_zero, ir_rvalue::is_one,
+ * is_constant::is_negative_one
+ */
+ virtual bool is_basis() const;
+
+ /**
* Determine if an r-value is an unsigned integer constant which can be
* stored in 16 bits.
*
@@ -295,7 +281,7 @@ public:
static ir_rvalue *error_value(void *mem_ctx);
protected:
- ir_rvalue(enum ir_node_type t);
+ ir_rvalue();
};
@@ -342,12 +328,6 @@ enum ir_var_declaration_type {
* re-declared by the shader.
*/
ir_var_declared_implicitly,
-
- /**
- * Variable is implicitly generated by the compiler and should not be
- * visible via the API.
- */
- ir_var_hidden,
};
/**
@@ -402,6 +382,11 @@ public:
virtual ir_variable *clone(void *mem_ctx, struct hash_table *ht) const;
+ virtual ir_variable *as_variable()
+ {
+ return this;
+ }
+
virtual void accept(ir_visitor *v)
{
v->visit(this);
@@ -464,7 +449,7 @@ public:
assert(this->interface_type == NULL);
this->interface_type = type;
if (this->is_interface_instance()) {
- this->u.max_ifc_array_access =
+ this->max_ifc_array_access =
rzalloc_array(this, unsigned, type->length);
}
}
@@ -476,7 +461,7 @@ public:
*/
void change_interface_type(const struct glsl_type *type)
{
- if (this->u.max_ifc_array_access != NULL) {
+ if (this->max_ifc_array_access != NULL) {
/* max_ifc_array_access has already been allocated, so make sure the
* new interface has the same number of fields as the old one.
*/
@@ -493,7 +478,7 @@ public:
*/
void reinit_interface_type(const struct glsl_type *type)
{
- if (this->u.max_ifc_array_access != NULL) {
+ if (this->max_ifc_array_access != NULL) {
#ifndef NDEBUG
/* Redeclaring gl_PerVertex is only allowed if none of the built-ins
* it defines have been accessed yet; so it's safe to throw away the
@@ -501,10 +486,10 @@ public:
* zero.
*/
for (unsigned i = 0; i < this->interface_type->length; i++)
- assert(this->u.max_ifc_array_access[i] == 0);
+ assert(this->max_ifc_array_access[i] == 0);
#endif
- ralloc_free(this->u.max_ifc_array_access);
- this->u.max_ifc_array_access = NULL;
+ ralloc_free(this->max_ifc_array_access);
+ this->max_ifc_array_access = NULL;
}
this->interface_type = NULL;
init_interface_type(type);
@@ -516,72 +501,6 @@ public:
}
/**
- * Get the max_ifc_array_access pointer
- *
- * A "set" function is not needed because the array is dynmically allocated
- * as necessary.
- */
- inline unsigned *get_max_ifc_array_access()
- {
- assert(this->data._num_state_slots == 0);
- return this->u.max_ifc_array_access;
- }
-
- inline unsigned get_num_state_slots() const
- {
- assert(!this->is_interface_instance()
- || this->data._num_state_slots == 0);
- return this->data._num_state_slots;
- }
-
- inline void set_num_state_slots(unsigned n)
- {
- assert(!this->is_interface_instance()
- || n == 0);
- this->data._num_state_slots = n;
- }
-
- inline ir_state_slot *get_state_slots()
- {
- return this->is_interface_instance() ? NULL : this->u.state_slots;
- }
-
- inline const ir_state_slot *get_state_slots() const
- {
- return this->is_interface_instance() ? NULL : this->u.state_slots;
- }
-
- inline ir_state_slot *allocate_state_slots(unsigned n)
- {
- assert(!this->is_interface_instance());
-
- this->u.state_slots = ralloc_array(this, ir_state_slot, n);
- this->data._num_state_slots = 0;
-
- if (this->u.state_slots != NULL)
- this->data._num_state_slots = n;
-
- return this->u.state_slots;
- }
-
- inline bool is_name_ralloced() const
- {
- return this->name != ir_variable::tmp_name;
- }
-
- /**
- * Enable emitting extension warnings for this variable
- */
- void enable_extension_warning(const char *extension);
-
- /**
- * Get the extension warning string for this variable
- *
- * If warnings are not enabled, \c NULL is returned.
- */
- const char *get_extension_warning() const;
-
- /**
* Declared type of the variable
*/
const struct glsl_type *type;
@@ -591,6 +510,19 @@ public:
*/
const char *name;
+ /**
+ * For variables which satisfy the is_interface_instance() predicate, this
+ * points to an array of integers such that if the ith member of the
+ * interface block is an array, max_ifc_array_access[i] is the maximum
+ * array element of that member that has been accessed. If the ith member
+ * of the interface block is not an array, max_ifc_array_access[i] is
+ * unused.
+ *
+ * For variables whose type is not an interface block, this pointer is
+ * NULL.
+ */
+ unsigned *max_ifc_array_access;
+
struct ir_variable_data {
/**
@@ -603,7 +535,6 @@ public:
unsigned centroid:1;
unsigned sample:1;
unsigned invariant:1;
- unsigned precise:1;
/**
* Has this variable been used for reading or writing?
@@ -702,11 +633,6 @@ public:
unsigned location_frac:2;
/**
- * Layout of the matrix. Uses glsl_matrix_layout values.
- */
- unsigned matrix_layout:2;
-
- /**
* Non-zero if this variable was created by lowering a named interface
* block which was not an array.
*
@@ -725,65 +651,12 @@ public:
unsigned from_named_ifc_block_array:1;
/**
- * Non-zero if the variable must be a shader input. This is useful for
- * constraints on function parameters.
- */
- unsigned must_be_shader_input:1;
-
- /**
- * Output index for dual source blending.
- *
- * \note
- * The GLSL spec only allows the values 0 or 1 for the index in \b dual
- * source blending.
- */
- unsigned index:1;
-
- /**
* \brief Layout qualifier for gl_FragDepth.
*
* This is not equal to \c ir_depth_layout_none if and only if this
* variable is \c gl_FragDepth and a layout qualifier is specified.
*/
- ir_depth_layout depth_layout:3;
-
- /**
- * ARB_shader_image_load_store qualifiers.
- */
- unsigned image_read_only:1; /**< "readonly" qualifier. */
- unsigned image_write_only:1; /**< "writeonly" qualifier. */
- unsigned image_coherent:1;
- unsigned image_volatile:1;
- unsigned image_restrict:1;
-
- /**
- * Emit a warning if this variable is accessed.
- */
- private:
- uint8_t warn_extension_index;
-
- public:
- /** Image internal format if specified explicitly, otherwise GL_NONE. */
- uint16_t image_format;
-
- private:
- /**
- * Number of state slots used
- *
- * \note
- * This could be stored in as few as 7-bits, if necessary. If it is made
- * smaller, add an assertion to \c ir_variable::allocate_state_slots to
- * be safe.
- */
- uint16_t _num_state_slots;
-
- public:
- /**
- * Initial binding point for a sampler, atomic, or UBO.
- *
- * For array types, this represents the binding point for the first element.
- */
- int16_t binding;
+ ir_depth_layout depth_layout;
/**
* Storage location of the base of this variable
@@ -806,31 +679,70 @@ public:
int location;
/**
- * Vertex stream output identifier.
+ * output index for dual source blending.
*/
- unsigned stream;
+ int index;
+
+ /**
+ * Initial binding point for a sampler or UBO.
+ *
+ * For array types, this represents the binding point for the first element.
+ */
+ int binding;
/**
* Location an atomic counter is stored at.
*/
struct {
+ unsigned buffer_index;
unsigned offset;
} atomic;
/**
+ * ARB_shader_image_load_store qualifiers.
+ */
+ struct {
+ bool read_only; /**< "readonly" qualifier. */
+ bool write_only; /**< "writeonly" qualifier. */
+ bool coherent;
+ bool _volatile;
+ bool restrict_flag;
+
+ /** Image internal format if specified explicitly, otherwise GL_NONE. */
+ GLenum format;
+ } image;
+
+ /**
* Highest element accessed with a constant expression array index
*
* Not used for non-array variables.
*/
unsigned max_array_access;
- /**
- * Allow (only) ir_variable direct access private members.
- */
- friend class ir_variable;
} data;
/**
+ * Built-in state that backs this uniform
+ *
+ * Once set at variable creation, \c state_slots must remain invariant.
+ * This is because, ideally, this array would be shared by all clones of
+ * this variable in the IR tree. In other words, we'd really like for it
+ * to be a fly-weight.
+ *
+ * If the variable is not a uniform, \c num_state_slots will be zero and
+ * \c state_slots will be \c NULL.
+ */
+ /*@{*/
+ unsigned num_state_slots; /**< Number of state slots used */
+ ir_state_slot *state_slots; /**< State descriptors. */
+ /*@}*/
+
+ /**
+ * Emit a warning if this variable is accessed.
+ */
+ const char *warn_extension;
+
+ /**
* Value assigned in the initializer of a variable declared "const"
*/
ir_constant *constant_value;
@@ -846,33 +758,6 @@ public:
ir_constant *constant_initializer;
private:
- static const char *const warn_extension_table[];
-
- union {
- /**
- * For variables which satisfy the is_interface_instance() predicate,
- * this points to an array of integers such that if the ith member of
- * the interface block is an array, max_ifc_array_access[i] is the
- * maximum array element of that member that has been accessed. If the
- * ith member of the interface block is not an array,
- * max_ifc_array_access[i] is unused.
- *
- * For variables whose type is not an interface block, this pointer is
- * NULL.
- */
- unsigned *max_ifc_array_access;
-
- /**
- * Built-in state that backs this uniform
- *
- * Once set at variable creation, \c state_slots must remain invariant.
- *
- * If the variable is not a uniform, \c _num_state_slots will be zero
- * and \c state_slots will be \c NULL.
- */
- ir_state_slot *state_slots;
- } u;
-
/**
* For variables that are in an interface block or are an instance of an
* interface block, this is the \c GLSL_TYPE_INTERFACE type for that block.
@@ -880,30 +765,6 @@ private:
* \sa ir_variable::location
*/
const glsl_type *interface_type;
-
- /**
- * Name used for anonymous compiler temporaries
- */
- static const char tmp_name[];
-
-public:
- /**
- * Should the construct keep names for ir_var_temporary variables?
- *
- * When this global is false, names passed to the constructor for
- * \c ir_var_temporary variables will be dropped. Instead, the variable will
- * be named "compiler_temp". This name will be in static storage.
- *
- * \warning
- * \b NEVER change the mode of an \c ir_var_temporary.
- *
- * \warning
- * This variable is \b not thread-safe. It is global, \b not
- * per-context. It begins life false. A context can, at some point, make
- * it true. From that point on, it will be true forever. This should be
- * okay since it will only be set true while debugging.
- */
- static bool temporaries_allocate_names;
};
/**
@@ -1056,6 +917,11 @@ public:
virtual ir_function *clone(void *mem_ctx, struct hash_table *ht) const;
+ virtual ir_function *as_function()
+ {
+ return this;
+ }
+
virtual void accept(ir_visitor *v)
{
v->visit(this);
@@ -1075,7 +941,6 @@ public:
*/
ir_function_signature *matching_signature(_mesa_glsl_parse_state *state,
const exec_list *actual_param,
- bool allow_builtins,
bool *match_is_exact);
/**
@@ -1083,8 +948,7 @@ public:
* conversions into account.
*/
ir_function_signature *matching_signature(_mesa_glsl_parse_state *state,
- const exec_list *actual_param,
- bool allow_builtins);
+ const exec_list *actual_param);
/**
* Find a signature that exactly matches a set of actual parameters without
@@ -1120,12 +984,18 @@ inline const char *ir_function_signature::function_name() const
class ir_if : public ir_instruction {
public:
ir_if(ir_rvalue *condition)
- : ir_instruction(ir_type_if), condition(condition)
+ : condition(condition)
{
+ ir_type = ir_type_if;
}
virtual ir_if *clone(void *mem_ctx, struct hash_table *ht) const;
+ virtual ir_if *as_if()
+ {
+ return this;
+ }
+
virtual void accept(ir_visitor *v)
{
v->visit(this);
@@ -1157,6 +1027,11 @@ public:
virtual ir_visitor_status accept(ir_hierarchical_visitor *);
+ virtual ir_loop *as_loop()
+ {
+ return this;
+ }
+
/** List of ir_instruction that make up the body of the loop. */
exec_list body_instructions;
};
@@ -1187,6 +1062,11 @@ public:
virtual ir_visitor_status accept(ir_hierarchical_visitor *);
+ virtual ir_assignment * as_assignment()
+ {
+ return this;
+ }
+
/**
* Get a whole variable written by an assignment
*
@@ -1301,11 +1181,7 @@ enum ir_expression_operation {
*/
/*@{*/
ir_unop_dFdx,
- ir_unop_dFdx_coarse,
- ir_unop_dFdx_fine,
ir_unop_dFdy,
- ir_unop_dFdy_coarse,
- ir_unop_dFdy_fine,
/*@}*/
/**
@@ -1344,20 +1220,12 @@ enum ir_expression_operation {
ir_unop_find_lsb,
/*@}*/
- ir_unop_saturate,
ir_unop_noise,
/**
- * Interpolate fs input at centroid
- *
- * operand0 is the fs input.
- */
- ir_unop_interpolate_at_centroid,
-
- /**
* A sentinel marking the last of the unary operations.
*/
- ir_last_unop = ir_unop_interpolate_at_centroid,
+ ir_last_unop = ir_unop_noise,
ir_binop_add,
ir_binop_sub,
@@ -1476,25 +1344,9 @@ enum ir_expression_operation {
ir_binop_vector_extract,
/**
- * Interpolate fs input at offset
- *
- * operand0 is the fs input
- * operand1 is the offset from the pixel center
- */
- ir_binop_interpolate_at_offset,
-
- /**
- * Interpolate fs input at sample position
- *
- * operand0 is the fs input
- * operand1 is the sample ID
- */
- ir_binop_interpolate_at_sample,
-
- /**
* A sentinel marking the last of the binary operations.
*/
- ir_last_binop = ir_binop_interpolate_at_sample,
+ ir_last_binop = ir_binop_vector_extract,
/**
* \name Fused floating-point multiply-add, part of ARB_gpu_shader5.
@@ -1578,6 +1430,11 @@ public:
*/
ir_expression(int op, ir_rvalue *op0, ir_rvalue *op1, ir_rvalue *op2);
+ virtual ir_expression *as_expression()
+ {
+ return this;
+ }
+
virtual bool equals(ir_instruction *ir, enum ir_node_type ignore = ir_type_unset);
virtual ir_expression *clone(void *mem_ctx, struct hash_table *ht) const;
@@ -1657,8 +1514,9 @@ public:
ir_call(ir_function_signature *callee,
ir_dereference_variable *return_deref,
exec_list *actual_parameters)
- : ir_instruction(ir_type_call), return_deref(return_deref), callee(callee)
+ : return_deref(return_deref), callee(callee)
{
+ ir_type = ir_type_call;
assert(callee->return_type != NULL);
actual_parameters->move_nodes_to(& this->actual_parameters);
this->use_builtin = callee->is_builtin();
@@ -1668,6 +1526,11 @@ public:
virtual ir_constant *constant_expression_value(struct hash_table *variable_context = NULL);
+ virtual ir_call *as_call()
+ {
+ return this;
+ }
+
virtual void accept(ir_visitor *v)
{
v->visit(this);
@@ -1716,26 +1579,39 @@ public:
/*@{*/
class ir_jump : public ir_instruction {
protected:
- ir_jump(enum ir_node_type t)
- : ir_instruction(t)
+ ir_jump()
{
+ ir_type = ir_type_unset;
+ }
+
+public:
+ virtual ir_jump *as_jump()
+ {
+ return this;
}
};
class ir_return : public ir_jump {
public:
ir_return()
- : ir_jump(ir_type_return), value(NULL)
+ : value(NULL)
{
+ this->ir_type = ir_type_return;
}
ir_return(ir_rvalue *value)
- : ir_jump(ir_type_return), value(value)
+ : value(value)
{
+ this->ir_type = ir_type_return;
}
virtual ir_return *clone(void *mem_ctx, struct hash_table *) const;
+ virtual ir_return *as_return()
+ {
+ return this;
+ }
+
ir_rvalue *get_value() const
{
return value;
@@ -1768,8 +1644,8 @@ public:
};
ir_loop_jump(jump_mode mode)
- : ir_jump(ir_type_loop_jump)
{
+ this->ir_type = ir_type_loop_jump;
this->mode = mode;
}
@@ -1802,14 +1678,14 @@ public:
class ir_discard : public ir_jump {
public:
ir_discard()
- : ir_jump(ir_type_discard)
{
+ this->ir_type = ir_type_discard;
this->condition = NULL;
}
ir_discard(ir_rvalue *cond)
- : ir_jump(ir_type_discard)
{
+ this->ir_type = ir_type_discard;
this->condition = cond;
}
@@ -1822,6 +1698,11 @@ public:
virtual ir_visitor_status accept(ir_hierarchical_visitor *);
+ virtual ir_discard *as_discard()
+ {
+ return this;
+ }
+
ir_rvalue *condition;
};
/*@}*/
@@ -1871,10 +1752,10 @@ enum ir_texture_opcode {
class ir_texture : public ir_rvalue {
public:
ir_texture(enum ir_texture_opcode op)
- : ir_rvalue(ir_type_texture),
- op(op), sampler(NULL), coordinate(NULL), projector(NULL),
+ : op(op), sampler(NULL), coordinate(NULL), projector(NULL),
shadow_comparitor(NULL), offset(NULL)
{
+ this->ir_type = ir_type_texture;
memset(&lod_info, 0, sizeof(lod_info));
}
@@ -1887,6 +1768,11 @@ public:
v->visit(this);
}
+ virtual ir_texture *as_texture()
+ {
+ return this;
+ }
+
virtual ir_visitor_status accept(ir_hierarchical_visitor *);
virtual bool equals(ir_instruction *ir, enum ir_node_type ignore = ir_type_unset);
@@ -1978,6 +1864,11 @@ public:
virtual ir_constant *constant_expression_value(struct hash_table *variable_context = NULL);
+ virtual ir_swizzle *as_swizzle()
+ {
+ return this;
+ }
+
/**
* Construct an ir_swizzle from the textual representation. Can fail.
*/
@@ -2019,18 +1910,17 @@ class ir_dereference : public ir_rvalue {
public:
virtual ir_dereference *clone(void *mem_ctx, struct hash_table *) const = 0;
+ virtual ir_dereference *as_dereference()
+ {
+ return this;
+ }
+
bool is_lvalue() const;
/**
* Get the variable that is ultimately referenced by an r-value
*/
virtual ir_variable *variable_referenced() const = 0;
-
-protected:
- ir_dereference(enum ir_node_type t)
- : ir_rvalue(t)
- {
- }
};
@@ -2043,6 +1933,11 @@ public:
virtual ir_constant *constant_expression_value(struct hash_table *variable_context = NULL);
+ virtual ir_dereference_variable *as_dereference_variable()
+ {
+ return this;
+ }
+
virtual bool equals(ir_instruction *ir, enum ir_node_type ignore = ir_type_unset);
/**
@@ -2089,6 +1984,11 @@ public:
virtual ir_constant *constant_expression_value(struct hash_table *variable_context = NULL);
+ virtual ir_dereference_array *as_dereference_array()
+ {
+ return this;
+ }
+
virtual bool equals(ir_instruction *ir, enum ir_node_type ignore = ir_type_unset);
/**
@@ -2125,6 +2025,11 @@ public:
virtual ir_constant *constant_expression_value(struct hash_table *variable_context = NULL);
+ virtual ir_dereference_record *as_dereference_record()
+ {
+ return this;
+ }
+
/**
* Get the variable that is ultimately referenced by an r-value
*/
@@ -2190,6 +2095,11 @@ public:
virtual ir_constant *constant_expression_value(struct hash_table *variable_context = NULL);
+ virtual ir_constant *as_constant()
+ {
+ return this;
+ }
+
virtual void accept(ir_visitor *v)
{
v->visit(this);
@@ -2246,7 +2156,7 @@ public:
* Determine whether a constant has the same value as another constant
*
* \sa ir_constant::is_zero, ir_constant::is_one,
- * ir_constant::is_negative_one
+ * ir_constant::is_negative_one, ir_constant::is_basis
*/
bool has_value(const ir_constant *) const;
@@ -2259,6 +2169,7 @@ public:
virtual bool is_zero() const;
virtual bool is_one() const;
virtual bool is_negative_one() const;
+ virtual bool is_basis() const;
/**
* Return true for constants that could be stored as 16-bit unsigned values.
@@ -2295,11 +2206,9 @@ private:
*/
class ir_emit_vertex : public ir_instruction {
public:
- ir_emit_vertex(ir_rvalue *stream)
- : ir_instruction(ir_type_emit_vertex),
- stream(stream)
+ ir_emit_vertex()
{
- assert(stream);
+ ir_type = ir_type_emit_vertex;
}
virtual void accept(ir_visitor *v)
@@ -2307,19 +2216,12 @@ public:
v->visit(this);
}
- virtual ir_emit_vertex *clone(void *mem_ctx, struct hash_table *ht) const
+ virtual ir_emit_vertex *clone(void *mem_ctx, struct hash_table *) const
{
- return new(mem_ctx) ir_emit_vertex(this->stream->clone(mem_ctx, ht));
+ return new(mem_ctx) ir_emit_vertex();
}
virtual ir_visitor_status accept(ir_hierarchical_visitor *);
-
- int stream_id() const
- {
- return stream->as_constant()->value.i[0];
- }
-
- ir_rvalue *stream;
};
/**
@@ -2328,11 +2230,9 @@ public:
*/
class ir_end_primitive : public ir_instruction {
public:
- ir_end_primitive(ir_rvalue *stream)
- : ir_instruction(ir_type_end_primitive),
- stream(stream)
+ ir_end_primitive()
{
- assert(stream);
+ ir_type = ir_type_end_primitive;
}
virtual void accept(ir_visitor *v)
@@ -2340,19 +2240,12 @@ public:
v->visit(this);
}
- virtual ir_end_primitive *clone(void *mem_ctx, struct hash_table *ht) const
+ virtual ir_end_primitive *clone(void *mem_ctx, struct hash_table *) const
{
- return new(mem_ctx) ir_end_primitive(this->stream->clone(mem_ctx, ht));
+ return new(mem_ctx) ir_end_primitive();
}
virtual ir_visitor_status accept(ir_hierarchical_visitor *);
-
- int stream_id() const
- {
- return stream->as_constant()->value.i[0];
- }
-
- ir_rvalue *stream;
};
/*@}*/
@@ -2449,24 +2342,12 @@ prototype_string(const glsl_type *return_type, const char *name,
const char *
mode_string(const ir_variable *var);
-/**
- * Built-in / reserved GL variables names start with "gl_"
- */
-static inline bool
-is_gl_identifier(const char *s)
-{
- return s && s[0] == 'g' && s[1] == 'l' && s[2] == '_';
-}
-
extern "C" {
#endif /* __cplusplus */
extern void _mesa_print_ir(FILE *f, struct exec_list *instructions,
struct _mesa_glsl_parse_state *state);
-extern void
-fprint_ir(FILE *f, const void *instruction);
-
#ifdef __cplusplus
} /* extern "C" */
#endif
diff --git a/dist/Mesa/src/glsl/ir_clone.cpp b/dist/Mesa/src/glsl/ir_clone.cpp
index dffa57844..c00adc564 100644
--- a/dist/Mesa/src/glsl/ir_clone.cpp
+++ b/dist/Mesa/src/glsl/ir_clone.cpp
@@ -45,18 +45,25 @@ ir_variable::clone(void *mem_ctx, struct hash_table *ht) const
var->data.max_array_access = this->data.max_array_access;
if (this->is_interface_instance()) {
- var->u.max_ifc_array_access =
+ var->max_ifc_array_access =
rzalloc_array(var, unsigned, this->interface_type->length);
- memcpy(var->u.max_ifc_array_access, this->u.max_ifc_array_access,
+ memcpy(var->max_ifc_array_access, this->max_ifc_array_access,
this->interface_type->length * sizeof(unsigned));
}
memcpy(&var->data, &this->data, sizeof(var->data));
- if (this->get_state_slots()) {
- ir_state_slot *s = var->allocate_state_slots(this->get_num_state_slots());
- memcpy(s, this->get_state_slots(),
- sizeof(s[0]) * var->get_num_state_slots());
+ var->warn_extension = this->warn_extension;
+
+ var->num_state_slots = this->num_state_slots;
+ if (this->state_slots) {
+ /* FINISHME: This really wants to use something like talloc_reference, but
+ * FINISHME: ralloc doesn't have any similar function.
+ */
+ var->state_slots = ralloc_array(var, ir_state_slot,
+ this->num_state_slots);
+ memcpy(var->state_slots, this->state_slots,
+ sizeof(this->state_slots[0]) * var->num_state_slots);
}
if (this->constant_value)
@@ -116,11 +123,13 @@ ir_if::clone(void *mem_ctx, struct hash_table *ht) const
{
ir_if *new_if = new(mem_ctx) ir_if(this->condition->clone(mem_ctx, ht));
- foreach_in_list(ir_instruction, ir, &this->then_instructions) {
+ foreach_list(n, &this->then_instructions) {
+ ir_instruction *ir = (ir_instruction *) n;
new_if->then_instructions.push_tail(ir->clone(mem_ctx, ht));
}
- foreach_in_list(ir_instruction, ir, &this->else_instructions) {
+ foreach_list(n, &this->else_instructions) {
+ ir_instruction *ir = (ir_instruction *) n;
new_if->else_instructions.push_tail(ir->clone(mem_ctx, ht));
}
@@ -132,7 +141,8 @@ ir_loop::clone(void *mem_ctx, struct hash_table *ht) const
{
ir_loop *new_loop = new(mem_ctx) ir_loop();
- foreach_in_list(ir_instruction, ir, &this->body_instructions) {
+ foreach_list(n, &this->body_instructions) {
+ ir_instruction *ir = (ir_instruction *) n;
new_loop->body_instructions.push_tail(ir->clone(mem_ctx, ht));
}
@@ -148,7 +158,8 @@ ir_call::clone(void *mem_ctx, struct hash_table *ht) const
exec_list new_parameters;
- foreach_in_list(ir_instruction, ir, &this->actual_parameters) {
+ foreach_list(n, &this->actual_parameters) {
+ ir_instruction *ir = (ir_instruction *) n;
new_parameters.push_tail(ir->clone(mem_ctx, ht));
}
@@ -267,7 +278,10 @@ ir_function::clone(void *mem_ctx, struct hash_table *ht) const
{
ir_function *copy = new(mem_ctx) ir_function(this->name);
- foreach_in_list(const ir_function_signature, sig, &this->signatures) {
+ foreach_list_const(node, &this->signatures) {
+ const ir_function_signature *const sig =
+ (const ir_function_signature *const) node;
+
ir_function_signature *sig_copy = sig->clone(mem_ctx, ht);
copy->add_signature(sig_copy);
@@ -288,7 +302,9 @@ ir_function_signature::clone(void *mem_ctx, struct hash_table *ht) const
/* Clone the instruction list.
*/
- foreach_in_list(const ir_instruction, inst, &this->body) {
+ foreach_list_const(node, &this->body) {
+ const ir_instruction *const inst = (const ir_instruction *) node;
+
ir_instruction *const inst_copy = inst->clone(mem_ctx, ht);
copy->body.push_tail(inst_copy);
}
@@ -308,7 +324,9 @@ ir_function_signature::clone_prototype(void *mem_ctx, struct hash_table *ht) con
/* Clone the parameter list, but NOT the body.
*/
- foreach_in_list(const ir_variable, param, &this->parameters) {
+ foreach_list_const(node, &this->parameters) {
+ const ir_variable *const param = (const ir_variable *) node;
+
assert(const_cast<ir_variable *>(param)->as_variable() != NULL);
ir_variable *const param_copy = param->clone(mem_ctx, ht);
@@ -412,7 +430,8 @@ clone_ir_list(void *mem_ctx, exec_list *out, const exec_list *in)
struct hash_table *ht =
hash_table_ctor(0, hash_table_pointer_hash, hash_table_pointer_compare);
- foreach_in_list(const ir_instruction, original, in) {
+ foreach_list_const(node, in) {
+ const ir_instruction *const original = (ir_instruction *) node;
ir_instruction *copy = original->clone(mem_ctx, ht);
out->push_tail(copy);
diff --git a/dist/Mesa/src/glsl/ir_constant_expression.cpp b/dist/Mesa/src/glsl/ir_constant_expression.cpp
index 1e8b3a3cc..8afe8f776 100644
--- a/dist/Mesa/src/glsl/ir_constant_expression.cpp
+++ b/dist/Mesa/src/glsl/ir_constant_expression.cpp
@@ -36,6 +36,7 @@
#include <math.h>
#include "main/core.h" /* for MAX2, MIN2, CLAMP */
#include "ir.h"
+#include "ir_visitor.h"
#include "glsl_types.h"
#include "program/hash_table.h"
@@ -510,8 +511,6 @@ ir_expression::constant_expression_value(struct hash_table *variable_context)
case ir_binop_lshift:
case ir_binop_rshift:
case ir_binop_ldexp:
- case ir_binop_interpolate_at_offset:
- case ir_binop_interpolate_at_sample:
case ir_binop_vector_extract:
case ir_triop_csel:
case ir_triop_bitfield_extract:
@@ -851,11 +850,7 @@ ir_expression::constant_expression_value(struct hash_table *variable_context)
break;
case ir_unop_dFdx:
- case ir_unop_dFdx_coarse:
- case ir_unop_dFdx_fine:
case ir_unop_dFdy:
- case ir_unop_dFdy_coarse:
- case ir_unop_dFdy_fine:
assert(op[0]->type->base_type == GLSL_TYPE_FLOAT);
for (unsigned c = 0; c < op[0]->type->components(); c++) {
data.f[c] = 0.0;
@@ -1469,12 +1464,6 @@ ir_expression::constant_expression_value(struct hash_table *variable_context)
}
break;
- case ir_unop_saturate:
- for (unsigned c = 0; c < components; c++) {
- data.f[c] = CLAMP(op[0]->value.f[c], 0.0f, 1.0f);
- }
- break;
-
case ir_triop_bitfield_extract: {
int offset = op[1]->value.i[0];
int bits = op[2]->value.i[0];
@@ -1794,7 +1783,8 @@ bool ir_function_signature::constant_expression_evaluate_expression_list(const s
struct hash_table *variable_context,
ir_constant **result)
{
- foreach_in_list(ir_instruction, inst, &body) {
+ foreach_list(n, &body) {
+ ir_instruction *inst = (ir_instruction *)n;
switch(inst->ir_type) {
/* (declare () type symbol) */
@@ -1933,8 +1923,8 @@ ir_function_signature::constant_expression_value(exec_list *actual_parameters, s
*/
const exec_node *parameter_info = origin ? origin->parameters.head : parameters.head;
- foreach_in_list(ir_rvalue, n, actual_parameters) {
- ir_constant *constant = n->constant_expression_value(variable_context);
+ foreach_list(n, actual_parameters) {
+ ir_constant *constant = ((ir_rvalue *) n)->constant_expression_value(variable_context);
if (constant == NULL) {
hash_table_dtor(deref_hash);
return NULL;
diff --git a/dist/Mesa/src/glsl/ir_function.cpp b/dist/Mesa/src/glsl/ir_function.cpp
index 2b2643c64..40cf5894a 100644
--- a/dist/Mesa/src/glsl/ir_function.cpp
+++ b/dist/Mesa/src/glsl/ir_function.cpp
@@ -23,8 +23,6 @@
#include "glsl_types.h"
#include "ir.h"
-#include "glsl_parser_extras.h"
-#include "main/errors.h"
typedef enum {
PARAMETER_LIST_NO_MATCH,
@@ -40,8 +38,7 @@ typedef enum {
* \see matching_signature()
*/
static parameter_list_match_t
-parameter_lists_match(_mesa_glsl_parse_state *state,
- const exec_list *list_a, const exec_list *list_b)
+parameter_lists_match(const exec_list *list_a, const exec_list *list_b)
{
const exec_node *node_a = list_a->head;
const exec_node *node_b = list_b->head;
@@ -82,12 +79,12 @@ parameter_lists_match(_mesa_glsl_parse_state *state,
case ir_var_const_in:
case ir_var_function_in:
- if (!actual->type->can_implicitly_convert_to(param->type, state))
+ if (!actual->type->can_implicitly_convert_to(param->type))
return PARAMETER_LIST_NO_MATCH;
break;
case ir_var_function_out:
- if (!param->type->can_implicitly_convert_to(actual->type, state))
+ if (!param->type->can_implicitly_convert_to(actual->type))
return PARAMETER_LIST_NO_MATCH;
break;
@@ -118,188 +115,21 @@ parameter_lists_match(_mesa_glsl_parse_state *state,
}
-/* Classes of parameter match, sorted (mostly) best matches first.
- * See is_better_parameter_match() below for the exceptions.
- * */
-typedef enum {
- PARAMETER_EXACT_MATCH,
- PARAMETER_FLOAT_TO_DOUBLE,
- PARAMETER_INT_TO_FLOAT,
- PARAMETER_INT_TO_DOUBLE,
- PARAMETER_OTHER_CONVERSION,
-} parameter_match_t;
-
-
-static parameter_match_t
-get_parameter_match_type(const ir_variable *param,
- const ir_rvalue *actual)
-{
- const glsl_type *from_type;
- const glsl_type *to_type;
-
- if (param->data.mode == ir_var_function_out) {
- from_type = param->type;
- to_type = actual->type;
- } else {
- from_type = actual->type;
- to_type = param->type;
- }
-
- if (from_type == to_type)
- return PARAMETER_EXACT_MATCH;
-
- /* XXX: When ARB_gpu_shader_fp64 support is added, check for float->double,
- * and int/uint->double conversions
- */
-
- if (to_type->base_type == GLSL_TYPE_FLOAT)
- return PARAMETER_INT_TO_FLOAT;
-
- /* int -> uint and any other oddball conversions */
- return PARAMETER_OTHER_CONVERSION;
-}
-
-
-static bool
-is_better_parameter_match(parameter_match_t a_match,
- parameter_match_t b_match)
-{
- /* From section 6.1 of the GLSL 4.00 spec (and the ARB_gpu_shader5 spec):
- *
- * 1. An exact match is better than a match involving any implicit
- * conversion.
- *
- * 2. A match involving an implicit conversion from float to double
- * is better than match involving any other implicit conversion.
- *
- * [XXX: Not in GLSL 4.0: Only in ARB_gpu_shader5:
- * 3. A match involving an implicit conversion from either int or uint
- * to float is better than a match involving an implicit conversion
- * from either int or uint to double.]
- *
- * If none of the rules above apply to a particular pair of conversions,
- * neither conversion is considered better than the other.
- *
- * --
- *
- * Notably, the int->uint conversion is *not* considered to be better
- * or worse than int/uint->float or int/uint->double.
- */
-
- if (a_match >= PARAMETER_INT_TO_FLOAT && b_match == PARAMETER_OTHER_CONVERSION)
- return false;
-
- return a_match < b_match;
-}
-
-
-static bool
-is_best_inexact_overload(const exec_list *actual_parameters,
- ir_function_signature **matches,
- int num_matches,
- ir_function_signature *sig)
-{
- /* From section 6.1 of the GLSL 4.00 spec (and the ARB_gpu_shader5 spec):
- *
- * "A function definition A is considered a better
- * match than function definition B if:
- *
- * * for at least one function argument, the conversion for that argument
- * in A is better than the corresponding conversion in B; and
- *
- * * there is no function argument for which the conversion in B is better
- * than the corresponding conversion in A.
- *
- * If a single function definition is considered a better match than every
- * other matching function definition, it will be used. Otherwise, a
- * semantic error occurs and the shader will fail to compile."
- */
- for (ir_function_signature **other = matches;
- other < matches + num_matches; other++) {
- if (*other == sig)
- continue;
-
- const exec_node *node_a = sig->parameters.head;
- const exec_node *node_b = (*other)->parameters.head;
- const exec_node *node_p = actual_parameters->head;
-
- bool better_for_some_parameter = false;
-
- for (/* empty */
- ; !node_a->is_tail_sentinel()
- ; node_a = node_a->next,
- node_b = node_b->next,
- node_p = node_p->next) {
- parameter_match_t a_match = get_parameter_match_type(
- (const ir_variable *)node_a,
- (const ir_rvalue *)node_p);
- parameter_match_t b_match = get_parameter_match_type(
- (const ir_variable *)node_b,
- (const ir_rvalue *)node_p);
-
- if (is_better_parameter_match(a_match, b_match))
- better_for_some_parameter = true;
-
- if (is_better_parameter_match(b_match, a_match))
- return false; /* B is better for this parameter */
- }
-
- if (!better_for_some_parameter)
- return false; /* A must be better than B for some parameter */
-
- }
-
- return true;
-}
-
-
-static ir_function_signature *
-choose_best_inexact_overload(_mesa_glsl_parse_state *state,
- const exec_list *actual_parameters,
- ir_function_signature **matches,
- int num_matches)
-{
- if (num_matches == 0)
- return NULL;
-
- if (num_matches == 1)
- return *matches;
-
- /* Without GLSL 4.0 / ARB_gpu_shader5, there is no overload resolution
- * among multiple inexact matches. Note that state may be NULL here if
- * called from the linker; in that case we assume everything supported in
- * any GLSL version is available. */
- if (!state || state->is_version(400, 0) || state->ARB_gpu_shader5_enable) {
- for (ir_function_signature **sig = matches; sig < matches + num_matches; sig++) {
- if (is_best_inexact_overload(actual_parameters, matches, num_matches, *sig))
- return *sig;
- }
- }
-
- return NULL; /* no best candidate */
-}
-
-
ir_function_signature *
ir_function::matching_signature(_mesa_glsl_parse_state *state,
- const exec_list *actual_parameters,
- bool allow_builtins)
+ const exec_list *actual_parameters)
{
bool is_exact;
- return matching_signature(state, actual_parameters, allow_builtins,
- &is_exact);
+ return matching_signature(state, actual_parameters, &is_exact);
}
ir_function_signature *
ir_function::matching_signature(_mesa_glsl_parse_state *state,
const exec_list *actual_parameters,
- bool allow_builtins,
- bool *is_exact)
+ bool *is_exact)
{
- ir_function_signature **inexact_matches = NULL;
- ir_function_signature **inexact_matches_temp;
ir_function_signature *match = NULL;
- int num_inexact_matches = 0;
+ bool multiple_inexact_matches = false;
/* From page 42 (page 49 of the PDF) of the GLSL 1.20 spec:
*
@@ -311,30 +141,23 @@ ir_function::matching_signature(_mesa_glsl_parse_state *state,
* multiple ways to apply these conversions to the actual arguments of a
* call such that the call can be made to match multiple signatures."
*/
- foreach_in_list(ir_function_signature, sig, &this->signatures) {
+ foreach_list(n, &this->signatures) {
+ ir_function_signature *const sig = (ir_function_signature *) n;
+
/* Skip over any built-ins that aren't available in this shader. */
- if (sig->is_builtin() && (!allow_builtins ||
- !sig->is_builtin_available(state)))
+ if (sig->is_builtin() && !sig->is_builtin_available(state))
continue;
- switch (parameter_lists_match(state, & sig->parameters, actual_parameters)) {
+ switch (parameter_lists_match(& sig->parameters, actual_parameters)) {
case PARAMETER_LIST_EXACT_MATCH:
- *is_exact = true;
- free(inexact_matches);
- return sig;
+ *is_exact = true;
+ return sig;
case PARAMETER_LIST_INEXACT_MATCH:
- inexact_matches_temp = (ir_function_signature **)
- realloc(inexact_matches,
- sizeof(*inexact_matches) *
- (num_inexact_matches + 1));
- if (inexact_matches_temp == NULL) {
- _mesa_error_no_memory(__func__);
- free(inexact_matches);
- return NULL;
- }
- inexact_matches = inexact_matches_temp;
- inexact_matches[num_inexact_matches++] = sig;
- continue;
+ if (match == NULL)
+ match = sig;
+ else
+ multiple_inexact_matches = true;
+ continue;
case PARAMETER_LIST_NO_MATCH:
continue;
default:
@@ -352,10 +175,9 @@ ir_function::matching_signature(_mesa_glsl_parse_state *state,
*/
*is_exact = false;
- match = choose_best_inexact_overload(state, actual_parameters,
- inexact_matches, num_inexact_matches);
+ if (multiple_inexact_matches)
+ return NULL;
- free(inexact_matches);
return match;
}
@@ -389,7 +211,9 @@ ir_function_signature *
ir_function::exact_matching_signature(_mesa_glsl_parse_state *state,
const exec_list *actual_parameters)
{
- foreach_in_list(ir_function_signature, sig, &this->signatures) {
+ foreach_list(n, &this->signatures) {
+ ir_function_signature *const sig = (ir_function_signature *) n;
+
/* Skip over any built-ins that aren't available in this shader. */
if (sig->is_builtin() && !sig->is_builtin_available(state))
continue;
diff --git a/dist/Mesa/src/glsl/ir_function_detect_recursion.cpp b/dist/Mesa/src/glsl/ir_function_detect_recursion.cpp
index b2334d2e4..5813315b6 100644
--- a/dist/Mesa/src/glsl/ir_function_detect_recursion.cpp
+++ b/dist/Mesa/src/glsl/ir_function_detect_recursion.cpp
@@ -229,13 +229,15 @@ public:
static void
destroy_links(exec_list *list, function *f)
{
- foreach_in_list_safe(call_node, node, list) {
+ foreach_list_safe(node, list) {
+ struct call_node *n = (struct call_node *) node;
+
/* If this is the right function, remove it. Note that the loop cannot
* terminate now. There can be multiple links to a function if it is
* either called multiple times or calls multiple times.
*/
- if (node->func == f)
- node->remove();
+ if (n->func == f)
+ n->remove();
}
}
diff --git a/dist/Mesa/src/glsl/ir_hierarchical_visitor.h b/dist/Mesa/src/glsl/ir_hierarchical_visitor.h
index faa52fd79..647d2e002 100644
--- a/dist/Mesa/src/glsl/ir_hierarchical_visitor.h
+++ b/dist/Mesa/src/glsl/ir_hierarchical_visitor.h
@@ -87,6 +87,8 @@ public:
virtual ir_visitor_status visit(class ir_variable *);
virtual ir_visitor_status visit(class ir_constant *);
virtual ir_visitor_status visit(class ir_loop_jump *);
+ virtual ir_visitor_status visit(class ir_emit_vertex *);
+ virtual ir_visitor_status visit(class ir_end_primitive *);
/**
* ir_dereference_variable isn't technically a leaf, but it is treated as a
@@ -135,10 +137,6 @@ public:
virtual ir_visitor_status visit_leave(class ir_discard *);
virtual ir_visitor_status visit_enter(class ir_if *);
virtual ir_visitor_status visit_leave(class ir_if *);
- virtual ir_visitor_status visit_enter(class ir_emit_vertex *);
- virtual ir_visitor_status visit_leave(class ir_emit_vertex *);
- virtual ir_visitor_status visit_enter(class ir_end_primitive *);
- virtual ir_visitor_status visit_leave(class ir_end_primitive *);
/*@}*/
@@ -163,29 +161,14 @@ public:
* \warning
* Visitor classes derived from \c ir_hierarchical_visitor \b may \b not
* invoke this function. This can be used, for example, to cause the
- * callback to be invoked on every node type except one.
+ * callback to be invoked on every node type execpt one.
*/
- void (*callback_enter)(class ir_instruction *ir, void *data);
+ void (*callback)(class ir_instruction *ir, void *data);
/**
- * Callback function that is invoked on exit of each node visited.
- *
- * \warning
- * Visitor classes derived from \c ir_hierarchical_visitor \b may \b not
- * invoke this function. This can be used, for example, to cause the
- * callback to be invoked on every node type except one.
- */
- void (*callback_leave)(class ir_instruction *ir, void *data);
-
- /**
- * Extra data parameter passed to the per-node callback_enter function
- */
- void *data_enter;
-
- /**
- * Extra data parameter passed to the per-node callback_leave function
+ * Extra data parameter passed to the per-node callback function
*/
- void *data_leave;
+ void *data;
/**
* Currently in the LHS of an assignment?
@@ -196,10 +179,8 @@ public:
};
void visit_tree(ir_instruction *ir,
- void (*callback_enter)(class ir_instruction *ir, void *data),
- void *data_enter,
- void (*callback_leave)(class ir_instruction *ir, void *data) = NULL,
- void *data_leave = NULL);
+ void (*callback)(class ir_instruction *ir, void *data),
+ void *data);
ir_visitor_status visit_list_elements(ir_hierarchical_visitor *v, exec_list *l,
bool statement_list = true);
diff --git a/dist/Mesa/src/glsl/ir_hv_accept.cpp b/dist/Mesa/src/glsl/ir_hv_accept.cpp
index be5b3eaa0..2a1f70e5b 100644
--- a/dist/Mesa/src/glsl/ir_hv_accept.cpp
+++ b/dist/Mesa/src/glsl/ir_hv_accept.cpp
@@ -49,7 +49,8 @@ visit_list_elements(ir_hierarchical_visitor *v, exec_list *l,
{
ir_instruction *prev_base_ir = v->base_ir;
- foreach_in_list_safe(ir_instruction, ir, l) {
+ foreach_list_safe(n, l) {
+ ir_instruction *const ir = (ir_instruction *) n;
if (statement_list)
v->base_ir = ir;
ir_visitor_status s = ir->accept(v);
@@ -404,28 +405,12 @@ ir_if::accept(ir_hierarchical_visitor *v)
ir_visitor_status
ir_emit_vertex::accept(ir_hierarchical_visitor *v)
{
- ir_visitor_status s = v->visit_enter(this);
- if (s != visit_continue)
- return (s == visit_continue_with_parent) ? visit_continue : s;
-
- s = this->stream->accept(v);
- if (s != visit_continue)
- return (s == visit_continue_with_parent) ? visit_continue : s;
-
- return (s == visit_stop) ? s : v->visit_leave(this);
+ return v->visit(this);
}
ir_visitor_status
ir_end_primitive::accept(ir_hierarchical_visitor *v)
{
- ir_visitor_status s = v->visit_enter(this);
- if (s != visit_continue)
- return (s == visit_continue_with_parent) ? visit_continue : s;
-
- s = this->stream->accept(v);
- if (s != visit_continue)
- return (s == visit_continue_with_parent) ? visit_continue : s;
-
- return (s == visit_stop) ? s : v->visit_leave(this);
+ return v->visit(this);
}
diff --git a/dist/Mesa/src/glsl/ir_optimization.h b/dist/Mesa/src/glsl/ir_optimization.h
index 34e0b4b94..c63921c26 100644
--- a/dist/Mesa/src/glsl/ir_optimization.h
+++ b/dist/Mesa/src/glsl/ir_optimization.h
@@ -40,7 +40,6 @@
#define LDEXP_TO_ARITH 0x100
#define CARRY_TO_ARITH 0x200
#define BORROW_TO_ARITH 0x400
-#define SAT_TO_CLAMP 0x800
/**
* \see class lower_packing_builtins_visitor
@@ -72,9 +71,7 @@ bool do_common_optimization(exec_list *ir, bool linked,
const struct gl_shader_compiler_options *options,
bool native_integers);
-bool do_rebalance_tree(exec_list *instructions);
-bool do_algebraic(exec_list *instructions, bool native_integers,
- const struct gl_shader_compiler_options *options);
+bool do_algebraic(exec_list *instructions, bool native_integers);
bool do_constant_folding(exec_list *instructions);
bool do_constant_variable(exec_list *instructions);
bool do_constant_variable_unlinked(exec_list *instructions);
@@ -99,7 +96,6 @@ bool opt_flatten_nested_if_blocks(exec_list *instructions);
bool do_discard_simplification(exec_list *instructions);
bool lower_if_to_cond_assign(exec_list *instructions, unsigned max_depth = 0);
bool do_mat_op_to_vec(exec_list *instructions);
-bool do_minmax_prune(exec_list *instructions);
bool do_noop_swizzle(exec_list *instructions);
bool do_structure_splitting(exec_list *instructions);
bool do_swizzle_swizzle(exec_list *instructions);
@@ -114,7 +110,6 @@ bool lower_noise(exec_list *instructions);
bool lower_variable_index_to_cond_assign(exec_list *instructions,
bool lower_input, bool lower_output, bool lower_temp, bool lower_uniform);
bool lower_quadop_vector(exec_list *instructions, bool dont_lower_swz);
-bool lower_const_arrays_to_uniforms(exec_list *instructions);
bool lower_clip_distance(gl_shader *shader);
void lower_output_reads(exec_list *instructions);
bool lower_packing_builtins(exec_list *instructions, int op_mask);
@@ -127,10 +122,6 @@ void lower_named_interface_blocks(void *mem_ctx, gl_shader *shader);
bool optimize_redundant_jumps(exec_list *instructions);
bool optimize_split_arrays(exec_list *instructions, bool linked);
bool lower_offset_arrays(exec_list *instructions);
-void optimize_dead_builtin_variables(exec_list *instructions,
- enum ir_variable_mode other);
-
-bool lower_vertex_id(gl_shader *shader);
ir_rvalue *
compare_index_block(exec_list *instructions, ir_variable *index,
diff --git a/dist/Mesa/src/glsl/ir_print_visitor.cpp b/dist/Mesa/src/glsl/ir_print_visitor.cpp
index bd398052c..6f370b971 100644
--- a/dist/Mesa/src/glsl/ir_print_visitor.cpp
+++ b/dist/Mesa/src/glsl/ir_print_visitor.cpp
@@ -67,7 +67,8 @@ _mesa_print_ir(FILE *f, exec_list *instructions,
}
fprintf(f, "(\n");
- foreach_in_list(ir_instruction, ir, instructions) {
+ foreach_list(n, instructions) {
+ ir_instruction *ir = (ir_instruction *) n;
ir->fprint(f);
if (ir->ir_type != ir_type_function)
fprintf(f, "\n");
@@ -75,13 +76,6 @@ _mesa_print_ir(FILE *f, exec_list *instructions,
fprintf(f, "\n)");
}
-void
-fprint_ir(FILE *f, const void *instruction)
-{
- const ir_instruction *ir = (const ir_instruction *)instruction;
- ir->fprint(f);
-}
-
} /* extern "C" */
ir_print_visitor::ir_print_visitor(FILE *f)
@@ -145,7 +139,7 @@ print_type(FILE *f, const glsl_type *t)
print_type(f, t->fields.array);
fprintf(f, " %u)", t->length);
} else if ((t->base_type == GLSL_TYPE_STRUCT)
- && !is_gl_identifier(t->name)) {
+ && (strncmp("gl_", t->name, 3) != 0)) {
fprintf(f, "%s@%p", t->name, (void *) t);
} else {
fprintf(f, "%s", t->name);
@@ -168,14 +162,11 @@ void ir_print_visitor::visit(ir_variable *ir)
"in ", "out ", "inout ",
"const_in ", "sys ", "temporary " };
STATIC_ASSERT(ARRAY_SIZE(mode) == ir_var_mode_count);
- const char *const stream [] = {"", "stream1 ", "stream2 ", "stream3 "};
const char *const interp[] = { "", "smooth", "flat", "noperspective" };
STATIC_ASSERT(ARRAY_SIZE(interp) == INTERP_QUALIFIER_COUNT);
- fprintf(f, "(%s%s%s%s%s%s) ",
- cent, samp, inv, mode[ir->data.mode],
- stream[ir->data.stream],
- interp[ir->data.interpolation]);
+ fprintf(f, "(%s%s%s%s%s) ",
+ cent, samp, inv, mode[ir->data.mode], interp[ir->data.interpolation]);
print_type(f, ir->type);
fprintf(f, " %s)", unique_name(ir));
@@ -195,7 +186,9 @@ void ir_print_visitor::visit(ir_function_signature *ir)
fprintf(f, "(parameters\n");
indentation++;
- foreach_in_list(ir_variable, inst, &ir->parameters) {
+ foreach_list(n, &ir->parameters) {
+ ir_variable *const inst = (ir_variable *) n;
+
indent();
inst->accept(this);
fprintf(f, "\n");
@@ -210,7 +203,9 @@ void ir_print_visitor::visit(ir_function_signature *ir)
fprintf(f, "(\n");
indentation++;
- foreach_in_list(ir_instruction, inst, &ir->body) {
+ foreach_list(n, &ir->body) {
+ ir_instruction *const inst = (ir_instruction *) n;
+
indent();
inst->accept(this);
fprintf(f, "\n");
@@ -227,7 +222,8 @@ void ir_print_visitor::visit(ir_function *ir)
{
fprintf(f, "(function %s\n", ir->name);
indentation++;
- foreach_in_list(ir_function_signature, sig, &ir->signatures) {
+ foreach_list(n, &ir->signatures) {
+ ir_function_signature *const sig = (ir_function_signature *) n;
indent();
sig->accept(this);
fprintf(f, "\n");
@@ -427,7 +423,7 @@ void ir_print_visitor::visit(ir_constant *ir)
case GLSL_TYPE_FLOAT:
if (ir->value.f[i] == 0.0f)
/* 0.0 == -0.0, so print with %f to get the proper sign. */
- fprintf(f, "%f", ir->value.f[i]);
+ fprintf(f, "%.1f", ir->value.f[i]);
else if (fabs(ir->value.f[i]) < 0.000001f)
fprintf(f, "%a", ir->value.f[i]);
else if (fabs(ir->value.f[i]) > 1000000.0f)
@@ -451,7 +447,9 @@ ir_print_visitor::visit(ir_call *ir)
if (ir->return_deref)
ir->return_deref->accept(this);
fprintf(f, " (");
- foreach_in_list(ir_rvalue, param, &ir->actual_parameters) {
+ foreach_list(n, &ir->actual_parameters) {
+ ir_rvalue *const param = (ir_rvalue *) n;
+
param->accept(this);
}
fprintf(f, "))\n");
@@ -496,7 +494,9 @@ ir_print_visitor::visit(ir_if *ir)
fprintf(f, "(\n");
indentation++;
- foreach_in_list(ir_instruction, inst, &ir->then_instructions) {
+ foreach_list(n, &ir->then_instructions) {
+ ir_instruction *const inst = (ir_instruction *) n;
+
indent();
inst->accept(this);
fprintf(f, "\n");
@@ -511,7 +511,9 @@ ir_print_visitor::visit(ir_if *ir)
fprintf(f, "(\n");
indentation++;
- foreach_in_list(ir_instruction, inst, &ir->else_instructions) {
+ foreach_list(n, &ir->else_instructions) {
+ ir_instruction *const inst = (ir_instruction *) n;
+
indent();
inst->accept(this);
fprintf(f, "\n");
@@ -531,7 +533,9 @@ ir_print_visitor::visit(ir_loop *ir)
fprintf(f, "(loop (\n");
indentation++;
- foreach_in_list(ir_instruction, inst, &ir->body_instructions) {
+ foreach_list(n, &ir->body_instructions) {
+ ir_instruction *const inst = (ir_instruction *) n;
+
indent();
inst->accept(this);
fprintf(f, "\n");
@@ -549,18 +553,13 @@ ir_print_visitor::visit(ir_loop_jump *ir)
}
void
-ir_print_visitor::visit(ir_emit_vertex *ir)
+ir_print_visitor::visit(ir_emit_vertex *)
{
- fprintf(f, "(emit-vertex ");
- ir->stream->accept(this);
- fprintf(f, ")\n");
+ fprintf(f, "(emit-vertex)");
}
void
-ir_print_visitor::visit(ir_end_primitive *ir)
+ir_print_visitor::visit(ir_end_primitive *)
{
- fprintf(f, "(end-primitive ");
- ir->stream->accept(this);
- fprintf(f, ")\n");
-
+ fprintf(f, "(end-primitive)");
}
diff --git a/dist/Mesa/src/glsl/ir_reader.cpp b/dist/Mesa/src/glsl/ir_reader.cpp
index ae00e7934..28923f3b8 100644
--- a/dist/Mesa/src/glsl/ir_reader.cpp
+++ b/dist/Mesa/src/glsl/ir_reader.cpp
@@ -170,8 +170,9 @@ ir_reader::scan_for_prototypes(exec_list *instructions, s_expression *expr)
return;
}
- foreach_in_list(s_list, sub, &list->subexpressions) {
- if (!sub->is_list())
+ foreach_list(n, &list->subexpressions) {
+ s_list *sub = SX_AS_LIST(n);
+ if (sub == NULL)
continue; // not a (function ...); ignore it.
s_symbol *tag = SX_AS_SYMBOL(sub->subexpressions.get_head());
@@ -316,7 +317,8 @@ ir_reader::read_instructions(exec_list *instructions, s_expression *expr,
return;
}
- foreach_in_list(s_expression, sub, &list->subexpressions) {
+ foreach_list(n, &list->subexpressions) {
+ s_expression *sub = (s_expression *) n;
ir_instruction *ir = read_instruction(sub, loop_ctx);
if (ir != NULL) {
/* Global variable declarations should be moved to the top, before
@@ -403,8 +405,9 @@ ir_reader::read_declaration(s_expression *expr)
ir_variable *var = new(mem_ctx) ir_variable(type, s_name->value(),
ir_var_auto);
- foreach_in_list(s_symbol, qualifier, &s_quals->subexpressions) {
- if (!qualifier->is_symbol()) {
+ foreach_list(n, &s_quals->subexpressions) {
+ s_symbol *qualifier = SX_AS_SYMBOL(n);
+ if (qualifier == NULL) {
ir_read_error(expr, "qualifier list must contain only symbols");
return NULL;
}
@@ -434,12 +437,6 @@ ir_reader::read_declaration(s_expression *expr)
var->data.mode = ir_var_function_inout;
} else if (strcmp(qualifier->value(), "temporary") == 0) {
var->data.mode = ir_var_temporary;
- } else if (strcmp(qualifier->value(), "stream1") == 0) {
- var->data.stream = 1;
- } else if (strcmp(qualifier->value(), "stream2") == 0) {
- var->data.stream = 2;
- } else if (strcmp(qualifier->value(), "stream3") == 0) {
- var->data.stream = 3;
} else if (strcmp(qualifier->value(), "smooth") == 0) {
var->data.interpolation = INTERP_QUALIFIER_SMOOTH;
} else if (strcmp(qualifier->value(), "flat") == 0) {
@@ -661,10 +658,11 @@ ir_reader::read_call(s_expression *expr)
exec_list parameters;
- foreach_in_list(s_expression, e, &params->subexpressions) {
- ir_rvalue *param = read_rvalue(e);
+ foreach_list(n, &params->subexpressions) {
+ s_expression *expr = (s_expression *) n;
+ ir_rvalue *param = read_rvalue(expr);
if (param == NULL) {
- ir_read_error(e, "when reading parameter to function call");
+ ir_read_error(expr, "when reading parameter to function call");
return NULL;
}
parameters.push_tail(param);
@@ -677,8 +675,7 @@ ir_reader::read_call(s_expression *expr)
return NULL;
}
- ir_function_signature *callee =
- f->matching_signature(state, &parameters, true);
+ ir_function_signature *callee = f->matching_signature(state, &parameters);
if (callee == NULL) {
ir_read_error(expr, "couldn't find matching signature for function "
"%s", name->value());
@@ -724,9 +721,10 @@ ir_reader::read_expression(s_expression *expr)
ir_read_error(expr, "invalid operator: %s", s_op->value());
return NULL;
}
-
- /* Skip "expression" <type> <operation> by subtracting 3. */
- int num_operands = (int) ((s_list *) expr)->subexpressions.length() - 3;
+
+ int num_operands = -3; /* skip "expression" <type> <operation> */
+ foreach_list(n, &((s_list *) expr)->subexpressions)
+ ++num_operands;
int expected_operands = ir_expression::get_num_operands(op);
if (num_operands != expected_operands) {
@@ -800,7 +798,8 @@ ir_reader::read_constant(s_expression *expr)
if (type->is_array()) {
unsigned elements_supplied = 0;
exec_list elements;
- foreach_in_list(s_expression, elt, &values->subexpressions) {
+ foreach_list(n, &values->subexpressions) {
+ s_expression *elt = (s_expression *) n;
ir_constant *ir_elt = read_constant(elt);
if (ir_elt == NULL)
return NULL;
@@ -820,12 +819,14 @@ ir_reader::read_constant(s_expression *expr)
// Read in list of values (at most 16).
unsigned k = 0;
- foreach_in_list(s_expression, expr, &values->subexpressions) {
+ foreach_list(n, &values->subexpressions) {
if (k >= 16) {
ir_read_error(values, "expected at most 16 numbers");
return NULL;
}
+ s_expression *expr = (s_expression *) n;
+
if (type->base_type == GLSL_TYPE_FLOAT) {
s_number *value = SX_AS_NUMBER(expr);
if (value == NULL) {
@@ -1108,17 +1109,10 @@ ir_reader::read_texture(s_expression *expr)
ir_emit_vertex *
ir_reader::read_emit_vertex(s_expression *expr)
{
- s_expression *s_stream = NULL;
-
- s_pattern pat[] = { "emit-vertex", s_stream };
+ s_pattern pat[] = { "emit-vertex" };
if (MATCH(expr, pat)) {
- ir_rvalue *stream = read_dereference(s_stream);
- if (stream == NULL) {
- ir_read_error(NULL, "when reading stream info in emit-vertex");
- return NULL;
- }
- return new(mem_ctx) ir_emit_vertex(stream);
+ return new(mem_ctx) ir_emit_vertex();
}
ir_read_error(NULL, "when reading emit-vertex");
return NULL;
@@ -1127,17 +1121,10 @@ ir_reader::read_emit_vertex(s_expression *expr)
ir_end_primitive *
ir_reader::read_end_primitive(s_expression *expr)
{
- s_expression *s_stream = NULL;
-
- s_pattern pat[] = { "end-primitive", s_stream };
+ s_pattern pat[] = { "end-primitive" };
if (MATCH(expr, pat)) {
- ir_rvalue *stream = read_dereference(s_stream);
- if (stream == NULL) {
- ir_read_error(NULL, "when reading stream info in end-primitive");
- return NULL;
- }
- return new(mem_ctx) ir_end_primitive(stream);
+ return new(mem_ctx) ir_end_primitive();
}
ir_read_error(NULL, "when reading end-primitive");
return NULL;
diff --git a/dist/Mesa/src/glsl/ir_rvalue_visitor.cpp b/dist/Mesa/src/glsl/ir_rvalue_visitor.cpp
index 34cdb1c98..fcbe9448d 100644
--- a/dist/Mesa/src/glsl/ir_rvalue_visitor.cpp
+++ b/dist/Mesa/src/glsl/ir_rvalue_visitor.cpp
@@ -123,7 +123,8 @@ ir_rvalue_base_visitor::rvalue_visit(ir_assignment *ir)
ir_visitor_status
ir_rvalue_base_visitor::rvalue_visit(ir_call *ir)
{
- foreach_in_list_safe(ir_rvalue, param, &ir->actual_parameters) {
+ foreach_list_safe(n, &ir->actual_parameters) {
+ ir_rvalue *param = (ir_rvalue *) n;
ir_rvalue *new_param = param;
handle_rvalue(&new_param);
@@ -148,19 +149,6 @@ ir_rvalue_base_visitor::rvalue_visit(ir_if *ir)
return visit_continue;
}
-ir_visitor_status
-ir_rvalue_base_visitor::rvalue_visit(ir_emit_vertex *ir)
-{
- handle_rvalue(&ir->stream);
- return visit_continue;
-}
-
-ir_visitor_status
-ir_rvalue_base_visitor::rvalue_visit(ir_end_primitive *ir)
-{
- handle_rvalue(&ir->stream);
- return visit_continue;
-}
ir_visitor_status
ir_rvalue_visitor::visit_leave(ir_expression *ir)
@@ -217,18 +205,6 @@ ir_rvalue_visitor::visit_leave(ir_if *ir)
}
ir_visitor_status
-ir_rvalue_visitor::visit_leave(ir_emit_vertex *ir)
-{
- return rvalue_visit(ir);
-}
-
-ir_visitor_status
-ir_rvalue_visitor::visit_leave(ir_end_primitive *ir)
-{
- return rvalue_visit(ir);
-}
-
-ir_visitor_status
ir_rvalue_enter_visitor::visit_enter(ir_expression *ir)
{
return rvalue_visit(ir);
@@ -281,15 +257,3 @@ ir_rvalue_enter_visitor::visit_enter(ir_if *ir)
{
return rvalue_visit(ir);
}
-
-ir_visitor_status
-ir_rvalue_enter_visitor::visit_enter(ir_emit_vertex *ir)
-{
- return rvalue_visit(ir);
-}
-
-ir_visitor_status
-ir_rvalue_enter_visitor::visit_enter(ir_end_primitive *ir)
-{
- return rvalue_visit(ir);
-}
diff --git a/dist/Mesa/src/glsl/ir_set_program_inouts.cpp b/dist/Mesa/src/glsl/ir_set_program_inouts.cpp
index 97ead750a..5163eb215 100644
--- a/dist/Mesa/src/glsl/ir_set_program_inouts.cpp
+++ b/dist/Mesa/src/glsl/ir_set_program_inouts.cpp
@@ -306,9 +306,7 @@ ir_visitor_status
ir_set_program_inouts_visitor::visit_enter(ir_expression *ir)
{
if (this->shader_stage == MESA_SHADER_FRAGMENT &&
- (ir->operation == ir_unop_dFdy ||
- ir->operation == ir_unop_dFdy_coarse ||
- ir->operation == ir_unop_dFdy_fine)) {
+ ir->operation == ir_unop_dFdy) {
gl_fragment_program *fprog = (gl_fragment_program *) prog;
fprog->UsesDFdy = true;
}
diff --git a/dist/Mesa/src/glsl/ir_validate.cpp b/dist/Mesa/src/glsl/ir_validate.cpp
index 5a6f8bbf5..71defc815 100644
--- a/dist/Mesa/src/glsl/ir_validate.cpp
+++ b/dist/Mesa/src/glsl/ir_validate.cpp
@@ -49,8 +49,8 @@ public:
this->current_function = NULL;
- this->callback_enter = ir_validate::validate_ir;
- this->data_enter = ht;
+ this->callback = ir_validate::validate_ir;
+ this->data = ht;
}
~ir_validate()
@@ -100,7 +100,7 @@ ir_validate::visit(ir_dereference_variable *ir)
abort();
}
- this->validate_ir(ir, this->data_enter);
+ this->validate_ir(ir, this->data);
return visit_continue;
}
@@ -167,12 +167,14 @@ ir_validate::visit_enter(ir_function *ir)
*/
this->current_function = ir;
- this->validate_ir(ir, this->data_enter);
+ this->validate_ir(ir, this->data);
/* Verify that all of the things stored in the list of signatures are,
* in fact, function signatures.
*/
- foreach_in_list(ir_instruction, sig, &ir->signatures) {
+ foreach_list(node, &ir->signatures) {
+ ir_instruction *sig = (ir_instruction *) node;
+
if (sig->ir_type != ir_type_function_signature) {
printf("Non-signature in signature list of function `%s'\n",
ir->name);
@@ -211,7 +213,7 @@ ir_validate::visit_enter(ir_function_signature *ir)
abort();
}
- this->validate_ir(ir, this->data_enter);
+ this->validate_ir(ir, this->data);
return visit_continue;
}
@@ -241,7 +243,6 @@ ir_validate::visit_leave(ir_expression *ir)
case ir_unop_log:
case ir_unop_exp2:
case ir_unop_log2:
- case ir_unop_saturate:
assert(ir->operands[0]->type->base_type == GLSL_TYPE_FLOAT);
assert(ir->type == ir->operands[0]->type);
break;
@@ -318,11 +319,7 @@ ir_validate::visit_leave(ir_expression *ir)
case ir_unop_sin_reduced:
case ir_unop_cos_reduced:
case ir_unop_dFdx:
- case ir_unop_dFdx_coarse:
- case ir_unop_dFdx_fine:
case ir_unop_dFdy:
- case ir_unop_dFdy_coarse:
- case ir_unop_dFdy_fine:
assert(ir->operands[0]->type->base_type == GLSL_TYPE_FLOAT);
assert(ir->operands[0]->type == ir->type);
break;
@@ -376,11 +373,6 @@ ir_validate::visit_leave(ir_expression *ir)
/* XXX what can we assert here? */
break;
- case ir_unop_interpolate_at_centroid:
- assert(ir->operands[0]->type == ir->type);
- assert(ir->operands[0]->type->is_float());
- break;
-
case ir_binop_add:
case ir_binop_sub:
case ir_binop_mul:
@@ -500,6 +492,7 @@ ir_validate::visit_leave(ir_expression *ir)
break;
case ir_binop_ubo_load:
+ assert(ir->operands[0]->as_constant());
assert(ir->operands[0]->type == glsl_type::uint_type);
assert(ir->operands[1]->type == glsl_type::uint_type);
@@ -519,19 +512,6 @@ ir_validate::visit_leave(ir_expression *ir)
&& ir->operands[1]->type->is_integer());
break;
- case ir_binop_interpolate_at_offset:
- assert(ir->operands[0]->type == ir->type);
- assert(ir->operands[0]->type->is_float());
- assert(ir->operands[1]->type->components() == 2);
- assert(ir->operands[1]->type->is_float());
- break;
-
- case ir_binop_interpolate_at_sample:
- assert(ir->operands[0]->type == ir->type);
- assert(ir->operands[0]->type->is_float());
- assert(ir->operands[1]->type == glsl_type::int_type);
- break;
-
case ir_triop_fma:
assert(ir->type->base_type == GLSL_TYPE_FLOAT);
assert(ir->type == ir->operands[0]->type);
@@ -654,7 +634,7 @@ ir_validate::visit(ir_variable *ir)
* in the ir_dereference_variable handler to ensure that a variable is
* declared before it is dereferenced.
*/
- if (ir->name && ir->is_name_ralloced())
+ if (ir->name)
assert(ralloc_parent(ir->name) == ir);
hash_table_insert(ht, ir, ir);
@@ -682,15 +662,10 @@ ir_validate::visit(ir_variable *ir)
ir->get_interface_type()->fields.structure;
for (unsigned i = 0; i < ir->get_interface_type()->length; i++) {
if (fields[i].type->array_size() > 0) {
- const unsigned *const max_ifc_array_access =
- ir->get_max_ifc_array_access();
-
- assert(max_ifc_array_access != NULL);
-
- if (max_ifc_array_access[i] >= fields[i].type->length) {
+ if (ir->max_ifc_array_access[i] >= fields[i].type->length) {
printf("ir_variable has maximum access out of bounds for "
"field %s (%d vs %d)\n", fields[i].name,
- max_ifc_array_access[i], fields[i].type->length);
+ ir->max_ifc_array_access[i], fields[i].type->length);
ir->print();
abort();
}
@@ -705,14 +680,6 @@ ir_validate::visit(ir_variable *ir)
abort();
}
- if (ir->data.mode == ir_var_uniform
- && strncmp(ir->name, "gl_", 3) == 0
- && ir->get_state_slots() == NULL) {
- printf("built-in uniform has no state\n");
- ir->print();
- abort();
- }
-
return visit_continue;
}
@@ -743,7 +710,7 @@ ir_validate::visit_enter(ir_assignment *ir)
}
}
- this->validate_ir(ir, this->data_enter);
+ this->validate_ir(ir, this->data);
return visit_continue;
}
@@ -828,7 +795,7 @@ check_node_type(ir_instruction *ir, void *data)
{
(void) data;
- if (ir->ir_type >= ir_type_max) {
+ if (ir->ir_type <= ir_type_unset || ir->ir_type >= ir_type_max) {
printf("Instruction node with unset type\n");
ir->print(); printf("\n");
}
@@ -849,7 +816,9 @@ validate_ir_tree(exec_list *instructions)
v.run(instructions);
- foreach_in_list(ir_instruction, ir, instructions) {
+ foreach_list(n, instructions) {
+ ir_instruction *ir = (ir_instruction *) n;
+
visit_tree(ir, check_node_type, NULL);
}
#endif
diff --git a/dist/Mesa/src/glsl/link_functions.cpp b/dist/Mesa/src/glsl/link_functions.cpp
index 537f4dc77..56f3f207e 100644
--- a/dist/Mesa/src/glsl/link_functions.cpp
+++ b/dist/Mesa/src/glsl/link_functions.cpp
@@ -145,7 +145,8 @@ public:
struct hash_table *ht = hash_table_ctor(0, hash_table_pointer_hash,
hash_table_pointer_compare);
exec_list formal_parameters;
- foreach_in_list(const ir_instruction, original, &sig->parameters) {
+ foreach_list_const(node, &sig->parameters) {
+ const ir_instruction *const original = (ir_instruction *) node;
assert(const_cast<ir_instruction *>(original)->as_variable());
ir_instruction *copy = original->clone(linked, ht);
@@ -154,10 +155,10 @@ public:
linked_sig->replace_parameters(&formal_parameters);
- linked_sig->is_intrinsic = sig->is_intrinsic;
-
if (sig->is_defined) {
- foreach_in_list(const ir_instruction, original, &sig->body) {
+ foreach_list_const(node, &sig->body) {
+ const ir_instruction *const original = (ir_instruction *) node;
+
ir_instruction *copy = original->clone(linked, ht);
linked_sig->body.push_tail(copy);
}
@@ -245,19 +246,11 @@ public:
/* Similarly, we need implicit sizes of arrays within interface
* blocks to be sized by the maximal access in *any* shader.
*/
- unsigned *const linked_max_ifc_array_access =
- var->get_max_ifc_array_access();
- unsigned *const ir_max_ifc_array_access =
- ir->var->get_max_ifc_array_access();
-
- assert(linked_max_ifc_array_access != NULL);
- assert(ir_max_ifc_array_access != NULL);
-
for (unsigned i = 0; i < var->get_interface_type()->length;
i++) {
- linked_max_ifc_array_access[i] =
- MAX2(linked_max_ifc_array_access[i],
- ir_max_ifc_array_access[i]);
+ var->max_ifc_array_access[i] =
+ MAX2(var->max_ifc_array_access[i],
+ ir->var->max_ifc_array_access[i]);
}
}
}
@@ -317,7 +310,7 @@ find_matching_signature(const char *name, const exec_list *actual_parameters,
continue;
ir_function_signature *sig =
- f->matching_signature(NULL, actual_parameters, use_builtin);
+ f->matching_signature(NULL, actual_parameters);
if ((sig == NULL) ||
(!sig->is_defined && !sig->is_intrinsic))
diff --git a/dist/Mesa/src/glsl/linker.cpp b/dist/Mesa/src/glsl/linker.cpp
index 67d5ee674..a43d23082 100644
--- a/dist/Mesa/src/glsl/linker.cpp
+++ b/dist/Mesa/src/glsl/linker.cpp
@@ -74,7 +74,6 @@
#include "link_varyings.h"
#include "ir_optimization.h"
#include "ir_rvalue_visitor.h"
-#include "ir_uniform.h"
extern "C" {
#include "main/shaderobj.h"
@@ -250,100 +249,31 @@ public:
}
};
+
/**
- * Visitor that determines the highest stream id to which a (geometry) shader
- * emits vertices. It also checks whether End{Stream}Primitive is ever called.
+ * Visitor that determines whether or not a shader uses ir_end_primitive.
*/
-class find_emit_vertex_visitor : public ir_hierarchical_visitor {
+class find_end_primitive_visitor : public ir_hierarchical_visitor {
public:
- find_emit_vertex_visitor(int max_allowed)
- : max_stream_allowed(max_allowed),
- invalid_stream_id(0),
- invalid_stream_id_from_emit_vertex(false),
- end_primitive_found(false),
- uses_non_zero_stream(false)
+ find_end_primitive_visitor()
+ : found(false)
{
/* empty */
}
- virtual ir_visitor_status visit_leave(ir_emit_vertex *ir)
- {
- int stream_id = ir->stream_id();
-
- if (stream_id < 0) {
- invalid_stream_id = stream_id;
- invalid_stream_id_from_emit_vertex = true;
- return visit_stop;
- }
-
- if (stream_id > max_stream_allowed) {
- invalid_stream_id = stream_id;
- invalid_stream_id_from_emit_vertex = true;
- return visit_stop;
- }
-
- if (stream_id != 0)
- uses_non_zero_stream = true;
-
- return visit_continue;
- }
-
- virtual ir_visitor_status visit_leave(ir_end_primitive *ir)
- {
- end_primitive_found = true;
-
- int stream_id = ir->stream_id();
-
- if (stream_id < 0) {
- invalid_stream_id = stream_id;
- invalid_stream_id_from_emit_vertex = false;
- return visit_stop;
- }
-
- if (stream_id > max_stream_allowed) {
- invalid_stream_id = stream_id;
- invalid_stream_id_from_emit_vertex = false;
- return visit_stop;
- }
-
- if (stream_id != 0)
- uses_non_zero_stream = true;
-
- return visit_continue;
- }
-
- bool error()
- {
- return invalid_stream_id != 0;
- }
-
- const char *error_func()
- {
- return invalid_stream_id_from_emit_vertex ?
- "EmitStreamVertex" : "EndStreamPrimitive";
- }
-
- int error_stream()
- {
- return invalid_stream_id;
- }
-
- bool uses_streams()
+ virtual ir_visitor_status visit(ir_end_primitive *)
{
- return uses_non_zero_stream;
+ found = true;
+ return visit_stop;
}
- bool uses_end_primitive()
+ bool end_primitive_found()
{
- return end_primitive_found;
+ return found;
}
private:
- int max_stream_allowed;
- int invalid_stream_id;
- bool invalid_stream_id_from_emit_vertex;
- bool end_primitive_found;
- bool uses_non_zero_stream;
+ bool found;
};
} /* anonymous namespace */
@@ -437,8 +367,8 @@ parse_program_resource_name(const GLchar *name,
void
link_invalidate_variable_locations(exec_list *ir)
{
- foreach_in_list(ir_instruction, node, ir) {
- ir_variable *const var = node->as_variable();
+ foreach_list(node, ir) {
+ ir_variable *const var = ((ir_instruction *) node)->as_variable();
if (var == NULL)
continue;
@@ -559,21 +489,14 @@ validate_vertex_shader_executable(struct gl_shader_program *prog,
* vertex processing has occurred. Its value is undefined if
* the vertex shader executable does not write gl_Position."
*
- * All GLSL ES Versions are similar to GLSL 1.40--failing to write to
- * gl_Position is not an error.
+ * GLSL ES 3.00 is similar to GLSL 1.40--failing to write to gl_Position is
+ * not an error.
*/
if (prog->Version < (prog->IsES ? 300 : 140)) {
find_assignment_visitor find("gl_Position");
find.run(shader->ir);
if (!find.variable_found()) {
- if (prog->IsES) {
- linker_warning(prog,
- "vertex shader does not write to `gl_Position'."
- "It's value is undefined. \n");
- } else {
- linker_error(prog,
- "vertex shader does not write to `gl_Position'. \n");
- }
+ linker_error(prog, "vertex shader does not write to `gl_Position'\n");
return;
}
}
@@ -627,58 +550,10 @@ validate_geometry_shader_executable(struct gl_shader_program *prog,
analyze_clip_usage(prog, shader, &prog->Geom.UsesClipDistance,
&prog->Geom.ClipDistanceArraySize);
-}
-
-/**
- * Check if geometry shaders emit to non-zero streams and do corresponding
- * validations.
- */
-static void
-validate_geometry_shader_emissions(struct gl_context *ctx,
- struct gl_shader_program *prog)
-{
- if (prog->_LinkedShaders[MESA_SHADER_GEOMETRY] != NULL) {
- find_emit_vertex_visitor emit_vertex(ctx->Const.MaxVertexStreams - 1);
- emit_vertex.run(prog->_LinkedShaders[MESA_SHADER_GEOMETRY]->ir);
- if (emit_vertex.error()) {
- linker_error(prog, "Invalid call %s(%d). Accepted values for the "
- "stream parameter are in the range [0, %d].",
- emit_vertex.error_func(),
- emit_vertex.error_stream(),
- ctx->Const.MaxVertexStreams - 1);
- }
- prog->Geom.UsesStreams = emit_vertex.uses_streams();
- prog->Geom.UsesEndPrimitive = emit_vertex.uses_end_primitive();
- /* From the ARB_gpu_shader5 spec:
- *
- * "Multiple vertex streams are supported only if the output primitive
- * type is declared to be "points". A program will fail to link if it
- * contains a geometry shader calling EmitStreamVertex() or
- * EndStreamPrimitive() if its output primitive type is not "points".
- *
- * However, in the same spec:
- *
- * "The function EmitVertex() is equivalent to calling EmitStreamVertex()
- * with <stream> set to zero."
- *
- * And:
- *
- * "The function EndPrimitive() is equivalent to calling
- * EndStreamPrimitive() with <stream> set to zero."
- *
- * Since we can call EmitVertex() and EndPrimitive() when we output
- * primitives other than points, calling EmitStreamVertex(0) or
- * EmitEndPrimitive(0) should not produce errors. This it also what Nvidia
- * does. Currently we only set prog->Geom.UsesStreams to TRUE when
- * EmitStreamVertex() or EmitEndPrimitive() are called with a non-zero
- * stream.
- */
- if (prog->Geom.UsesStreams && prog->Geom.OutputType != GL_POINTS) {
- linker_error(prog, "EmitStreamVertex(n) and EndStreamPrimitive(n) "
- "with n>0 requires point output");
- }
- }
+ find_end_primitive_visitor end_primitive;
+ end_primitive.run(shader->ir);
+ prog->Geom.UsesEndPrimitive = end_primitive.end_primitive_found();
}
@@ -699,8 +574,8 @@ cross_validate_globals(struct gl_shader_program *prog,
if (shader_list[i] == NULL)
continue;
- foreach_in_list(ir_instruction, node, shader_list[i]->ir) {
- ir_variable *const var = node->as_variable();
+ foreach_list(node, shader_list[i]->ir) {
+ ir_variable *const var = ((ir_instruction *) node)->as_variable();
if (var == NULL)
continue;
@@ -969,15 +844,15 @@ populate_symbol_table(gl_shader *sh)
{
sh->symbols = new(sh) glsl_symbol_table;
- foreach_in_list(ir_instruction, inst, sh->ir) {
+ foreach_list(node, sh->ir) {
+ ir_instruction *const inst = (ir_instruction *) node;
ir_variable *var;
ir_function *func;
if ((func = inst->as_function()) != NULL) {
sh->symbols->add_function(func);
} else if ((var = inst->as_variable()) != NULL) {
- if (var->data.mode != ir_var_temporary)
- sh->symbols->add_variable(var);
+ sh->symbols->add_variable(var);
}
}
}
@@ -1086,7 +961,9 @@ move_non_declarations(exec_list *instructions, exec_node *last,
temps = hash_table_ctor(0, hash_table_pointer_hash,
hash_table_pointer_compare);
- foreach_in_list_safe(ir_instruction, inst, instructions) {
+ foreach_list_safe(node, instructions) {
+ ir_instruction *inst = (ir_instruction *) node;
+
if (inst->as_function())
continue;
@@ -1123,8 +1000,8 @@ move_non_declarations(exec_list *instructions, exec_node *last,
/**
* Get the function signature for main from a shader
*/
-ir_function_signature *
-link_get_main_function_signature(gl_shader *sh)
+static ir_function_signature *
+get_main_function_signature(gl_shader *sh)
{
ir_function *const f = sh->symbols->get_function("main");
if (f != NULL) {
@@ -1137,8 +1014,7 @@ link_get_main_function_signature(gl_shader *sh)
* We don't have to check for multiple definitions of main (in multiple
* shaders) because that would have already been caught above.
*/
- ir_function_signature *sig =
- f->matching_signature(NULL, &void_parameters, false);
+ ir_function_signature *sig = f->matching_signature(NULL, &void_parameters);
if ((sig != NULL) && sig->is_defined) {
return sig;
}
@@ -1174,8 +1050,7 @@ public:
if (var->type->is_interface()) {
if (interface_contains_unsized_arrays(var->type)) {
const glsl_type *new_type =
- resize_interface_members(var->type,
- var->get_max_ifc_array_access());
+ resize_interface_members(var->type, var->max_ifc_array_access);
var->type = new_type;
var->change_interface_type(new_type);
}
@@ -1184,7 +1059,7 @@ public:
if (interface_contains_unsized_arrays(var->type->fields.array)) {
const glsl_type *new_type =
resize_interface_members(var->type->fields.array,
- var->get_max_ifc_array_access());
+ var->max_ifc_array_access);
var->change_interface_type(new_type);
var->type =
glsl_type::get_array_instance(new_type, var->type->length);
@@ -1603,15 +1478,13 @@ link_intrastage_shaders(void *mem_ctx,
const unsigned num_uniform_blocks =
link_uniform_blocks(mem_ctx, prog, shader_list, num_shaders,
&uniform_blocks);
- if (!prog->LinkStatus)
- return NULL;
/* Check that there is only a single definition of each function signature
* across all shaders.
*/
for (unsigned i = 0; i < (num_shaders - 1); i++) {
- foreach_in_list(ir_instruction, node, shader_list[i]->ir) {
- ir_function *const f = node->as_function();
+ foreach_list(node, shader_list[i]->ir) {
+ ir_function *const f = ((ir_instruction *) node)->as_function();
if (f == NULL)
continue;
@@ -1626,7 +1499,9 @@ link_intrastage_shaders(void *mem_ctx,
if (other == NULL)
continue;
- foreach_in_list(ir_function_signature, sig, &f->signatures) {
+ foreach_list(n, &f->signatures) {
+ ir_function_signature *sig = (ir_function_signature *) n;
+
if (!sig->is_defined || sig->is_builtin())
continue;
@@ -1653,7 +1528,7 @@ link_intrastage_shaders(void *mem_ctx,
*/
gl_shader *main = NULL;
for (unsigned i = 0; i < num_shaders; i++) {
- if (link_get_main_function_signature(shader_list[i]) != NULL) {
+ if (get_main_function_signature(shader_list[i]) != NULL) {
main = shader_list[i];
break;
}
@@ -1679,11 +1554,10 @@ link_intrastage_shaders(void *mem_ctx,
populate_symbol_table(linked);
- /* The pointer to the main function in the final linked shader (i.e., the
+ /* The a pointer to the main function in the final linked shader (i.e., the
* copy of the original shader that contained the main function).
*/
- ir_function_signature *const main_sig =
- link_get_main_function_signature(linked);
+ ir_function_signature *const main_sig = get_main_function_signature(linked);
/* Move any instructions other than variable declarations or function
* declarations into main.
@@ -1716,19 +1590,12 @@ link_intrastage_shaders(void *mem_ctx,
*/
gl_shader **linking_shaders = (gl_shader **)
calloc(num_shaders + 1, sizeof(gl_shader *));
+ memcpy(linking_shaders, shader_list, num_shaders * sizeof(gl_shader *));
+ linking_shaders[num_shaders] = _mesa_glsl_get_builtin_function_shader();
- ok = linking_shaders != NULL;
-
- if (ok) {
- memcpy(linking_shaders, shader_list, num_shaders * sizeof(gl_shader *));
- linking_shaders[num_shaders] = _mesa_glsl_get_builtin_function_shader();
-
- ok = link_function_calls(prog, linked, linking_shaders, num_shaders + 1);
+ ok = link_function_calls(prog, linked, linking_shaders, num_shaders + 1);
- free(linking_shaders);
- } else {
- _mesa_error_no_memory(__func__);
- }
+ free(linking_shaders);
} else {
ok = link_function_calls(prog, linked, shader_list, num_shaders);
}
@@ -1748,14 +1615,12 @@ link_intrastage_shaders(void *mem_ctx,
if (linked->Stage == MESA_SHADER_GEOMETRY) {
unsigned num_vertices = vertices_per_prim(prog->Geom.InputType);
geom_array_resize_visitor input_resize_visitor(num_vertices, prog);
- foreach_in_list(ir_instruction, ir, linked->ir) {
+ foreach_list(n, linked->ir) {
+ ir_instruction *ir = (ir_instruction *) n;
ir->accept(&input_resize_visitor);
}
}
- if (ctx->Const.VertexID_is_zero_based)
- lower_vertex_id(linked);
-
/* Make a pass over all variable declarations to ensure that arrays with
* unspecified sizes have a size specified. The size is inferred from the
* max_array_access field.
@@ -1789,8 +1654,8 @@ update_array_sizes(struct gl_shader_program *prog)
if (prog->_LinkedShaders[i] == NULL)
continue;
- foreach_in_list(ir_instruction, node, prog->_LinkedShaders[i]->ir) {
- ir_variable *const var = node->as_variable();
+ foreach_list(node, prog->_LinkedShaders[i]->ir) {
+ ir_variable *const var = ((ir_instruction *) node)->as_variable();
if ((var == NULL) || (var->data.mode != ir_var_uniform) ||
!var->type->is_array())
@@ -1812,8 +1677,8 @@ update_array_sizes(struct gl_shader_program *prog)
if (prog->_LinkedShaders[j] == NULL)
continue;
- foreach_in_list(ir_instruction, node2, prog->_LinkedShaders[j]->ir) {
- ir_variable *other_var = node2->as_variable();
+ foreach_list(node2, prog->_LinkedShaders[j]->ir) {
+ ir_variable *other_var = ((ir_instruction *) node2)->as_variable();
if (!other_var)
continue;
@@ -1833,10 +1698,9 @@ update_array_sizes(struct gl_shader_program *prog)
* Determine the number of slots per array element by dividing by
* the old (total) size.
*/
- const unsigned num_slots = var->get_num_state_slots();
- if (num_slots > 0) {
- var->set_num_state_slots((size + 1)
- * (num_slots / var->type->length));
+ if (var->num_state_slots > 0) {
+ var->num_state_slots = (size + 1)
+ * (var->num_state_slots / var->type->length);
}
var->type = glsl_type::get_array_instance(var->type->fields.array,
@@ -1882,7 +1746,7 @@ find_available_slots(unsigned used_mask, unsigned needed_count)
/**
- * Assign locations for either VS inputs or FS outputs
+ * Assign locations for either VS inputs for FS outputs
*
* \param prog Shader program whose variables need locations assigned
* \param target_index Selector for the program target to receive location
@@ -1956,8 +1820,8 @@ assign_attribute_or_color_locations(gl_shader_program *prog,
unsigned num_attr = 0;
- foreach_in_list(ir_instruction, node, sh->ir) {
- ir_variable *const var = node->as_variable();
+ foreach_list(node, sh->ir) {
+ ir_variable *const var = ((ir_instruction *) node)->as_variable();
if ((var == NULL) || (var->data.mode != (unsigned) direction))
continue;
@@ -2175,8 +2039,8 @@ assign_attribute_or_color_locations(gl_shader_program *prog,
void
demote_shader_inputs_and_outputs(gl_shader *sh, enum ir_variable_mode mode)
{
- foreach_in_list(ir_instruction, node, sh->ir) {
- ir_variable *const var = node->as_variable();
+ foreach_list(node, sh->ir) {
+ ir_variable *const var = ((ir_instruction *) node)->as_variable();
if ((var == NULL) || (var->data.mode != int(mode)))
continue;
@@ -2186,7 +2050,6 @@ demote_shader_inputs_and_outputs(gl_shader *sh, enum ir_variable_mode mode)
* to have a location assigned.
*/
if (var->data.is_unmatched_generic_inout) {
- assert(var->data.mode != ir_var_temporary);
var->data.mode = ir_var_auto;
}
}
@@ -2212,8 +2075,8 @@ store_fragdepth_layout(struct gl_shader_program *prog)
* We're only interested in the cases where the variable is NOT removed
* from the IR.
*/
- foreach_in_list(ir_instruction, node, ir) {
- ir_variable *const var = node->as_variable();
+ foreach_list(node, ir) {
+ ir_variable *const var = ((ir_instruction *) node)->as_variable();
if (var == NULL || var->data.mode != ir_var_shader_out) {
continue;
@@ -2344,8 +2207,8 @@ check_image_resources(struct gl_context *ctx, struct gl_shader_program *prog)
total_image_units += sh->NumImages;
if (i == MESA_SHADER_FRAGMENT) {
- foreach_in_list(ir_instruction, node, sh->ir) {
- ir_variable *var = node->as_variable();
+ foreach_list(node, sh->ir) {
+ ir_variable *var = ((ir_instruction *)node)->as_variable();
if (var && var->data.mode == ir_var_shader_out)
fragment_outputs += var->type->count_attribute_slots();
}
@@ -2361,117 +2224,6 @@ check_image_resources(struct gl_context *ctx, struct gl_shader_program *prog)
linker_error(prog, "Too many combined image uniforms and fragment outputs");
}
-
-/**
- * Initializes explicit location slots to INACTIVE_UNIFORM_EXPLICIT_LOCATION
- * for a variable, checks for overlaps between other uniforms using explicit
- * locations.
- */
-static bool
-reserve_explicit_locations(struct gl_shader_program *prog,
- string_to_uint_map *map, ir_variable *var)
-{
- unsigned slots = var->type->uniform_locations();
- unsigned max_loc = var->data.location + slots - 1;
-
- /* Resize remap table if locations do not fit in the current one. */
- if (max_loc + 1 > prog->NumUniformRemapTable) {
- prog->UniformRemapTable =
- reralloc(prog, prog->UniformRemapTable,
- gl_uniform_storage *,
- max_loc + 1);
-
- if (!prog->UniformRemapTable) {
- linker_error(prog, "Out of memory during linking.");
- return false;
- }
-
- /* Initialize allocated space. */
- for (unsigned i = prog->NumUniformRemapTable; i < max_loc + 1; i++)
- prog->UniformRemapTable[i] = NULL;
-
- prog->NumUniformRemapTable = max_loc + 1;
- }
-
- for (unsigned i = 0; i < slots; i++) {
- unsigned loc = var->data.location + i;
-
- /* Check if location is already used. */
- if (prog->UniformRemapTable[loc] == INACTIVE_UNIFORM_EXPLICIT_LOCATION) {
-
- /* Possibly same uniform from a different stage, this is ok. */
- unsigned hash_loc;
- if (map->get(hash_loc, var->name) && hash_loc == loc - i)
- continue;
-
- /* ARB_explicit_uniform_location specification states:
- *
- * "No two default-block uniform variables in the program can have
- * the same location, even if they are unused, otherwise a compiler
- * or linker error will be generated."
- */
- linker_error(prog,
- "location qualifier for uniform %s overlaps "
- "previously used location",
- var->name);
- return false;
- }
-
- /* Initialize location as inactive before optimization
- * rounds and location assignment.
- */
- prog->UniformRemapTable[loc] = INACTIVE_UNIFORM_EXPLICIT_LOCATION;
- }
-
- /* Note, base location used for arrays. */
- map->put(var->data.location, var->name);
-
- return true;
-}
-
-/**
- * Check and reserve all explicit uniform locations, called before
- * any optimizations happen to handle also inactive uniforms and
- * inactive array elements that may get trimmed away.
- */
-static void
-check_explicit_uniform_locations(struct gl_context *ctx,
- struct gl_shader_program *prog)
-{
- if (!ctx->Extensions.ARB_explicit_uniform_location)
- return;
-
- /* This map is used to detect if overlapping explicit locations
- * occur with the same uniform (from different stage) or a different one.
- */
- string_to_uint_map *uniform_map = new string_to_uint_map;
-
- if (!uniform_map) {
- linker_error(prog, "Out of memory during linking.");
- return;
- }
-
- for (unsigned i = 0; i < MESA_SHADER_STAGES; i++) {
- struct gl_shader *sh = prog->_LinkedShaders[i];
-
- if (!sh)
- continue;
-
- foreach_in_list(ir_instruction, node, sh->ir) {
- ir_variable *var = node->as_variable();
- if ((var && var->data.mode == ir_var_uniform) &&
- var->data.explicit_location) {
- if (!reserve_explicit_locations(prog, uniform_map, var)) {
- delete uniform_map;
- return;
- }
- }
- }
- }
-
- delete uniform_map;
-}
-
void
link_shaders(struct gl_context *ctx, struct gl_shader_program *prog)
{
@@ -2484,6 +2236,20 @@ link_shaders(struct gl_context *ctx, struct gl_shader_program *prog)
prog->Validated = false;
prog->_Used = false;
+ ralloc_free(prog->InfoLog);
+ prog->InfoLog = ralloc_strdup(NULL, "");
+
+ ralloc_free(prog->UniformBlocks);
+ prog->UniformBlocks = NULL;
+ prog->NumUniformBlocks = 0;
+ for (int i = 0; i < MESA_SHADER_STAGES; i++) {
+ ralloc_free(prog->UniformBlockStageIndex[i]);
+ prog->UniformBlockStageIndex[i] = NULL;
+ }
+
+ ralloc_free(prog->AtomicBuffers);
+ prog->AtomicBuffers = NULL;
+ prog->NumAtomicBuffers = 0;
prog->ARB_fragment_coord_conventions_enable = false;
/* Separate the shaders into groups based on their type.
@@ -2606,10 +2372,6 @@ link_shaders(struct gl_context *ctx, struct gl_shader_program *prog)
break;
}
- check_explicit_uniform_locations(ctx, prog);
- if (!prog->LinkStatus)
- goto done;
-
/* Validate the inputs of each stage with the output of the preceding
* stage.
*/
@@ -2670,21 +2432,16 @@ link_shaders(struct gl_context *ctx, struct gl_shader_program *prog)
if (!prog->LinkStatus)
goto done;
- if (ctx->Const.ShaderCompilerOptions[i].LowerClipDistance) {
+ if (ctx->ShaderCompilerOptions[i].LowerClipDistance) {
lower_clip_distance(prog->_LinkedShaders[i]);
}
while (do_common_optimization(prog->_LinkedShaders[i]->ir, true, false,
- &ctx->Const.ShaderCompilerOptions[i],
+ &ctx->ShaderCompilerOptions[i],
ctx->Const.NativeIntegers))
;
-
- lower_const_arrays_to_uniforms(prog->_LinkedShaders[i]->ir);
}
- /* Check and validate stream emissions in geometry shaders */
- validate_geometry_shader_emissions(ctx, prog);
-
/* Mark all generic shader inputs and outputs as unpaired. */
for (unsigned i = MESA_SHADER_VERTEX; i <= MESA_SHADER_FRAGMENT; i++) {
if (prog->_LinkedShaders[i] != NULL) {
@@ -2746,21 +2503,6 @@ link_shaders(struct gl_context *ctx, struct gl_shader_program *prog)
if (last >= 0 && last < MESA_SHADER_FRAGMENT) {
gl_shader *const sh = prog->_LinkedShaders[last];
- if (first == MESA_SHADER_GEOMETRY) {
- /* There was no vertex shader, but we still have to assign varying
- * locations for use by geometry shader inputs in SSO.
- *
- * If the shader is not separable (i.e., prog->SeparateShader is
- * false), linking will have already failed when first is
- * MESA_SHADER_GEOMETRY.
- */
- if (!assign_varying_locations(ctx, mem_ctx, prog,
- NULL, sh,
- num_tfeedback_decls, tfeedback_decls,
- prog->Geom.VerticesIn))
- goto done;
- }
-
if (num_tfeedback_decls != 0 || prog->SeparateShader) {
/* There was no fragment shader, but we still have to assign varying
* locations for use by transform feedback.
@@ -2848,7 +2590,7 @@ link_shaders(struct gl_context *ctx, struct gl_shader_program *prog)
goto done;
update_array_sizes(prog);
- link_assign_uniform_locations(prog, ctx->Const.UniformBooleanTrue);
+ link_assign_uniform_locations(prog);
link_assign_atomic_counter_resources(ctx, prog);
store_fragdepth_layout(prog);
diff --git a/dist/Mesa/src/glsl/linker.h b/dist/Mesa/src/glsl/linker.h
index 6ee585898..130915db4 100644
--- a/dist/Mesa/src/glsl/linker.h
+++ b/dist/Mesa/src/glsl/linker.h
@@ -26,9 +26,6 @@
#ifndef GLSL_LINKER_H
#define GLSL_LINKER_H
-ir_function_signature *
-link_get_main_function_signature(gl_shader *sh);
-
extern bool
link_function_calls(gl_shader_program *prog, gl_shader *main,
gl_shader **shader_list, unsigned num_shaders);
@@ -37,12 +34,10 @@ extern void
link_invalidate_variable_locations(exec_list *ir);
extern void
-link_assign_uniform_locations(struct gl_shader_program *prog,
- unsigned int boolean_true);
+link_assign_uniform_locations(struct gl_shader_program *prog);
extern void
-link_set_uniform_initializers(struct gl_shader_program *prog,
- unsigned int boolean_true);
+link_set_uniform_initializers(struct gl_shader_program *prog);
extern int
link_cross_validate_uniform_block(void *mem_ctx,
@@ -50,6 +45,9 @@ link_cross_validate_uniform_block(void *mem_ctx,
unsigned int *num_linked_blocks,
struct gl_uniform_block *new_block);
+void
+link_assign_uniform_block_offsets(struct gl_shader *shader);
+
extern bool
link_uniform_blocks_are_compatible(const gl_uniform_block *a,
const gl_uniform_block *b);
@@ -140,15 +138,11 @@ protected:
* \param name Fully qualified name of the field.
* \param row_major For a matrix type, is it stored row-major.
* \param record_type Type of the record containing the field.
- * \param last_field Set if \c name is the last field of the structure
- * containing it. This will always be false for items
- * not contained in a structure or interface block.
*
* The default implementation just calls the other \c visit_field method.
*/
virtual void visit_field(const glsl_type *type, const char *name,
- bool row_major, const glsl_type *record_type,
- bool last_field);
+ bool row_major, const glsl_type *record_type);
/**
* Method invoked for each leaf of the variable
@@ -174,13 +168,9 @@ private:
/**
* \param name_length Length of the current name \b not including the
* terminating \c NUL character.
- * \param last_field Set if \c name is the last field of the structure
- * containing it. This will always be false for items
- * not contained in a structure or interface block.
*/
void recursion(const glsl_type *t, char **name, size_t name_length,
- bool row_major, const glsl_type *record_type,
- bool last_field);
+ bool row_major, const glsl_type *record_type);
};
void
diff --git a/dist/Mesa/src/glsl/loop_analysis.cpp b/dist/Mesa/src/glsl/loop_analysis.cpp
index 21d46ebce..d6a9ac775 100644
--- a/dist/Mesa/src/glsl/loop_analysis.cpp
+++ b/dist/Mesa/src/glsl/loop_analysis.cpp
@@ -227,7 +227,8 @@ loop_analysis::visit_enter(ir_call *)
/* Mark every loop that we're currently analyzing as containing an ir_call
* (even those at outer nesting levels).
*/
- foreach_in_list(loop_variable_state, ls, &this->state) {
+ foreach_list(node, &this->state) {
+ loop_variable_state *const ls = (loop_variable_state *) node;
ls->contains_calls = true;
}
@@ -245,7 +246,9 @@ loop_analysis::visit(ir_dereference_variable *ir)
bool nested = false;
- foreach_in_list(loop_variable_state, ls, &this->state) {
+ foreach_list(node, &this->state) {
+ loop_variable_state *const ls = (loop_variable_state *) node;
+
ir_variable *var = ir->variable_referenced();
loop_variable *lv = ls->get_or_insert(var, this->in_assignee);
@@ -285,10 +288,10 @@ loop_analysis::visit_leave(ir_loop *ir)
if (ls->contains_calls)
return visit_continue;
- foreach_in_list(ir_instruction, node, &ir->body_instructions) {
+ foreach_list(node, &ir->body_instructions) {
/* Skip over declarations at the start of a loop.
*/
- if (node->as_variable())
+ if (((ir_instruction *) node)->as_variable())
continue;
ir_if *if_stmt = ((ir_instruction *) node)->as_if();
@@ -300,7 +303,9 @@ loop_analysis::visit_leave(ir_loop *ir)
}
- foreach_in_list_safe(loop_variable, lv, &ls->variables) {
+ foreach_list_safe(node, &ls->variables) {
+ loop_variable *lv = (loop_variable *) node;
+
/* Move variables that are already marked as being loop constant to
* a separate list. These trivially don't need to be tested.
*/
@@ -328,7 +333,9 @@ loop_analysis::visit_leave(ir_loop *ir)
do {
progress = false;
- foreach_in_list_safe(loop_variable, lv, &ls->variables) {
+ foreach_list_safe(node, &ls->variables) {
+ loop_variable *lv = (loop_variable *) node;
+
if (lv->conditional_or_nested_assignment || (lv->num_assignments > 1))
continue;
@@ -352,7 +359,9 @@ loop_analysis::visit_leave(ir_loop *ir)
/* The remaining variables that are not loop invariant might be loop
* induction variables.
*/
- foreach_in_list_safe(loop_variable, lv, &ls->variables) {
+ foreach_list_safe(node, &ls->variables) {
+ loop_variable *lv = (loop_variable *) node;
+
/* If there is more than one assignment to a variable, it cannot be a
* loop induction variable. This isn't strictly true, but this is a
* very simple induction variable detector, and it can't handle more
@@ -393,7 +402,8 @@ loop_analysis::visit_leave(ir_loop *ir)
* Also figure out which terminator (if any) produces the smallest
* iteration count--this is the limiting terminator.
*/
- foreach_in_list(loop_terminator, t, &ls->terminators) {
+ foreach_list(node, &ls->terminators) {
+ loop_terminator *t = (loop_terminator *) node;
ir_if *if_stmt = t->ir;
/* If-statements can be either 'if (expr)' or 'if (deref)'. We only care
@@ -579,10 +589,8 @@ get_basic_induction_increment(ir_assignment *ir, hash_table *var_hash)
loop_variable *lv =
(loop_variable *) hash_table_find(var_hash, inc_var);
- if (lv == NULL || !lv->is_loop_constant()) {
- assert(lv != NULL);
- inc = NULL;
- }
+ if (!lv->is_loop_constant())
+ inc = NULL;
} else
inc = NULL;
}
diff --git a/dist/Mesa/src/glsl/loop_analysis.h b/dist/Mesa/src/glsl/loop_analysis.h
index 3b1971d7e..295dc797c 100644
--- a/dist/Mesa/src/glsl/loop_analysis.h
+++ b/dist/Mesa/src/glsl/loop_analysis.h
@@ -140,7 +140,22 @@ public:
hash_table_dtor(this->var_hash);
}
- DECLARE_RALLOC_CXX_OPERATORS(loop_variable_state)
+ static void* operator new(size_t size, void *ctx)
+ {
+ void *lvs = ralloc_size(ctx, size);
+ assert(lvs != NULL);
+
+ ralloc_set_destructor(lvs, (void (*)(void*)) destructor);
+
+ return lvs;
+ }
+
+private:
+ static void
+ destructor(loop_variable_state *lvs)
+ {
+ lvs->~loop_variable_state();
+ }
};
@@ -190,10 +205,10 @@ public:
inline bool is_loop_constant() const
{
const bool is_const = (this->num_assignments == 0)
- || (((this->num_assignments == 1)
+ || ((this->num_assignments == 1)
&& !this->conditional_or_nested_assignment
&& !this->read_before_write
- && this->rhs_clean) || this->var->data.read_only);
+ && this->rhs_clean);
/* If the RHS of *the* assignment is clean, then there must be exactly
* one assignment of the variable.
@@ -201,6 +216,11 @@ public:
assert((this->rhs_clean && (this->num_assignments == 1))
|| !this->rhs_clean);
+ /* Variables that are marked read-only *MUST* be loop constant.
+ */
+ assert(!this->var->data.read_only
+ || (this->var->data.read_only && is_const));
+
return is_const;
}
diff --git a/dist/Mesa/src/glsl/lower_const_arrays_to_uniforms.cpp b/dist/Mesa/src/glsl/lower_const_arrays_to_uniforms.cpp
deleted file mode 100644
index 2243f479a..000000000
--- a/dist/Mesa/src/glsl/lower_const_arrays_to_uniforms.cpp
+++ /dev/null
@@ -1,111 +0,0 @@
-/*
- * Copyright © 2014 Intel Corporation
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice (including the next
- * paragraph) shall be included in all copies or substantial portions of the
- * Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- * DEALINGS IN THE SOFTWARE.
- */
-
-/**
- * \file lower_const_arrays_to_uniforms.cpp
- *
- * Lower constant arrays to uniform arrays.
- *
- * Some driver backends (such as i965 and nouveau) don't handle constant arrays
- * gracefully, instead treating them as ordinary writable temporary arrays.
- * Since arrays can be large, this often means spilling them to scratch memory,
- * which usually involves a large number of instructions.
- *
- * This must be called prior to link_set_uniform_initializers(); we need the
- * linker to process our new uniform's constant initializer.
- *
- * This should be called after optimizations, since those can result in
- * splitting and removing arrays that are indexed by constant expressions.
- */
-#include "ir.h"
-#include "ir_visitor.h"
-#include "ir_rvalue_visitor.h"
-#include "glsl_types.h"
-
-namespace {
-class lower_const_array_visitor : public ir_rvalue_visitor {
-public:
- lower_const_array_visitor(exec_list *insts)
- {
- instructions = insts;
- progress = false;
- index = 0;
- }
-
- bool run()
- {
- visit_list_elements(this, instructions);
- return progress;
- }
-
- void handle_rvalue(ir_rvalue **rvalue);
-
-private:
- exec_list *instructions;
- bool progress;
- unsigned index;
-};
-
-void
-lower_const_array_visitor::handle_rvalue(ir_rvalue **rvalue)
-{
- if (!*rvalue)
- return;
-
- ir_dereference_array *dra = (*rvalue)->as_dereference_array();
- if (!dra)
- return;
-
- ir_constant *con = dra->array->as_constant();
- if (!con || !con->type->is_array())
- return;
-
- void *mem_ctx = ralloc_parent(con);
-
- char *uniform_name = ralloc_asprintf(mem_ctx, "constarray__%d", index++);
-
- ir_variable *uni =
- new(mem_ctx) ir_variable(con->type, uniform_name, ir_var_uniform);
- uni->constant_initializer = con;
- uni->constant_value = con;
- uni->data.has_initializer = true;
- uni->data.how_declared = ir_var_hidden;
- uni->data.read_only = true;
- /* Assume the whole thing is accessed. */
- uni->data.max_array_access = uni->type->length - 1;
- instructions->push_head(uni);
-
- ir_dereference_variable *varref = new(mem_ctx) ir_dereference_variable(uni);
- *rvalue = new(mem_ctx) ir_dereference_array(varref, dra->array_index);
-
- progress = true;
-}
-
-} /* anonymous namespace */
-
-bool
-lower_const_arrays_to_uniforms(exec_list *instructions)
-{
- lower_const_array_visitor v(instructions);
- return v.run();
-}
diff --git a/dist/Mesa/src/glsl/lower_if_to_cond_assign.cpp b/dist/Mesa/src/glsl/lower_if_to_cond_assign.cpp
index 3232ce92a..f15b217e0 100644
--- a/dist/Mesa/src/glsl/lower_if_to_cond_assign.cpp
+++ b/dist/Mesa/src/glsl/lower_if_to_cond_assign.cpp
@@ -116,7 +116,9 @@ move_block_to_cond_assign(void *mem_ctx,
exec_list *instructions,
struct hash_table *ht)
{
- foreach_in_list_safe(ir_instruction, ir, instructions) {
+ foreach_list_safe(node, instructions) {
+ ir_instruction *ir = (ir_instruction *) node;
+
if (ir->ir_type == ir_type_assignment) {
ir_assignment *assign = (ir_assignment *)ir;
@@ -176,10 +178,12 @@ ir_if_to_cond_assign_visitor::visit_leave(ir_if *ir)
ir_assignment *assign;
/* Check that both blocks don't contain anything we can't support. */
- foreach_in_list(ir_instruction, then_ir, &ir->then_instructions) {
+ foreach_list(n, &ir->then_instructions) {
+ ir_instruction *then_ir = (ir_instruction *) n;
visit_tree(then_ir, check_control_flow, &found_control_flow);
}
- foreach_in_list(ir_instruction, else_ir, &ir->else_instructions) {
+ foreach_list(n, &ir->else_instructions) {
+ ir_instruction *else_ir = (ir_instruction *) n;
visit_tree(else_ir, check_control_flow, &found_control_flow);
}
if (found_control_flow)
diff --git a/dist/Mesa/src/glsl/lower_instructions.cpp b/dist/Mesa/src/glsl/lower_instructions.cpp
index 684285350..176070c87 100644
--- a/dist/Mesa/src/glsl/lower_instructions.cpp
+++ b/dist/Mesa/src/glsl/lower_instructions.cpp
@@ -41,7 +41,6 @@
* - BITFIELD_INSERT_TO_BFM_BFI
* - CARRY_TO_ARITH
* - BORROW_TO_ARITH
- * - SAT_TO_CLAMP
*
* SUB_TO_ADD_NEG:
* ---------------
@@ -105,10 +104,6 @@
* ----------------
* Converts ir_borrow into (x < y).
*
- * SAT_TO_CLAMP:
- * -------------
- * Converts ir_unop_saturate into min(max(x, 0.0), 1.0)
- *
*/
#include "main/core.h" /* for M_LOG2E */
@@ -144,7 +139,6 @@ private:
void ldexp_to_arith(ir_expression *);
void carry_to_arith(ir_expression *);
void borrow_to_arith(ir_expression *);
- void sat_to_clamp(ir_expression *);
};
} /* anonymous namespace */
@@ -490,24 +484,6 @@ lower_instructions_visitor::borrow_to_arith(ir_expression *ir)
this->progress = true;
}
-void
-lower_instructions_visitor::sat_to_clamp(ir_expression *ir)
-{
- /* Translates
- * ir_unop_saturate x
- * into
- * ir_binop_min (ir_binop_max(x, 0.0), 1.0)
- */
-
- ir->operation = ir_binop_min;
- ir->operands[0] = new(ir) ir_expression(ir_binop_max, ir->operands[0]->type,
- ir->operands[0],
- new(ir) ir_constant(0.0f));
- ir->operands[1] = new(ir) ir_constant(1.0f);
-
- this->progress = true;
-}
-
ir_visitor_status
lower_instructions_visitor::visit_leave(ir_expression *ir)
{
@@ -564,11 +540,6 @@ lower_instructions_visitor::visit_leave(ir_expression *ir)
borrow_to_arith(ir);
break;
- case ir_unop_saturate:
- if (lowering(SAT_TO_CLAMP))
- sat_to_clamp(ir);
- break;
-
default:
return visit_continue;
}
diff --git a/dist/Mesa/src/glsl/lower_jumps.cpp b/dist/Mesa/src/glsl/lower_jumps.cpp
index ec7a0c537..02f65f097 100644
--- a/dist/Mesa/src/glsl/lower_jumps.cpp
+++ b/dist/Mesa/src/glsl/lower_jumps.cpp
@@ -500,16 +500,16 @@ struct ir_lower_jumps_visitor : public ir_control_flow_visitor {
/* Note: since visiting a node may change that node's next
* pointer, we can't use visit_exec_list(), because
* visit_exec_list() caches the node's next pointer before
- * visiting it. So we use foreach_in_list() instead.
+ * visiting it. So we use foreach_list() instead.
*
- * foreach_in_list() isn't safe if the node being visited gets
+ * foreach_list() isn't safe if the node being visited gets
* removed, but fortunately this visitor doesn't do that.
*/
block_record saved_block = this->block;
this->block = block_record();
- foreach_in_list(ir_instruction, node, list) {
- node->accept(this);
+ foreach_list(node, list) {
+ ((ir_instruction *) node)->accept(this);
}
block_record ret = this->block;
this->block = saved_block;
diff --git a/dist/Mesa/src/glsl/lower_variable_index_to_cond_assign.cpp b/dist/Mesa/src/glsl/lower_variable_index_to_cond_assign.cpp
index d878cb078..7c5d80f43 100644
--- a/dist/Mesa/src/glsl/lower_variable_index_to_cond_assign.cpp
+++ b/dist/Mesa/src/glsl/lower_variable_index_to_cond_assign.cpp
@@ -76,7 +76,7 @@ compare_index_block(exec_list *instructions, ir_variable *index,
ir_rvalue *broadcast_index = new(mem_ctx) ir_dereference_variable(index);
assert(index->type->is_scalar());
- assert(index->type->base_type == GLSL_TYPE_INT || index->type->base_type == GLSL_TYPE_UINT);
+ assert(index->type->base_type == GLSL_TYPE_INT);
assert(components >= 1 && components <= 4);
if (components > 1) {
diff --git a/dist/Mesa/src/glsl/lower_vec_index_to_cond_assign.cpp b/dist/Mesa/src/glsl/lower_vec_index_to_cond_assign.cpp
index 0c3394a50..fe6a3f208 100644
--- a/dist/Mesa/src/glsl/lower_vec_index_to_cond_assign.cpp
+++ b/dist/Mesa/src/glsl/lower_vec_index_to_cond_assign.cpp
@@ -197,7 +197,8 @@ ir_vec_index_to_cond_assign_visitor::visit_leave(ir_assignment *ir)
ir_visitor_status
ir_vec_index_to_cond_assign_visitor::visit_enter(ir_call *ir)
{
- foreach_in_list_safe(ir_rvalue, param, &ir->actual_parameters) {
+ foreach_list_safe(n, &ir->actual_parameters) {
+ ir_rvalue *param = (ir_rvalue *) n;
ir_rvalue *new_param = convert_vector_extract_to_cond_assign(param);
if (new_param != param) {
diff --git a/dist/Mesa/src/glsl/lower_vec_index_to_swizzle.cpp b/dist/Mesa/src/glsl/lower_vec_index_to_swizzle.cpp
index 4d4d2f17e..b5bb00c30 100644
--- a/dist/Mesa/src/glsl/lower_vec_index_to_swizzle.cpp
+++ b/dist/Mesa/src/glsl/lower_vec_index_to_swizzle.cpp
@@ -131,7 +131,8 @@ ir_vec_index_to_swizzle_visitor::visit_enter(ir_assignment *ir)
ir_visitor_status
ir_vec_index_to_swizzle_visitor::visit_enter(ir_call *ir)
{
- foreach_in_list_safe(ir_rvalue, param, &ir->actual_parameters) {
+ foreach_list_safe(n, &ir->actual_parameters) {
+ ir_rvalue *param = (ir_rvalue *) n;
ir_rvalue *new_param = convert_vector_extract_to_swizzle(param);
if (new_param != param) {
diff --git a/dist/Mesa/src/glsl/lower_vertex_id.cpp b/dist/Mesa/src/glsl/lower_vertex_id.cpp
deleted file mode 100644
index fc90bc8e6..000000000
--- a/dist/Mesa/src/glsl/lower_vertex_id.cpp
+++ /dev/null
@@ -1,144 +0,0 @@
-/*
- * Copyright © 2014 Intel Corporation
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice (including the next
- * paragraph) shall be included in all copies or substantial portions of the
- * Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- * DEALINGS IN THE SOFTWARE.
- */
-
-/**
- * \file lower_vertex_id.cpp
- *
- * There exists hardware, such as i965, that does not implement the OpenGL
- * semantic for gl_VertexID. Instead, that hardware does not include the
- * value of basevertex in the gl_VertexID value. To implement the OpenGL
- * semantic, we'll have to convert gl_Vertex_ID to
- * gl_VertexIDMESA+gl_BaseVertexMESA.
- */
-
-#include "glsl_symbol_table.h"
-#include "ir_hierarchical_visitor.h"
-#include "ir.h"
-#include "ir_builder.h"
-#include "linker.h"
-#include "program/prog_statevars.h"
-
-namespace {
-
-class lower_vertex_id_visitor : public ir_hierarchical_visitor {
-public:
- explicit lower_vertex_id_visitor(ir_function_signature *main_sig,
- exec_list *ir_list)
- : progress(false), VertexID(NULL), gl_VertexID(NULL),
- gl_BaseVertex(NULL), main_sig(main_sig), ir_list(ir_list)
- {
- foreach_in_list(ir_instruction, ir, ir_list) {
- ir_variable *const var = ir->as_variable();
-
- if (var != NULL && var->data.mode == ir_var_system_value &&
- var->data.location == SYSTEM_VALUE_BASE_VERTEX) {
- gl_BaseVertex = var;
- break;
- }
- }
- }
-
- virtual ir_visitor_status visit(ir_dereference_variable *);
-
- bool progress;
-
-private:
- ir_variable *VertexID;
- ir_variable *gl_VertexID;
- ir_variable *gl_BaseVertex;
-
- ir_function_signature *main_sig;
- exec_list *ir_list;
-};
-
-} /* anonymous namespace */
-
-ir_visitor_status
-lower_vertex_id_visitor::visit(ir_dereference_variable *ir)
-{
- if (ir->var->data.mode != ir_var_system_value ||
- ir->var->data.location != SYSTEM_VALUE_VERTEX_ID)
- return visit_continue;
-
- if (VertexID == NULL) {
- const glsl_type *const int_t = glsl_type::int_type;
- void *const mem_ctx = ralloc_parent(ir);
-
- VertexID = new(mem_ctx) ir_variable(int_t, "__VertexID",
- ir_var_temporary);
- ir_list->push_head(VertexID);
-
- gl_VertexID = new(mem_ctx) ir_variable(int_t, "gl_VertexIDMESA",
- ir_var_system_value);
- gl_VertexID->data.how_declared = ir_var_declared_implicitly;
- gl_VertexID->data.read_only = true;
- gl_VertexID->data.location = SYSTEM_VALUE_VERTEX_ID_ZERO_BASE;
- gl_VertexID->data.explicit_location = true;
- gl_VertexID->data.explicit_index = 0;
- ir_list->push_head(gl_VertexID);
-
- if (gl_BaseVertex == NULL) {
- gl_BaseVertex = new(mem_ctx) ir_variable(int_t, "gl_BaseVertex",
- ir_var_system_value);
- gl_BaseVertex->data.how_declared = ir_var_declared_implicitly;
- gl_BaseVertex->data.read_only = true;
- gl_BaseVertex->data.location = SYSTEM_VALUE_BASE_VERTEX;
- gl_BaseVertex->data.explicit_location = true;
- gl_BaseVertex->data.explicit_index = 0;
- ir_list->push_head(gl_BaseVertex);
- }
-
- ir_instruction *const inst =
- ir_builder::assign(VertexID,
- ir_builder::add(gl_VertexID, gl_BaseVertex));
-
- main_sig->body.push_head(inst);
- }
-
- ir->var = VertexID;
- progress = true;
-
- return visit_continue;
-}
-
-bool
-lower_vertex_id(gl_shader *shader)
-{
- /* gl_VertexID only exists in the vertex shader.
- */
- if (shader->Stage != MESA_SHADER_VERTEX)
- return false;
-
- ir_function_signature *const main_sig =
- link_get_main_function_signature(shader);
- if (main_sig == NULL) {
- assert(main_sig != NULL);
- return false;
- }
-
- lower_vertex_id_visitor v(main_sig, shader->ir);
-
- v.run(shader->ir);
-
- return v.progress;
-}
diff --git a/dist/Mesa/src/glsl/main.cpp b/dist/Mesa/src/glsl/main.cpp
index 9b36a1fed..a4452e023 100644
--- a/dist/Mesa/src/glsl/main.cpp
+++ b/dist/Mesa/src/glsl/main.cpp
@@ -210,7 +210,6 @@ initialize_context(struct gl_context *ctx, gl_api api)
break;
}
- ctx->Const.GenerateTemporaryNames = true;
ctx->Driver.NewShader = _mesa_new_shader;
}
@@ -403,8 +402,6 @@ main(int argc, char **argv)
}
if ((status == EXIT_SUCCESS) && do_link) {
- _mesa_clear_shader_program_data(whole_program);
-
link_shaders(ctx, whole_program);
status = (whole_program->LinkStatus) ? EXIT_SUCCESS : EXIT_FAILURE;
diff --git a/dist/Mesa/src/glsl/opt_constant_folding.cpp b/dist/Mesa/src/glsl/opt_constant_folding.cpp
index 74b855e5e..d0e575460 100644
--- a/dist/Mesa/src/glsl/opt_constant_folding.cpp
+++ b/dist/Mesa/src/glsl/opt_constant_folding.cpp
@@ -79,11 +79,6 @@ ir_constant_folding_visitor::handle_rvalue(ir_rvalue **rvalue)
}
}
- /* Ditto for swizzles. */
- ir_swizzle *swiz = (*rvalue)->as_swizzle();
- if (swiz && !swiz->val->as_constant())
- return;
-
ir_constant *constant = (*rvalue)->constant_expression_value();
if (constant) {
*rvalue = constant;
diff --git a/dist/Mesa/src/glsl/opt_constant_propagation.cpp b/dist/Mesa/src/glsl/opt_constant_propagation.cpp
index c334e1276..18f5da689 100644
--- a/dist/Mesa/src/glsl/opt_constant_propagation.cpp
+++ b/dist/Mesa/src/glsl/opt_constant_propagation.cpp
@@ -172,7 +172,8 @@ ir_constant_propagation_visitor::handle_rvalue(ir_rvalue **rvalue)
channel = i;
}
- foreach_in_list(acp_entry, entry, this->acp) {
+ foreach_list(n, this->acp) {
+ acp_entry *entry = (acp_entry *) n;
if (entry->var == deref->var && entry->write_mask & (1 << channel)) {
found = entry;
break;
@@ -316,7 +317,8 @@ ir_constant_propagation_visitor::handle_if_block(exec_list *instructions)
this->killed_all = false;
/* Populate the initial acp with a constant of the original */
- foreach_in_list(acp_entry, a, orig_acp) {
+ foreach_list(n, orig_acp) {
+ acp_entry *a = (acp_entry *) n;
this->acp->push_tail(new(this->mem_ctx) acp_entry(a));
}
@@ -331,7 +333,8 @@ ir_constant_propagation_visitor::handle_if_block(exec_list *instructions)
this->acp = orig_acp;
this->killed_all = this->killed_all || orig_killed_all;
- foreach_in_list(kill_entry, k, new_kills) {
+ foreach_list(n, new_kills) {
+ kill_entry *k = (kill_entry *) n;
kill(k->var, k->write_mask);
}
}
@@ -375,7 +378,8 @@ ir_constant_propagation_visitor::visit_enter(ir_loop *ir)
this->acp = orig_acp;
this->killed_all = this->killed_all || orig_killed_all;
- foreach_in_list(kill_entry, k, new_kills) {
+ foreach_list(n, new_kills) {
+ kill_entry *k = (kill_entry *) n;
kill(k->var, k->write_mask);
}
@@ -393,7 +397,9 @@ ir_constant_propagation_visitor::kill(ir_variable *var, unsigned write_mask)
return;
/* Remove any entries currently in the ACP for this kill. */
- foreach_in_list_safe(acp_entry, entry, this->acp) {
+ foreach_list_safe(n, this->acp) {
+ acp_entry *entry = (acp_entry *) n;
+
if (entry->var == var) {
entry->write_mask &= ~write_mask;
if (entry->write_mask == 0)
@@ -404,7 +410,9 @@ ir_constant_propagation_visitor::kill(ir_variable *var, unsigned write_mask)
/* Add this writemask of the variable to the list of killed
* variables in this block.
*/
- foreach_in_list(kill_entry, entry, this->kills) {
+ foreach_list(n, this->kills) {
+ kill_entry *entry = (kill_entry *) n;
+
if (entry->var == var) {
entry->write_mask |= write_mask;
return;
diff --git a/dist/Mesa/src/glsl/opt_constant_variable.cpp b/dist/Mesa/src/glsl/opt_constant_variable.cpp
index 7222eb92a..961b8aa06 100644
--- a/dist/Mesa/src/glsl/opt_constant_variable.cpp
+++ b/dist/Mesa/src/glsl/opt_constant_variable.cpp
@@ -193,10 +193,12 @@ do_constant_variable_unlinked(exec_list *instructions)
{
bool progress = false;
- foreach_in_list(ir_instruction, ir, instructions) {
+ foreach_list(n, instructions) {
+ ir_instruction *ir = (ir_instruction *) n;
ir_function *f = ir->as_function();
if (f) {
- foreach_in_list(ir_function_signature, sig, &f->signatures) {
+ foreach_list(signode, &f->signatures) {
+ ir_function_signature *sig = (ir_function_signature *) signode;
if (do_constant_variable(&sig->body))
progress = true;
}
diff --git a/dist/Mesa/src/glsl/opt_copy_propagation.cpp b/dist/Mesa/src/glsl/opt_copy_propagation.cpp
index 5c65af66b..195cc8baa 100644
--- a/dist/Mesa/src/glsl/opt_copy_propagation.cpp
+++ b/dist/Mesa/src/glsl/opt_copy_propagation.cpp
@@ -167,7 +167,9 @@ ir_copy_propagation_visitor::visit(ir_dereference_variable *ir)
ir_variable *var = ir->var;
- foreach_in_list(acp_entry, entry, this->acp) {
+ foreach_list(n, this->acp) {
+ acp_entry *entry = (acp_entry *) n;
+
if (var == entry->lhs) {
ir->var = entry->rhs;
this->progress = true;
@@ -214,7 +216,8 @@ ir_copy_propagation_visitor::handle_if_block(exec_list *instructions)
this->killed_all = false;
/* Populate the initial acp with a copy of the original */
- foreach_in_list(acp_entry, a, orig_acp) {
+ foreach_list(n, orig_acp) {
+ acp_entry *a = (acp_entry *) n;
this->acp->push_tail(new(this->mem_ctx) acp_entry(a->lhs, a->rhs));
}
@@ -229,7 +232,8 @@ ir_copy_propagation_visitor::handle_if_block(exec_list *instructions)
this->acp = orig_acp;
this->killed_all = this->killed_all || orig_killed_all;
- foreach_in_list(kill_entry, k, new_kills) {
+ foreach_list(n, new_kills) {
+ kill_entry *k = (kill_entry *) n;
kill(k->var);
}
}
@@ -272,7 +276,8 @@ ir_copy_propagation_visitor::visit_enter(ir_loop *ir)
this->acp = orig_acp;
this->killed_all = this->killed_all || orig_killed_all;
- foreach_in_list(kill_entry, k, new_kills) {
+ foreach_list(n, new_kills) {
+ kill_entry *k = (kill_entry *) n;
kill(k->var);
}
@@ -286,7 +291,9 @@ ir_copy_propagation_visitor::kill(ir_variable *var)
assert(var != NULL);
/* Remove any entries currently in the ACP for this kill. */
- foreach_in_list_safe(acp_entry, entry, acp) {
+ foreach_list_safe(n, acp) {
+ acp_entry *entry = (acp_entry *) n;
+
if (entry->lhs == var || entry->rhs == var) {
entry->remove();
}
diff --git a/dist/Mesa/src/glsl/opt_copy_propagation_elements.cpp b/dist/Mesa/src/glsl/opt_copy_propagation_elements.cpp
index c3e55bcd1..4d8f476a8 100644
--- a/dist/Mesa/src/glsl/opt_copy_propagation_elements.cpp
+++ b/dist/Mesa/src/glsl/opt_copy_propagation_elements.cpp
@@ -207,9 +207,8 @@ ir_copy_propagation_elements_visitor::handle_rvalue(ir_rvalue **ir)
int swizzle_chan[4];
ir_dereference_variable *deref_var;
ir_variable *source[4] = {NULL, NULL, NULL, NULL};
- int source_chan[4] = {0, 0, 0, 0};
+ int source_chan[4];
int chans;
- bool noop_swizzle = true;
if (!*ir)
return;
@@ -245,15 +244,14 @@ ir_copy_propagation_elements_visitor::handle_rvalue(ir_rvalue **ir)
/* Try to find ACP entries covering swizzle_chan[], hoping they're
* the same source variable.
*/
- foreach_in_list(acp_entry, entry, this->acp) {
+ foreach_list(n, this->acp) {
+ acp_entry *entry = (acp_entry *) n;
+
if (var == entry->lhs) {
for (int c = 0; c < chans; c++) {
if (entry->write_mask & (1 << swizzle_chan[c])) {
source[c] = entry->rhs;
source_chan[c] = entry->swizzle[swizzle_chan[c]];
-
- if (source_chan[c] != swizzle_chan[c])
- noop_swizzle = false;
}
}
}
@@ -270,12 +268,6 @@ ir_copy_propagation_elements_visitor::handle_rvalue(ir_rvalue **ir)
if (!shader_mem_ctx)
shader_mem_ctx = ralloc_parent(deref_var);
- /* Don't pointlessly replace the rvalue with itself (or a noop swizzle
- * of itself, which would just be deleted by opt_noop_swizzle).
- */
- if (source[0] == var && noop_swizzle)
- return;
-
if (debug) {
printf("Copy propagation from:\n");
(*ir)->print();
@@ -288,7 +280,6 @@ ir_copy_propagation_elements_visitor::handle_rvalue(ir_rvalue **ir)
source_chan[2],
source_chan[3],
chans);
- progress = true;
if (debug) {
printf("to:\n");
@@ -333,7 +324,8 @@ ir_copy_propagation_elements_visitor::handle_if_block(exec_list *instructions)
this->killed_all = false;
/* Populate the initial acp with a copy of the original */
- foreach_in_list(acp_entry, a, orig_acp) {
+ foreach_list(n, orig_acp) {
+ acp_entry *a = (acp_entry *) n;
this->acp->push_tail(new(this->mem_ctx) acp_entry(a));
}
@@ -351,7 +343,8 @@ ir_copy_propagation_elements_visitor::handle_if_block(exec_list *instructions)
/* Move the new kills into the parent block's list, removing them
* from the parent's ACP list in the process.
*/
- foreach_in_list_safe(kill_entry, k, new_kills) {
+ foreach_list_safe(node, new_kills) {
+ kill_entry *k = (kill_entry *)node;
kill(k);
}
}
@@ -394,7 +387,8 @@ ir_copy_propagation_elements_visitor::visit_enter(ir_loop *ir)
this->acp = orig_acp;
this->killed_all = this->killed_all || orig_killed_all;
- foreach_in_list_safe(kill_entry, k, new_kills) {
+ foreach_list_safe(node, new_kills) {
+ kill_entry *k = (kill_entry *)node;
kill(k);
}
@@ -406,7 +400,9 @@ ir_copy_propagation_elements_visitor::visit_enter(ir_loop *ir)
void
ir_copy_propagation_elements_visitor::kill(kill_entry *k)
{
- foreach_in_list_safe(acp_entry, entry, acp) {
+ foreach_list_safe(node, acp) {
+ acp_entry *entry = (acp_entry *)node;
+
if (entry->lhs == k->var) {
entry->write_mask = entry->write_mask & ~k->write_mask;
if (entry->write_mask == 0) {
diff --git a/dist/Mesa/src/glsl/opt_dead_builtin_variables.cpp b/dist/Mesa/src/glsl/opt_dead_builtin_variables.cpp
deleted file mode 100644
index 85c75d6f2..000000000
--- a/dist/Mesa/src/glsl/opt_dead_builtin_variables.cpp
+++ /dev/null
@@ -1,81 +0,0 @@
-/*
- * Copyright © 2014 Intel Corporation
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice (including the next
- * paragraph) shall be included in all copies or substantial portions of the
- * Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- * DEALINGS IN THE SOFTWARE.
- */
-
-#include "ir.h"
-#include "ir_visitor.h"
-#include "ir_optimization.h"
-
-/**
- * Pre-linking, optimize unused built-in variables
- *
- * Uniforms, constants, system values, inputs (vertex shader only), and
- * outputs (fragment shader only) that are not used can be removed.
- */
-void
-optimize_dead_builtin_variables(exec_list *instructions,
- enum ir_variable_mode other)
-{
- foreach_in_list_safe(ir_variable, var, instructions) {
- if (var->ir_type != ir_type_variable || var->data.used)
- continue;
-
- if (var->data.mode != ir_var_uniform
- && var->data.mode != ir_var_auto
- && var->data.mode != ir_var_system_value
- && var->data.mode != other)
- continue;
-
- /* So that linker rules can later be enforced, we cannot elimate
- * variables that were redeclared in the shader code.
- */
- if ((var->data.mode == other || var->data.mode == ir_var_system_value)
- && var->data.how_declared != ir_var_declared_implicitly)
- continue;
-
- if (strncmp(var->name, "gl_", 3) != 0)
- continue;
-
- /* gl_ModelViewProjectionMatrix and gl_Vertex are special because they
- * are used by ftransform. No other built-in variable is used by a
- * built-in function. The forward declarations of these variables in
- * the built-in function shader does not have the "state slot"
- * information, so removing these variables from the user shader will
- * cause problems later.
- *
- * Matrix uniforms with "Transpose" are not eliminated because there's
- * an optimization pass that can turn references to the regular matrix
- * into references to the transpose matrix. Eliminating the transpose
- * matrix would cause that pass to generate references to undeclareds
- * variables (thank you, ir_validate).
- *
- * It doesn't seem worth the effort to track when the transpose could be
- * eliminated (i.e., when the non-transpose was eliminated).
- */
- if (strcmp(var->name, "gl_ModelViewProjectionMatrix") == 0
- || strcmp(var->name, "gl_Vertex") == 0
- || strstr(var->name, "Transpose") != NULL)
- continue;
-
- var->remove();
- }
-}
diff --git a/dist/Mesa/src/glsl/opt_dead_code_local.cpp b/dist/Mesa/src/glsl/opt_dead_code_local.cpp
index 4770fcff2..c27c526f9 100644
--- a/dist/Mesa/src/glsl/opt_dead_code_local.cpp
+++ b/dist/Mesa/src/glsl/opt_dead_code_local.cpp
@@ -70,7 +70,9 @@ public:
void use_channels(ir_variable *const var, int used)
{
- foreach_in_list_safe(assignment_entry, entry, this->assignments) {
+ foreach_list_safe(n, this->assignments) {
+ assignment_entry *entry = (assignment_entry *) n;
+
if (entry->lhs == var) {
if (var->type->is_scalar() || var->type->is_vector()) {
if (debug)
@@ -112,12 +114,13 @@ public:
return visit_continue_with_parent;
}
- virtual ir_visitor_status visit_leave(ir_emit_vertex *)
+ virtual ir_visitor_status visit(ir_emit_vertex *)
{
/* For the purpose of dead code elimination, emitting a vertex counts as
* "reading" all of the currently assigned output variables.
*/
- foreach_in_list_safe(assignment_entry, entry, this->assignments) {
+ foreach_list_safe(n, this->assignments) {
+ assignment_entry *entry = (assignment_entry *) n;
if (entry->lhs->data.mode == ir_var_shader_out) {
if (debug)
printf("kill %s\n", entry->lhs->name);
@@ -193,7 +196,9 @@ process_assignment(void *ctx, ir_assignment *ir, exec_list *assignments)
printf("looking for %s.0x%01x to remove\n", var->name,
ir->write_mask);
- foreach_in_list_safe(assignment_entry, entry, assignments) {
+ foreach_list_safe(n, assignments) {
+ assignment_entry *entry = (assignment_entry *) n;
+
if (entry->lhs != var)
continue;
@@ -253,7 +258,9 @@ process_assignment(void *ctx, ir_assignment *ir, exec_list *assignments)
*/
if (debug)
printf("looking for %s to remove\n", var->name);
- foreach_in_list_safe(assignment_entry, entry, assignments) {
+ foreach_list_safe(n, assignments) {
+ assignment_entry *entry = (assignment_entry *) n;
+
if (entry->lhs == var) {
if (debug)
printf("removing %s\n", var->name);
@@ -273,7 +280,9 @@ process_assignment(void *ctx, ir_assignment *ir, exec_list *assignments)
printf("add %s\n", var->name);
printf("current entries\n");
- foreach_in_list(assignment_entry, entry, assignments) {
+ foreach_list(n, assignments) {
+ assignment_entry *entry = (assignment_entry *) n;
+
printf(" %s (0x%01x)\n", entry->lhs->name, entry->unused);
}
}
diff --git a/dist/Mesa/src/glsl/opt_dead_functions.cpp b/dist/Mesa/src/glsl/opt_dead_functions.cpp
index 5dff16521..8bb278e45 100644
--- a/dist/Mesa/src/glsl/opt_dead_functions.cpp
+++ b/dist/Mesa/src/glsl/opt_dead_functions.cpp
@@ -74,7 +74,8 @@ public:
signature_entry *
ir_dead_functions_visitor::get_signature_entry(ir_function_signature *sig)
{
- foreach_in_list(signature_entry, entry, &this->signature_list) {
+ foreach_list(n, &this->signature_list) {
+ signature_entry *entry = (signature_entry *) n;
if (entry->signature == sig)
return entry;
}
@@ -122,7 +123,9 @@ do_dead_functions(exec_list *instructions)
* the unused ones, and remove function definitions that have no more
* signatures.
*/
- foreach_in_list_safe(signature_entry, entry, &v.signature_list) {
+ foreach_list_safe(n, &v.signature_list) {
+ signature_entry *entry = (signature_entry *) n;
+
if (!entry->used) {
entry->signature->remove();
delete entry->signature;
@@ -134,7 +137,8 @@ do_dead_functions(exec_list *instructions)
/* We don't just do this above when we nuked a signature because of
* const pointers.
*/
- foreach_in_list_safe(ir_instruction, ir, instructions) {
+ foreach_list_safe(n, instructions) {
+ ir_instruction *ir = (ir_instruction *) n;
ir_function *func = ir->as_function();
if (func && func->signatures.is_empty()) {
diff --git a/dist/Mesa/src/glsl/opt_function_inlining.cpp b/dist/Mesa/src/glsl/opt_function_inlining.cpp
index 64b4907ba..9649598dd 100644
--- a/dist/Mesa/src/glsl/opt_function_inlining.cpp
+++ b/dist/Mesa/src/glsl/opt_function_inlining.cpp
@@ -100,13 +100,16 @@ ir_call::generate_inline(ir_instruction *next_ir)
{
void *ctx = ralloc_parent(this);
ir_variable **parameters;
- unsigned num_parameters;
+ int num_parameters;
int i;
struct hash_table *ht;
ht = hash_table_ctor(0, hash_table_pointer_hash, hash_table_pointer_compare);
- num_parameters = this->callee->parameters.length();
+ num_parameters = 0;
+ foreach_list(n, &this->callee->parameters)
+ num_parameters++;
+
parameters = new ir_variable *[num_parameters];
/* Generate the declarations for the parameters to our inlined code,
@@ -156,7 +159,8 @@ ir_call::generate_inline(ir_instruction *next_ir)
exec_list new_instructions;
/* Generate the inlined body of the function to a new list */
- foreach_in_list(ir_instruction, ir, &callee->body) {
+ foreach_list(n, &callee->body) {
+ ir_instruction *ir = (ir_instruction *) n;
ir_instruction *new_ir = ir->clone(ctx, ht);
new_instructions.push_tail(new_ir);
@@ -338,7 +342,8 @@ ir_variable_replacement_visitor::visit_leave(ir_dereference_record *ir)
ir_visitor_status
ir_variable_replacement_visitor::visit_leave(ir_call *ir)
{
- foreach_in_list_safe(ir_rvalue, param, &ir->actual_parameters) {
+ foreach_list_safe(n, &ir->actual_parameters) {
+ ir_rvalue *param = (ir_rvalue *) n;
ir_rvalue *new_param = param;
replace_rvalue(&new_param);
diff --git a/dist/Mesa/src/glsl/opt_minmax.cpp b/dist/Mesa/src/glsl/opt_minmax.cpp
deleted file mode 100644
index 32fb2d7ea..000000000
--- a/dist/Mesa/src/glsl/opt_minmax.cpp
+++ /dev/null
@@ -1,475 +0,0 @@
-/*
- * Copyright © 2014 Intel Corporation
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice (including the next
- * paragraph) shall be included in all copies or substantial portions of the
- * Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- * DEALINGS IN THE SOFTWARE.
- */
-
-/**
- * \file opt_minmax.cpp
- *
- * Drop operands from an expression tree of only min/max operations if they
- * can be proven to not contribute to the final result.
- *
- * The algorithm is similar to alpha-beta pruning on a minmax search.
- */
-
-#include "ir.h"
-#include "ir_visitor.h"
-#include "ir_rvalue_visitor.h"
-#include "ir_optimization.h"
-#include "ir_builder.h"
-#include "program/prog_instruction.h"
-#include "glsl_types.h"
-#include "main/macros.h"
-
-using namespace ir_builder;
-
-namespace {
-
-enum compare_components_result {
- LESS,
- LESS_OR_EQUAL,
- EQUAL,
- GREATER_OR_EQUAL,
- GREATER,
- MIXED
-};
-
-class minmax_range {
-public:
- minmax_range(ir_constant *low = NULL, ir_constant *high = NULL)
- {
- this->low = low;
- this->high = high;
- }
-
- /* low is the lower limit of the range, high is the higher limit. NULL on
- * low means negative infinity (unlimited) and on high positive infinity
- * (unlimited). Because of the two interpretations of the value NULL,
- * arbitrary comparison between ir_constants is impossible.
- */
- ir_constant *low;
- ir_constant *high;
-};
-
-class ir_minmax_visitor : public ir_rvalue_enter_visitor {
-public:
- ir_minmax_visitor()
- : progress(false)
- {
- }
-
- ir_rvalue *prune_expression(ir_expression *expr, minmax_range baserange);
-
- void handle_rvalue(ir_rvalue **rvalue);
-
- bool progress;
-};
-
-/*
- * Returns LESS if all vector components of `a' are strictly lower than of `b',
- * GREATER if all vector components of `a' are strictly greater than of `b',
- * MIXED if some vector components of `a' are strictly lower than of `b' while
- * others are strictly greater, or EQUAL otherwise.
- */
-static enum compare_components_result
-compare_components(ir_constant *a, ir_constant *b)
-{
- assert(a != NULL);
- assert(b != NULL);
-
- assert(a->type->base_type == b->type->base_type);
-
- unsigned a_inc = a->type->is_scalar() ? 0 : 1;
- unsigned b_inc = b->type->is_scalar() ? 0 : 1;
- unsigned components = MAX2(a->type->components(), b->type->components());
-
- bool foundless = false;
- bool foundgreater = false;
- bool foundequal = false;
-
- for (unsigned i = 0, c0 = 0, c1 = 0;
- i < components;
- c0 += a_inc, c1 += b_inc, ++i) {
- switch (a->type->base_type) {
- case GLSL_TYPE_UINT:
- if (a->value.u[c0] < b->value.u[c1])
- foundless = true;
- else if (a->value.u[c0] > b->value.u[c1])
- foundgreater = true;
- else
- foundequal = true;
- break;
- case GLSL_TYPE_INT:
- if (a->value.i[c0] < b->value.i[c1])
- foundless = true;
- else if (a->value.i[c0] > b->value.i[c1])
- foundgreater = true;
- else
- foundequal = true;
- break;
- case GLSL_TYPE_FLOAT:
- if (a->value.f[c0] < b->value.f[c1])
- foundless = true;
- else if (a->value.f[c0] > b->value.f[c1])
- foundgreater = true;
- else
- foundequal = true;
- break;
- default:
- unreachable("not reached");
- }
- }
-
- if (foundless && foundgreater) {
- /* Some components are strictly lower, others are strictly greater */
- return MIXED;
- }
-
- if (foundequal) {
- /* It is not mixed, but it is not strictly lower or greater */
- if (foundless)
- return LESS_OR_EQUAL;
- if (foundgreater)
- return GREATER_OR_EQUAL;
- return EQUAL;
- }
-
- /* All components are strictly lower or strictly greater */
- return foundless ? LESS : GREATER;
-}
-
-static ir_constant *
-combine_constant(bool ismin, ir_constant *a, ir_constant *b)
-{
- void *mem_ctx = ralloc_parent(a);
- ir_constant *c = a->clone(mem_ctx, NULL);
- for (unsigned i = 0; i < c->type->components(); i++) {
- switch (c->type->base_type) {
- case GLSL_TYPE_UINT:
- if ((ismin && b->value.u[i] < c->value.u[i]) ||
- (!ismin && b->value.u[i] > c->value.u[i]))
- c->value.u[i] = b->value.u[i];
- break;
- case GLSL_TYPE_INT:
- if ((ismin && b->value.i[i] < c->value.i[i]) ||
- (!ismin && b->value.i[i] > c->value.i[i]))
- c->value.i[i] = b->value.i[i];
- break;
- case GLSL_TYPE_FLOAT:
- if ((ismin && b->value.f[i] < c->value.f[i]) ||
- (!ismin && b->value.f[i] > c->value.f[i]))
- c->value.f[i] = b->value.f[i];
- break;
- default:
- assert(!"not reached");
- }
- }
- return c;
-}
-
-static ir_constant *
-smaller_constant(ir_constant *a, ir_constant *b)
-{
- assert(a != NULL);
- assert(b != NULL);
-
- enum compare_components_result ret = compare_components(a, b);
- if (ret == MIXED)
- return combine_constant(true, a, b);
- else if (ret < EQUAL)
- return a;
- else
- return b;
-}
-
-static ir_constant *
-larger_constant(ir_constant *a, ir_constant *b)
-{
- assert(a != NULL);
- assert(b != NULL);
-
- enum compare_components_result ret = compare_components(a, b);
- if (ret == MIXED)
- return combine_constant(false, a, b);
- else if (ret < EQUAL)
- return b;
- else
- return a;
-}
-
-/* Combines two ranges by doing an element-wise min() / max() depending on the
- * operation.
- */
-static minmax_range
-combine_range(minmax_range r0, minmax_range r1, bool ismin)
-{
- minmax_range ret;
-
- if (!r0.low) {
- ret.low = ismin ? r0.low : r1.low;
- } else if (!r1.low) {
- ret.low = ismin ? r1.low : r0.low;
- } else {
- ret.low = ismin ? smaller_constant(r0.low, r1.low) :
- larger_constant(r0.low, r1.low);
- }
-
- if (!r0.high) {
- ret.high = ismin ? r1.high : r0.high;
- } else if (!r1.high) {
- ret.high = ismin ? r0.high : r1.high;
- } else {
- ret.high = ismin ? smaller_constant(r0.high, r1.high) :
- larger_constant(r0.high, r1.high);
- }
-
- return ret;
-}
-
-/* Returns a range so that lower limit is the larger of the two lower limits,
- * and higher limit is the smaller of the two higher limits.
- */
-static minmax_range
-range_intersection(minmax_range r0, minmax_range r1)
-{
- minmax_range ret;
-
- if (!r0.low)
- ret.low = r1.low;
- else if (!r1.low)
- ret.low = r0.low;
- else
- ret.low = larger_constant(r0.low, r1.low);
-
- if (!r0.high)
- ret.high = r1.high;
- else if (!r1.high)
- ret.high = r0.high;
- else
- ret.high = smaller_constant(r0.high, r1.high);
-
- return ret;
-}
-
-static minmax_range
-get_range(ir_rvalue *rval)
-{
- ir_expression *expr = rval->as_expression();
- if (expr && (expr->operation == ir_binop_min ||
- expr->operation == ir_binop_max)) {
- minmax_range r0 = get_range(expr->operands[0]);
- minmax_range r1 = get_range(expr->operands[1]);
- return combine_range(r0, r1, expr->operation == ir_binop_min);
- }
-
- ir_constant *c = rval->as_constant();
- if (c) {
- return minmax_range(c, c);
- }
-
- return minmax_range();
-}
-
-/**
- * Prunes a min/max expression considering the base range of the parent
- * min/max expression.
- *
- * @param baserange the range that the parents of this min/max expression
- * in the min/max tree will clamp its value to.
- */
-ir_rvalue *
-ir_minmax_visitor::prune_expression(ir_expression *expr, minmax_range baserange)
-{
- assert(expr->operation == ir_binop_min ||
- expr->operation == ir_binop_max);
-
- bool ismin = expr->operation == ir_binop_min;
- minmax_range limits[2];
-
- /* Recurse to get the ranges for each of the subtrees of this
- * expression. We need to do this as a separate step because we need to
- * know the ranges of each of the subtrees before we prune either one.
- * Consider something like this:
- *
- * max
- * / \
- * max max
- * / \ / \
- * 3 a b 2
- *
- * We would like to prune away the max on the bottom-right, but to do so
- * we need to know the range of the expression on the left beforehand,
- * and there's no guarantee that we will visit either subtree in a
- * particular order.
- */
- for (unsigned i = 0; i < 2; ++i)
- limits[i] = get_range(expr->operands[i]);
-
- for (unsigned i = 0; i < 2; ++i) {
- bool is_redundant = false;
-
- enum compare_components_result cr = LESS;
- if (ismin) {
- /* If this operand will always be greater than the other one, it's
- * redundant.
- */
- if (limits[i].low && limits[1 - i].high) {
- cr = compare_components(limits[i].low, limits[1 - i].high);
- if (cr >= EQUAL && cr != MIXED)
- is_redundant = true;
- }
- /* If this operand is always greater than baserange, then even if
- * it's smaller than the other one it'll get clamped, so it's
- * redundant.
- */
- if (!is_redundant && limits[i].low && baserange.high) {
- cr = compare_components(limits[i].low, baserange.high);
- if (cr >= EQUAL && cr != MIXED)
- is_redundant = true;
- }
- } else {
- /* If this operand will always be lower than the other one, it's
- * redundant.
- */
- if (limits[i].high && limits[1 - i].low) {
- cr = compare_components(limits[i].high, limits[1 - i].low);
- if (cr <= EQUAL)
- is_redundant = true;
- }
- /* If this operand is always lower than baserange, then even if
- * it's greater than the other one it'll get clamped, so it's
- * redundant.
- */
- if (!is_redundant && limits[i].high && baserange.low) {
- cr = compare_components(limits[i].high, baserange.low);
- if (cr <= EQUAL)
- is_redundant = true;
- }
- }
-
- if (is_redundant) {
- progress = true;
-
- /* Recurse if necessary. */
- ir_expression *op_expr = expr->operands[1 - i]->as_expression();
- if (op_expr && (op_expr->operation == ir_binop_min ||
- op_expr->operation == ir_binop_max)) {
- return prune_expression(op_expr, baserange);
- }
-
- return expr->operands[1 - i];
- } else if (cr == MIXED) {
- /* If we have mixed vector operands, we can try to resolve the minmax
- * expression by doing a component-wise minmax:
- *
- * min min
- * / \ / \
- * min a ===> [1,1] a
- * / \
- * [1,3] [3,1]
- *
- */
- ir_constant *a = expr->operands[0]->as_constant();
- ir_constant *b = expr->operands[1]->as_constant();
- if (a && b)
- return combine_constant(ismin, a, b);
- }
- }
-
- /* Now recurse to operands giving them the proper baserange. The baserange
- * to pass is the intersection of our baserange and the other operand's
- * limit with one of the ranges unlimited. If we can't compute a valid
- * intersection, we use the current baserange.
- */
- for (unsigned i = 0; i < 2; ++i) {
- ir_expression *op_expr = expr->operands[i]->as_expression();
- if (op_expr && (op_expr->operation == ir_binop_min ||
- op_expr->operation == ir_binop_max)) {
- /* We can only compute a new baserange for this operand if we managed
- * to compute a valid range for the other operand.
- */
- if (ismin)
- limits[1 - i].low = NULL;
- else
- limits[1 - i].high = NULL;
- minmax_range base = range_intersection(limits[1 - i], baserange);
- expr->operands[i] = prune_expression(op_expr, base);
- }
- }
-
- /* If we got here we could not discard any of the operands of the minmax
- * expression, but we can still try to resolve the expression if both
- * operands are constant. We do this after the loop above, to make sure
- * that if our operands are minmax expressions we have tried to prune them
- * first (hopefully reducing them to constants).
- */
- ir_constant *a = expr->operands[0]->as_constant();
- ir_constant *b = expr->operands[1]->as_constant();
- if (a && b)
- return combine_constant(ismin, a, b);
-
- return expr;
-}
-
-static ir_rvalue *
-swizzle_if_required(ir_expression *expr, ir_rvalue *rval)
-{
- if (expr->type->is_vector() && rval->type->is_scalar()) {
- return swizzle(rval, SWIZZLE_XXXX, expr->type->vector_elements);
- } else {
- return rval;
- }
-}
-
-void
-ir_minmax_visitor::handle_rvalue(ir_rvalue **rvalue)
-{
- if (!*rvalue)
- return;
-
- ir_expression *expr = (*rvalue)->as_expression();
- if (!expr || (expr->operation != ir_binop_min &&
- expr->operation != ir_binop_max))
- return;
-
- ir_rvalue *new_rvalue = prune_expression(expr, minmax_range());
- if (new_rvalue == *rvalue)
- return;
-
- /* If the expression type is a vector and the optimization leaves a scalar
- * as the result, we need to turn it into a vector.
- */
- *rvalue = swizzle_if_required(expr, new_rvalue);
-
- progress = true;
-}
-
-}
-
-bool
-do_minmax_prune(exec_list *instructions)
-{
- ir_minmax_visitor v;
-
- visit_list_elements(&v, instructions);
-
- return v.progress;
-}
diff --git a/dist/Mesa/src/glsl/opt_rebalance_tree.cpp b/dist/Mesa/src/glsl/opt_rebalance_tree.cpp
deleted file mode 100644
index 095f2d7d2..000000000
--- a/dist/Mesa/src/glsl/opt_rebalance_tree.cpp
+++ /dev/null
@@ -1,321 +0,0 @@
-/*
- * Copyright © 2014 Intel Corporation
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice (including the next
- * paragraph) shall be included in all copies or substantial portions of the
- * Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- * DEALINGS IN THE SOFTWARE.
- */
-
-/**
- * \file opt_rebalance_tree.cpp
- *
- * Rebalances a reduction expression tree.
- *
- * For reduction operations (e.g., x + y + z + w) we generate an expression
- * tree like
- *
- * +
- * / \
- * + w
- * / \
- * + z
- * / \
- * x y
- *
- * which we can rebalance into
- *
- * +
- * / \
- * / \
- * + +
- * / \ / \
- * x y z w
- *
- * to get a better instruction scheduling.
- *
- * See "Tree Rebalancing in Optimal Editor Time and Space" by Quentin F. Stout
- * and Bette L. Warren.
- *
- * Also see http://penguin.ewu.edu/~trolfe/DSWpaper/ for a very readable
- * explanation of the of the tree_to_vine() (rightward rotation) and
- * vine_to_tree() (leftward rotation) algorithms.
- */
-
-#include "ir.h"
-#include "ir_visitor.h"
-#include "ir_rvalue_visitor.h"
-#include "ir_optimization.h"
-#include "main/macros.h" /* for MAX2 */
-
-/* The DSW algorithm generates a degenerate tree (really, a linked list) in
- * tree_to_vine(). We'd rather not leave a binary expression with only one
- * operand, so trivial modifications (the ternary operators below) are needed
- * to ensure that we only rotate around the ir_expression nodes of the tree.
- */
-static unsigned
-tree_to_vine(ir_expression *root)
-{
- unsigned size = 0;
- ir_rvalue *vine_tail = root;
- ir_rvalue *remainder = root->operands[1];
-
- while (remainder != NULL) {
- ir_expression *remainder_temp = remainder->as_expression();
- ir_expression *remainder_left = remainder_temp ?
- remainder_temp->operands[0]->as_expression() : NULL;
-
- if (remainder_left == NULL) {
- /* move vine_tail down one */
- vine_tail = remainder;
- remainder = remainder->as_expression() ?
- ((ir_expression *)remainder)->operands[1] : NULL;
- size++;
- } else {
- /* rotate */
- ir_expression *tempptr = remainder_left;
- ((ir_expression *)remainder)->operands[0] = tempptr->operands[1];
- tempptr->operands[1] = remainder;
- remainder = tempptr;
- ((ir_expression *)vine_tail)->operands[1] = tempptr;
- }
- }
-
- return size;
-}
-
-static void
-compression(ir_expression *root, unsigned count)
-{
- ir_expression *scanner = root;
-
- for (unsigned i = 0; i < count; i++) {
- ir_expression *child = (ir_expression *)scanner->operands[1];
- scanner->operands[1] = child->operands[1];
- scanner = (ir_expression *)scanner->operands[1];
- child->operands[1] = scanner->operands[0];
- scanner->operands[0] = child;
- }
-}
-
-static void
-vine_to_tree(ir_expression *root, unsigned size)
-{
- int n = size - 1;
- for (int m = n / 2; m > 0; m = n / 2) {
- compression(root, m);
- n -= m + 1;
- }
-}
-
-namespace {
-
-class ir_rebalance_visitor : public ir_rvalue_enter_visitor {
-public:
- ir_rebalance_visitor()
- {
- progress = false;
- }
-
- void handle_rvalue(ir_rvalue **rvalue);
-
- bool progress;
-};
-
-struct is_reduction_data {
- ir_expression_operation operation;
- const glsl_type *type;
- unsigned num_expr;
- bool is_reduction;
- bool contains_constant;
-};
-
-} /* anonymous namespace */
-
-static bool
-is_reduction_operation(ir_expression_operation operation)
-{
- switch (operation) {
- case ir_binop_add:
- case ir_binop_mul:
- case ir_binop_bit_and:
- case ir_binop_bit_xor:
- case ir_binop_bit_or:
- case ir_binop_logic_and:
- case ir_binop_logic_xor:
- case ir_binop_logic_or:
- case ir_binop_min:
- case ir_binop_max:
- return true;
- default:
- return false;
- }
-}
-
-/* Note that this function does not attempt to recognize that reduction trees
- * are already balanced.
- *
- * We return false from this function for a number of reasons other than an
- * expression tree not being a mathematical reduction. Namely,
- *
- * - if the tree contains multiple constants that we may be able to combine.
- * - if the tree contains matrices:
- * - they might contain vec4's with many constant components that we can
- * simplify after splitting.
- * - applying the matrix chain ordering optimization is more than just
- * balancing an expression tree.
- * - if the tree contains operations on multiple types.
- * - if the tree contains ir_dereference_{array,record}, since foo[a+b] + c
- * would trick the visiting pass.
- */
-static void
-is_reduction(ir_instruction *ir, void *data)
-{
- struct is_reduction_data *ird = (struct is_reduction_data *)data;
- if (!ird->is_reduction)
- return;
-
- /* We don't want to balance a tree that contains multiple constants, since
- * we'll be able to constant fold them if they're not in separate subtrees.
- */
- if (ir->as_constant()) {
- if (ird->contains_constant) {
- ird->is_reduction = false;
- }
- ird->contains_constant = true;
- return;
- }
-
- /* Array/record dereferences have subtrees that are not part of the expr
- * tree we're balancing. Skip trees containing them.
- */
- if (ir->ir_type == ir_type_dereference_array ||
- ir->ir_type == ir_type_dereference_record) {
- ird->is_reduction = false;
- return;
- }
-
- ir_expression *expr = ir->as_expression();
- if (!expr)
- return;
-
- /* Non-constant matrices might still contain constant vec4 that we can
- * constant fold once split up. Handling matrices will need some more
- * work.
- */
- if (expr->type->is_matrix() ||
- expr->operands[0]->type->is_matrix() ||
- (expr->operands[1] && expr->operands[1]->type->is_matrix())) {
- ird->is_reduction = false;
- return;
- }
-
- if (ird->type != NULL && ird->type != expr->type) {
- ird->is_reduction = false;
- return;
- }
- ird->type = expr->type;
-
- ird->num_expr++;
- if (is_reduction_operation(expr->operation)) {
- if (ird->operation != 0 && ird->operation != expr->operation)
- ird->is_reduction = false;
- ird->operation = expr->operation;
- } else {
- ird->is_reduction = false;
- }
-}
-
-static ir_rvalue *
-handle_expression(ir_expression *expr)
-{
- struct is_reduction_data ird;
- ird.operation = (ir_expression_operation)0;
- ird.type = NULL;
- ird.num_expr = 0;
- ird.is_reduction = true;
- ird.contains_constant = false;
-
- visit_tree(expr, is_reduction, (void *)&ird);
-
- if (ird.is_reduction && ird.num_expr > 2) {
- ir_constant z = ir_constant(0.0f);
- ir_expression pseudo_root = ir_expression(ir_binop_add, &z, expr);
-
- unsigned size = tree_to_vine(&pseudo_root);
- vine_to_tree(&pseudo_root, size);
-
- expr = (ir_expression *)pseudo_root.operands[1];
- }
- return expr;
-}
-
-static void
-update_types(ir_instruction *ir, void *)
-{
- ir_expression *expr = ir->as_expression();
- if (!expr)
- return;
-
- const glsl_type *const new_type =
- glsl_type::get_instance(expr->type->base_type,
- MAX2(expr->operands[0]->type->vector_elements,
- expr->operands[1]->type->vector_elements),
- 1);
- assert(new_type != glsl_type::error_type);
- expr->type = new_type;
-}
-
-void
-ir_rebalance_visitor::handle_rvalue(ir_rvalue **rvalue)
-{
- if (!*rvalue)
- return;
-
- ir_expression *expr = (*rvalue)->as_expression();
- if (!expr || !is_reduction_operation(expr->operation))
- return;
-
- ir_rvalue *new_rvalue = handle_expression(expr);
-
- /* If we failed to rebalance the tree (e.g., because it wasn't a reduction,
- * or some other set of cases) new_rvalue will point to the same root as
- * before.
- *
- * Similarly, if the tree rooted at *rvalue was a reduction and was already
- * balanced, the algorithm will rearrange the tree but will ultimately
- * return an identical tree, so this check will handle that as well and
- * will not set progress = true.
- */
- if (new_rvalue == *rvalue)
- return;
-
- visit_tree(new_rvalue, NULL, NULL, update_types);
-
- *rvalue = new_rvalue;
- this->progress = true;
-}
-
-bool
-do_rebalance_tree(exec_list *instructions)
-{
- ir_rebalance_visitor v;
-
- v.run(instructions);
-
- return v.progress;
-}
diff --git a/dist/Mesa/src/glsl/opt_structure_splitting.cpp b/dist/Mesa/src/glsl/opt_structure_splitting.cpp
index 5e82fe93a..1ec537b13 100644
--- a/dist/Mesa/src/glsl/opt_structure_splitting.cpp
+++ b/dist/Mesa/src/glsl/opt_structure_splitting.cpp
@@ -107,7 +107,8 @@ ir_structure_reference_visitor::get_variable_entry(ir_variable *var)
|| var->data.mode == ir_var_shader_in || var->data.mode == ir_var_shader_out)
return NULL;
- foreach_in_list(variable_entry, entry, &this->variable_list) {
+ foreach_list(n, &this->variable_list) {
+ variable_entry *entry = (variable_entry *) n;
if (entry->var == var)
return entry;
}
@@ -208,7 +209,8 @@ ir_structure_splitting_visitor::get_splitting_entry(ir_variable *var)
if (!var->type->is_record())
return NULL;
- foreach_in_list(variable_entry, entry, this->variable_list) {
+ foreach_list(n, this->variable_list) {
+ variable_entry *entry = (variable_entry *) n;
if (entry->var == var) {
return entry;
}
@@ -313,7 +315,9 @@ do_structure_splitting(exec_list *instructions)
visit_list_elements(&refs, instructions);
/* Trim out variables we can't split. */
- foreach_in_list_safe(variable_entry, entry, &refs.variable_list) {
+ foreach_list_safe(n, &refs.variable_list) {
+ variable_entry *entry = (variable_entry *) n;
+
if (debug) {
printf("structure %s@%p: decl %d, whole_access %d\n",
entry->var->name, (void *) entry->var, entry->declaration,
@@ -333,7 +337,8 @@ do_structure_splitting(exec_list *instructions)
/* Replace the decls of the structures to be split with their split
* components.
*/
- foreach_in_list_safe(variable_entry, entry, &refs.variable_list) {
+ foreach_list_safe(n, &refs.variable_list) {
+ variable_entry *entry = (variable_entry *) n;
const struct glsl_type *type = entry->var->type;
entry->mem_ctx = ralloc_parent(entry->var);
diff --git a/dist/Mesa/src/glsl/ralloc.c b/dist/Mesa/src/glsl/ralloc.c
new file mode 100644
index 000000000..36bc61fd0
--- /dev/null
+++ b/dist/Mesa/src/glsl/ralloc.c
@@ -0,0 +1,492 @@
+/*
+ * Copyright © 2010 Intel Corporation
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+
+#include <assert.h>
+#include <stdlib.h>
+#include <stdarg.h>
+#include <stdio.h>
+#include <string.h>
+#include <stdint.h>
+
+/* Android defines SIZE_MAX in limits.h, instead of the standard stdint.h */
+#ifdef ANDROID
+#include <limits.h>
+#endif
+
+/* Some versions of MinGW are missing _vscprintf's declaration, although they
+ * still provide the symbol in the import library. */
+#ifdef __MINGW32__
+_CRTIMP int _vscprintf(const char *format, va_list argptr);
+#endif
+
+#include "ralloc.h"
+
+#ifndef va_copy
+#ifdef __va_copy
+#define va_copy(dest, src) __va_copy((dest), (src))
+#else
+#define va_copy(dest, src) (dest) = (src)
+#endif
+#endif
+
+#define CANARY 0x5A1106
+
+struct ralloc_header
+{
+#ifdef DEBUG
+ /* A canary value used to determine whether a pointer is ralloc'd. */
+ unsigned canary;
+#endif
+
+ struct ralloc_header *parent;
+
+ /* The first child (head of a linked list) */
+ struct ralloc_header *child;
+
+ /* Linked list of siblings */
+ struct ralloc_header *prev;
+ struct ralloc_header *next;
+
+ void (*destructor)(void *);
+};
+
+typedef struct ralloc_header ralloc_header;
+
+static void unlink_block(ralloc_header *info);
+static void unsafe_free(ralloc_header *info);
+
+static ralloc_header *
+get_header(const void *ptr)
+{
+ ralloc_header *info = (ralloc_header *) (((char *) ptr) -
+ sizeof(ralloc_header));
+#ifdef DEBUG
+ assert(info->canary == CANARY);
+#endif
+ return info;
+}
+
+#define PTR_FROM_HEADER(info) (((char *) info) + sizeof(ralloc_header))
+
+static void
+add_child(ralloc_header *parent, ralloc_header *info)
+{
+ if (parent != NULL) {
+ info->parent = parent;
+ info->next = parent->child;
+ parent->child = info;
+
+ if (info->next != NULL)
+ info->next->prev = info;
+ }
+}
+
+void *
+ralloc_context(const void *ctx)
+{
+ return ralloc_size(ctx, 0);
+}
+
+void *
+ralloc_size(const void *ctx, size_t size)
+{
+ void *block = calloc(1, size + sizeof(ralloc_header));
+ ralloc_header *info;
+ ralloc_header *parent;
+
+ if (unlikely(block == NULL))
+ return NULL;
+ info = (ralloc_header *) block;
+ parent = ctx != NULL ? get_header(ctx) : NULL;
+
+ add_child(parent, info);
+
+#ifdef DEBUG
+ info->canary = CANARY;
+#endif
+
+ return PTR_FROM_HEADER(info);
+}
+
+void *
+rzalloc_size(const void *ctx, size_t size)
+{
+ void *ptr = ralloc_size(ctx, size);
+ if (likely(ptr != NULL))
+ memset(ptr, 0, size);
+ return ptr;
+}
+
+/* helper function - assumes ptr != NULL */
+static void *
+resize(void *ptr, size_t size)
+{
+ ralloc_header *child, *old, *info;
+
+ old = get_header(ptr);
+ info = realloc(old, size + sizeof(ralloc_header));
+
+ if (info == NULL)
+ return NULL;
+
+ /* Update parent and sibling's links to the reallocated node. */
+ if (info != old && info->parent != NULL) {
+ if (info->parent->child == old)
+ info->parent->child = info;
+
+ if (info->prev != NULL)
+ info->prev->next = info;
+
+ if (info->next != NULL)
+ info->next->prev = info;
+ }
+
+ /* Update child->parent links for all children */
+ for (child = info->child; child != NULL; child = child->next)
+ child->parent = info;
+
+ return PTR_FROM_HEADER(info);
+}
+
+void *
+reralloc_size(const void *ctx, void *ptr, size_t size)
+{
+ if (unlikely(ptr == NULL))
+ return ralloc_size(ctx, size);
+
+ assert(ralloc_parent(ptr) == ctx);
+ return resize(ptr, size);
+}
+
+void *
+ralloc_array_size(const void *ctx, size_t size, unsigned count)
+{
+ if (count > SIZE_MAX/size)
+ return NULL;
+
+ return ralloc_size(ctx, size * count);
+}
+
+void *
+rzalloc_array_size(const void *ctx, size_t size, unsigned count)
+{
+ if (count > SIZE_MAX/size)
+ return NULL;
+
+ return rzalloc_size(ctx, size * count);
+}
+
+void *
+reralloc_array_size(const void *ctx, void *ptr, size_t size, unsigned count)
+{
+ if (count > SIZE_MAX/size)
+ return NULL;
+
+ return reralloc_size(ctx, ptr, size * count);
+}
+
+void
+ralloc_free(void *ptr)
+{
+ ralloc_header *info;
+
+ if (ptr == NULL)
+ return;
+
+ info = get_header(ptr);
+ unlink_block(info);
+ unsafe_free(info);
+}
+
+static void
+unlink_block(ralloc_header *info)
+{
+ /* Unlink from parent & siblings */
+ if (info->parent != NULL) {
+ if (info->parent->child == info)
+ info->parent->child = info->next;
+
+ if (info->prev != NULL)
+ info->prev->next = info->next;
+
+ if (info->next != NULL)
+ info->next->prev = info->prev;
+ }
+ info->parent = NULL;
+ info->prev = NULL;
+ info->next = NULL;
+}
+
+static void
+unsafe_free(ralloc_header *info)
+{
+ /* Recursively free any children...don't waste time unlinking them. */
+ ralloc_header *temp;
+ while (info->child != NULL) {
+ temp = info->child;
+ info->child = temp->next;
+ unsafe_free(temp);
+ }
+
+ /* Free the block itself. Call the destructor first, if any. */
+ if (info->destructor != NULL)
+ info->destructor(PTR_FROM_HEADER(info));
+
+ free(info);
+}
+
+void
+ralloc_steal(const void *new_ctx, void *ptr)
+{
+ ralloc_header *info, *parent;
+
+ if (unlikely(ptr == NULL))
+ return;
+
+ info = get_header(ptr);
+ parent = get_header(new_ctx);
+
+ unlink_block(info);
+
+ add_child(parent, info);
+}
+
+void *
+ralloc_parent(const void *ptr)
+{
+ ralloc_header *info;
+
+ if (unlikely(ptr == NULL))
+ return NULL;
+
+ info = get_header(ptr);
+ return info->parent ? PTR_FROM_HEADER(info->parent) : NULL;
+}
+
+static void *autofree_context = NULL;
+
+static void
+autofree(void)
+{
+ ralloc_free(autofree_context);
+}
+
+void *
+ralloc_autofree_context(void)
+{
+ if (unlikely(autofree_context == NULL)) {
+ autofree_context = ralloc_context(NULL);
+ atexit(autofree);
+ }
+ return autofree_context;
+}
+
+void
+ralloc_set_destructor(const void *ptr, void(*destructor)(void *))
+{
+ ralloc_header *info = get_header(ptr);
+ info->destructor = destructor;
+}
+
+char *
+ralloc_strdup(const void *ctx, const char *str)
+{
+ size_t n;
+ char *ptr;
+
+ if (unlikely(str == NULL))
+ return NULL;
+
+ n = strlen(str);
+ ptr = ralloc_array(ctx, char, n + 1);
+ memcpy(ptr, str, n);
+ ptr[n] = '\0';
+ return ptr;
+}
+
+char *
+ralloc_strndup(const void *ctx, const char *str, size_t max)
+{
+ size_t n;
+ char *ptr;
+
+ if (unlikely(str == NULL))
+ return NULL;
+
+ n = strlen(str);
+ if (n > max)
+ n = max;
+
+ ptr = ralloc_array(ctx, char, n + 1);
+ memcpy(ptr, str, n);
+ ptr[n] = '\0';
+ return ptr;
+}
+
+/* helper routine for strcat/strncat - n is the exact amount to copy */
+static bool
+cat(char **dest, const char *str, size_t n)
+{
+ char *both;
+ size_t existing_length;
+ assert(dest != NULL && *dest != NULL);
+
+ existing_length = strlen(*dest);
+ both = resize(*dest, existing_length + n + 1);
+ if (unlikely(both == NULL))
+ return false;
+
+ memcpy(both + existing_length, str, n);
+ both[existing_length + n] = '\0';
+
+ *dest = both;
+ return true;
+}
+
+
+bool
+ralloc_strcat(char **dest, const char *str)
+{
+ return cat(dest, str, strlen(str));
+}
+
+bool
+ralloc_strncat(char **dest, const char *str, size_t n)
+{
+ /* Clamp n to the string length */
+ size_t str_length = strlen(str);
+ if (str_length < n)
+ n = str_length;
+
+ return cat(dest, str, n);
+}
+
+char *
+ralloc_asprintf(const void *ctx, const char *fmt, ...)
+{
+ char *ptr;
+ va_list args;
+ va_start(args, fmt);
+ ptr = ralloc_vasprintf(ctx, fmt, args);
+ va_end(args);
+ return ptr;
+}
+
+/* Return the length of the string that would be generated by a printf-style
+ * format and argument list, not including the \0 byte.
+ */
+static size_t
+printf_length(const char *fmt, va_list untouched_args)
+{
+ int size;
+ char junk;
+
+ /* Make a copy of the va_list so the original caller can still use it */
+ va_list args;
+ va_copy(args, untouched_args);
+
+#ifdef _WIN32
+ /* We need to use _vcsprintf to calculate the size as vsnprintf returns -1
+ * if the number of characters to write is greater than count.
+ */
+ size = _vscprintf(fmt, args);
+ (void)junk;
+#else
+ size = vsnprintf(&junk, 1, fmt, args);
+#endif
+ assert(size >= 0);
+
+ va_end(args);
+
+ return size;
+}
+
+char *
+ralloc_vasprintf(const void *ctx, const char *fmt, va_list args)
+{
+ size_t size = printf_length(fmt, args) + 1;
+
+ char *ptr = ralloc_size(ctx, size);
+ if (ptr != NULL)
+ vsnprintf(ptr, size, fmt, args);
+
+ return ptr;
+}
+
+bool
+ralloc_asprintf_append(char **str, const char *fmt, ...)
+{
+ bool success;
+ va_list args;
+ va_start(args, fmt);
+ success = ralloc_vasprintf_append(str, fmt, args);
+ va_end(args);
+ return success;
+}
+
+bool
+ralloc_vasprintf_append(char **str, const char *fmt, va_list args)
+{
+ size_t existing_length;
+ assert(str != NULL);
+ existing_length = *str ? strlen(*str) : 0;
+ return ralloc_vasprintf_rewrite_tail(str, &existing_length, fmt, args);
+}
+
+bool
+ralloc_asprintf_rewrite_tail(char **str, size_t *start, const char *fmt, ...)
+{
+ bool success;
+ va_list args;
+ va_start(args, fmt);
+ success = ralloc_vasprintf_rewrite_tail(str, start, fmt, args);
+ va_end(args);
+ return success;
+}
+
+bool
+ralloc_vasprintf_rewrite_tail(char **str, size_t *start, const char *fmt,
+ va_list args)
+{
+ size_t new_length;
+ char *ptr;
+
+ assert(str != NULL);
+
+ if (unlikely(*str == NULL)) {
+ // Assuming a NULL context is probably bad, but it's expected behavior.
+ *str = ralloc_vasprintf(NULL, fmt, args);
+ return true;
+ }
+
+ new_length = printf_length(fmt, args);
+
+ ptr = resize(*str, *start + new_length + 1);
+ if (unlikely(ptr == NULL))
+ return false;
+
+ vsnprintf(ptr + *start, new_length + 1, fmt, args);
+ *str = ptr;
+ *start += new_length;
+ return true;
+}
diff --git a/dist/Mesa/src/glsl/ralloc.h b/dist/Mesa/src/glsl/ralloc.h
new file mode 100644
index 000000000..4581a7a4e
--- /dev/null
+++ b/dist/Mesa/src/glsl/ralloc.h
@@ -0,0 +1,445 @@
+/*
+ * Copyright © 2010 Intel Corporation
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+
+/**
+ * \file ralloc.h
+ *
+ * ralloc: a recursive memory allocator
+ *
+ * The ralloc memory allocator creates a hierarchy of allocated
+ * objects. Every allocation is in reference to some parent, and
+ * every allocated object can in turn be used as the parent of a
+ * subsequent allocation. This allows for extremely convenient
+ * discarding of an entire tree/sub-tree of allocations by calling
+ * ralloc_free on any particular object to free it and all of its
+ * children.
+ *
+ * The conceptual working of ralloc was directly inspired by Andrew
+ * Tridgell's talloc, but ralloc is an independent implementation
+ * released under the MIT license and tuned for Mesa.
+ *
+ * The talloc implementation is available under the GNU Lesser
+ * General Public License (GNU LGPL), version 3 or later. It is
+ * more sophisticated than ralloc in that it includes reference
+ * counting and debugging features. See: http://talloc.samba.org/
+ */
+
+#ifndef RALLOC_H
+#define RALLOC_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include <stddef.h>
+#include <stdarg.h>
+#include <stdbool.h>
+#include "main/compiler.h"
+
+/**
+ * \def ralloc(ctx, type)
+ * Allocate a new object chained off of the given context.
+ *
+ * This is equivalent to:
+ * \code
+ * ((type *) ralloc_size(ctx, sizeof(type))
+ * \endcode
+ */
+#define ralloc(ctx, type) ((type *) ralloc_size(ctx, sizeof(type)))
+
+/**
+ * \def rzalloc(ctx, type)
+ * Allocate a new object out of the given context and initialize it to zero.
+ *
+ * This is equivalent to:
+ * \code
+ * ((type *) rzalloc_size(ctx, sizeof(type))
+ * \endcode
+ */
+#define rzalloc(ctx, type) ((type *) rzalloc_size(ctx, sizeof(type)))
+
+/**
+ * Allocate a new ralloc context.
+ *
+ * While any ralloc'd pointer can be used as a context, sometimes it is useful
+ * to simply allocate a context with no associated memory.
+ *
+ * It is equivalent to:
+ * \code
+ * ((type *) ralloc_size(ctx, 0)
+ * \endcode
+ */
+void *ralloc_context(const void *ctx);
+
+/**
+ * Allocate memory chained off of the given context.
+ *
+ * This is the core allocation routine which is used by all others. It
+ * simply allocates storage for \p size bytes and returns the pointer,
+ * similar to \c malloc.
+ */
+void *ralloc_size(const void *ctx, size_t size);
+
+/**
+ * Allocate zero-initialized memory chained off of the given context.
+ *
+ * This is similar to \c calloc with a size of 1.
+ */
+void *rzalloc_size(const void *ctx, size_t size);
+
+/**
+ * Resize a piece of ralloc-managed memory, preserving data.
+ *
+ * Similar to \c realloc. Unlike C89, passing 0 for \p size does not free the
+ * memory. Instead, it resizes it to a 0-byte ralloc context, just like
+ * calling ralloc_size(ctx, 0). This is different from talloc.
+ *
+ * \param ctx The context to use for new allocation. If \p ptr != NULL,
+ * it must be the same as ralloc_parent(\p ptr).
+ * \param ptr Pointer to the memory to be resized. May be NULL.
+ * \param size The amount of memory to allocate, in bytes.
+ */
+void *reralloc_size(const void *ctx, void *ptr, size_t size);
+
+/// \defgroup array Array Allocators @{
+
+/**
+ * \def ralloc_array(ctx, type, count)
+ * Allocate an array of objects chained off the given context.
+ *
+ * Similar to \c calloc, but does not initialize the memory to zero.
+ *
+ * More than a convenience function, this also checks for integer overflow when
+ * multiplying \c sizeof(type) and \p count. This is necessary for security.
+ *
+ * This is equivalent to:
+ * \code
+ * ((type *) ralloc_array_size(ctx, sizeof(type), count)
+ * \endcode
+ */
+#define ralloc_array(ctx, type, count) \
+ ((type *) ralloc_array_size(ctx, sizeof(type), count))
+
+/**
+ * \def rzalloc_array(ctx, type, count)
+ * Allocate a zero-initialized array chained off the given context.
+ *
+ * Similar to \c calloc.
+ *
+ * More than a convenience function, this also checks for integer overflow when
+ * multiplying \c sizeof(type) and \p count. This is necessary for security.
+ *
+ * This is equivalent to:
+ * \code
+ * ((type *) rzalloc_array_size(ctx, sizeof(type), count)
+ * \endcode
+ */
+#define rzalloc_array(ctx, type, count) \
+ ((type *) rzalloc_array_size(ctx, sizeof(type), count))
+
+/**
+ * \def reralloc(ctx, ptr, type, count)
+ * Resize a ralloc-managed array, preserving data.
+ *
+ * Similar to \c realloc. Unlike C89, passing 0 for \p size does not free the
+ * memory. Instead, it resizes it to a 0-byte ralloc context, just like
+ * calling ralloc_size(ctx, 0). This is different from talloc.
+ *
+ * More than a convenience function, this also checks for integer overflow when
+ * multiplying \c sizeof(type) and \p count. This is necessary for security.
+ *
+ * \param ctx The context to use for new allocation. If \p ptr != NULL,
+ * it must be the same as ralloc_parent(\p ptr).
+ * \param ptr Pointer to the array to be resized. May be NULL.
+ * \param type The element type.
+ * \param count The number of elements to allocate.
+ */
+#define reralloc(ctx, ptr, type, count) \
+ ((type *) reralloc_array_size(ctx, ptr, sizeof(type), count))
+
+/**
+ * Allocate memory for an array chained off the given context.
+ *
+ * Similar to \c calloc, but does not initialize the memory to zero.
+ *
+ * More than a convenience function, this also checks for integer overflow when
+ * multiplying \p size and \p count. This is necessary for security.
+ */
+void *ralloc_array_size(const void *ctx, size_t size, unsigned count);
+
+/**
+ * Allocate a zero-initialized array chained off the given context.
+ *
+ * Similar to \c calloc.
+ *
+ * More than a convenience function, this also checks for integer overflow when
+ * multiplying \p size and \p count. This is necessary for security.
+ */
+void *rzalloc_array_size(const void *ctx, size_t size, unsigned count);
+
+/**
+ * Resize a ralloc-managed array, preserving data.
+ *
+ * Similar to \c realloc. Unlike C89, passing 0 for \p size does not free the
+ * memory. Instead, it resizes it to a 0-byte ralloc context, just like
+ * calling ralloc_size(ctx, 0). This is different from talloc.
+ *
+ * More than a convenience function, this also checks for integer overflow when
+ * multiplying \c sizeof(type) and \p count. This is necessary for security.
+ *
+ * \param ctx The context to use for new allocation. If \p ptr != NULL,
+ * it must be the same as ralloc_parent(\p ptr).
+ * \param ptr Pointer to the array to be resized. May be NULL.
+ * \param size The size of an individual element.
+ * \param count The number of elements to allocate.
+ *
+ * \return True unless allocation failed.
+ */
+void *reralloc_array_size(const void *ctx, void *ptr, size_t size,
+ unsigned count);
+/// @}
+
+/**
+ * Free a piece of ralloc-managed memory.
+ *
+ * This will also free the memory of any children allocated this context.
+ */
+void ralloc_free(void *ptr);
+
+/**
+ * "Steal" memory from one context, changing it to another.
+ *
+ * This changes \p ptr's context to \p new_ctx. This is quite useful if
+ * memory is allocated out of a temporary context.
+ */
+void ralloc_steal(const void *new_ctx, void *ptr);
+
+/**
+ * Return the given pointer's ralloc context.
+ */
+void *ralloc_parent(const void *ptr);
+
+/**
+ * Return a context whose memory will be automatically freed at program exit.
+ *
+ * The first call to this function creates a context and registers a handler
+ * to free it using \c atexit. This may cause trouble if used in a library
+ * loaded with \c dlopen.
+ */
+void *ralloc_autofree_context(void);
+
+/**
+ * Set a callback to occur just before an object is freed.
+ */
+void ralloc_set_destructor(const void *ptr, void(*destructor)(void *));
+
+/// \defgroup array String Functions @{
+/**
+ * Duplicate a string, allocating the memory from the given context.
+ */
+char *ralloc_strdup(const void *ctx, const char *str);
+
+/**
+ * Duplicate a string, allocating the memory from the given context.
+ *
+ * Like \c strndup, at most \p n characters are copied. If \p str is longer
+ * than \p n characters, \p n are copied, and a termining \c '\0' byte is added.
+ */
+char *ralloc_strndup(const void *ctx, const char *str, size_t n);
+
+/**
+ * Concatenate two strings, allocating the necessary space.
+ *
+ * This appends \p str to \p *dest, similar to \c strcat, using ralloc_resize
+ * to expand \p *dest to the appropriate size. \p dest will be updated to the
+ * new pointer unless allocation fails.
+ *
+ * The result will always be null-terminated.
+ *
+ * \return True unless allocation failed.
+ */
+bool ralloc_strcat(char **dest, const char *str);
+
+/**
+ * Concatenate two strings, allocating the necessary space.
+ *
+ * This appends at most \p n bytes of \p str to \p *dest, using ralloc_resize
+ * to expand \p *dest to the appropriate size. \p dest will be updated to the
+ * new pointer unless allocation fails.
+ *
+ * The result will always be null-terminated; \p str does not need to be null
+ * terminated if it is longer than \p n.
+ *
+ * \return True unless allocation failed.
+ */
+bool ralloc_strncat(char **dest, const char *str, size_t n);
+
+/**
+ * Print to a string.
+ *
+ * This is analogous to \c sprintf, but allocates enough space (using \p ctx
+ * as the context) for the resulting string.
+ *
+ * \return The newly allocated string.
+ */
+char *ralloc_asprintf (const void *ctx, const char *fmt, ...) PRINTFLIKE(2, 3);
+
+/**
+ * Print to a string, given a va_list.
+ *
+ * This is analogous to \c vsprintf, but allocates enough space (using \p ctx
+ * as the context) for the resulting string.
+ *
+ * \return The newly allocated string.
+ */
+char *ralloc_vasprintf(const void *ctx, const char *fmt, va_list args);
+
+/**
+ * Rewrite the tail of an existing string, starting at a given index.
+ *
+ * Overwrites the contents of *str starting at \p start with newly formatted
+ * text, including a new null-terminator. Allocates more memory as necessary.
+ *
+ * This can be used to append formatted text when the length of the existing
+ * string is already known, saving a strlen() call.
+ *
+ * \sa ralloc_asprintf_append
+ *
+ * \param str The string to be updated.
+ * \param start The index to start appending new data at.
+ * \param fmt A printf-style formatting string
+ *
+ * \p str will be updated to the new pointer unless allocation fails.
+ * \p start will be increased by the length of the newly formatted text.
+ *
+ * \return True unless allocation failed.
+ */
+bool ralloc_asprintf_rewrite_tail(char **str, size_t *start,
+ const char *fmt, ...)
+ PRINTFLIKE(3, 4);
+
+/**
+ * Rewrite the tail of an existing string, starting at a given index.
+ *
+ * Overwrites the contents of *str starting at \p start with newly formatted
+ * text, including a new null-terminator. Allocates more memory as necessary.
+ *
+ * This can be used to append formatted text when the length of the existing
+ * string is already known, saving a strlen() call.
+ *
+ * \sa ralloc_vasprintf_append
+ *
+ * \param str The string to be updated.
+ * \param start The index to start appending new data at.
+ * \param fmt A printf-style formatting string
+ * \param args A va_list containing the data to be formatted
+ *
+ * \p str will be updated to the new pointer unless allocation fails.
+ * \p start will be increased by the length of the newly formatted text.
+ *
+ * \return True unless allocation failed.
+ */
+bool ralloc_vasprintf_rewrite_tail(char **str, size_t *start, const char *fmt,
+ va_list args);
+
+/**
+ * Append formatted text to the supplied string.
+ *
+ * This is equivalent to
+ * \code
+ * ralloc_asprintf_rewrite_tail(str, strlen(*str), fmt, ...)
+ * \endcode
+ *
+ * \sa ralloc_asprintf
+ * \sa ralloc_asprintf_rewrite_tail
+ * \sa ralloc_strcat
+ *
+ * \p str will be updated to the new pointer unless allocation fails.
+ *
+ * \return True unless allocation failed.
+ */
+bool ralloc_asprintf_append (char **str, const char *fmt, ...)
+ PRINTFLIKE(2, 3);
+
+/**
+ * Append formatted text to the supplied string, given a va_list.
+ *
+ * This is equivalent to
+ * \code
+ * ralloc_vasprintf_rewrite_tail(str, strlen(*str), fmt, args)
+ * \endcode
+ *
+ * \sa ralloc_vasprintf
+ * \sa ralloc_vasprintf_rewrite_tail
+ * \sa ralloc_strcat
+ *
+ * \p str will be updated to the new pointer unless allocation fails.
+ *
+ * \return True unless allocation failed.
+ */
+bool ralloc_vasprintf_append(char **str, const char *fmt, va_list args);
+/// @}
+
+#ifdef __cplusplus
+} /* end of extern "C" */
+#endif
+
+/**
+ * Declare C++ new and delete operators which use ralloc.
+ *
+ * Placing this macro in the body of a class makes it possible to do:
+ *
+ * TYPE *var = new(mem_ctx) TYPE(...);
+ * delete var;
+ *
+ * which is more idiomatic in C++ than calling ralloc.
+ */
+#define DECLARE_RALLOC_CXX_OPERATORS(TYPE) \
+private: \
+ static void _ralloc_destructor(void *p) \
+ { \
+ reinterpret_cast<TYPE *>(p)->~TYPE(); \
+ } \
+public: \
+ static void* operator new(size_t size, void *mem_ctx) \
+ { \
+ void *p = ralloc_size(mem_ctx, size); \
+ assert(p != NULL); \
+ if (!HAS_TRIVIAL_DESTRUCTOR(TYPE)) \
+ ralloc_set_destructor(p, _ralloc_destructor); \
+ return p; \
+ } \
+ \
+ static void operator delete(void *p) \
+ { \
+ /* The object's destructor is guaranteed to have already been \
+ * called by the delete operator at this point -- Make sure it's \
+ * not called again. \
+ */ \
+ if (!HAS_TRIVIAL_DESTRUCTOR(TYPE)) \
+ ralloc_set_destructor(p, NULL); \
+ ralloc_free(p); \
+ }
+
+
+#endif
diff --git a/dist/Mesa/src/glsl/s_expression.cpp b/dist/Mesa/src/glsl/s_expression.cpp
index 2928a4db8..6906ff0eb 100644
--- a/dist/Mesa/src/glsl/s_expression.cpp
+++ b/dist/Mesa/src/glsl/s_expression.cpp
@@ -73,7 +73,7 @@ read_atom(void *ctx, const char *&src, char *&symbol_buffer)
} else {
// Check if the atom is a number.
char *float_end = NULL;
- float f = _mesa_strtof(src, &float_end);
+ float f = glsl_strtof(src, &float_end);
if (float_end != src) {
char *int_end = NULL;
int i = strtol(src, &int_end, 10);
@@ -162,7 +162,8 @@ void s_symbol::print()
void s_list::print()
{
printf("(");
- foreach_in_list(s_expression, expr, &this->subexpressions) {
+ foreach_list(n, &this->subexpressions) {
+ s_expression *expr = (s_expression *) n;
expr->print();
if (!expr->next->is_tail_sentinel())
printf(" ");
@@ -200,10 +201,11 @@ s_match(s_expression *top, unsigned n, s_pattern *pattern, bool partial)
return false;
unsigned i = 0;
- foreach_in_list(s_expression, expr, &list->subexpressions) {
+ foreach_list(node, &list->subexpressions) {
if (i >= n)
return partial; /* More actual items than the pattern expected */
+ s_expression *expr = (s_expression *) node;
if (expr == NULL || !pattern[i].match(expr))
return false;
diff --git a/dist/Mesa/src/glsl/s_expression.h b/dist/Mesa/src/glsl/s_expression.h
index 1d4753530..642af19b4 100644
--- a/dist/Mesa/src/glsl/s_expression.h
+++ b/dist/Mesa/src/glsl/s_expression.h
@@ -27,7 +27,7 @@
#define S_EXPRESSION_H
#include "main/core.h" /* for Elements */
-#include "util/strtod.h"
+#include "strtod.h"
#include "list.h"
/* Type-safe downcasting macros (also safe to pass NULL) */
diff --git a/dist/Mesa/src/glsl/strtod.c b/dist/Mesa/src/glsl/strtod.c
new file mode 100644
index 000000000..5d4346b5a
--- /dev/null
+++ b/dist/Mesa/src/glsl/strtod.c
@@ -0,0 +1,79 @@
+/*
+ * Copyright 2010 VMware, Inc.
+ * All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sub license, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the
+ * next paragraph) shall be included in all copies or substantial portions
+ * of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
+ * IN NO EVENT SHALL VMWARE AND/OR ITS SUPPLIERS BE LIABLE FOR
+ * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+
+#include <stdlib.h>
+
+#ifdef _GNU_SOURCE
+#include <locale.h>
+#ifdef __APPLE__
+#include <xlocale.h>
+#endif
+#endif
+
+#include "strtod.h"
+
+
+
+/**
+ * Wrapper around strtod which uses the "C" locale so the decimal
+ * point is always '.'
+ */
+double
+glsl_strtod(const char *s, char **end)
+{
+#if defined(_GNU_SOURCE) && !defined(__CYGWIN__) && !defined(__FreeBSD__) && \
+ !defined(__HAIKU__) && !defined(__UCLIBC__)
+ static locale_t loc = NULL;
+ if (!loc) {
+ loc = newlocale(LC_CTYPE_MASK, "C", NULL);
+ }
+ return strtod_l(s, end, loc);
+#else
+ return strtod(s, end);
+#endif
+}
+
+
+/**
+ * Wrapper around strtof which uses the "C" locale so the decimal
+ * point is always '.'
+ */
+float
+glsl_strtof(const char *s, char **end)
+{
+#if defined(_GNU_SOURCE) && !defined(__CYGWIN__) && !defined(__FreeBSD__) && \
+ !defined(__HAIKU__) && !defined(__UCLIBC__)
+ static locale_t loc = NULL;
+ if (!loc) {
+ loc = newlocale(LC_CTYPE_MASK, "C", NULL);
+ }
+ return strtof_l(s, end, loc);
+#elif _XOPEN_SOURCE >= 600 || _ISOC99_SOURCE
+ return strtof(s, end);
+#else
+ return (float) strtod(s, end);
+#endif
+}
diff --git a/dist/Mesa/src/glsl/strtod.h b/dist/Mesa/src/glsl/strtod.h
new file mode 100644
index 000000000..ad847dbb0
--- /dev/null
+++ b/dist/Mesa/src/glsl/strtod.h
@@ -0,0 +1,46 @@
+/*
+ * Copyright 2010 VMware, Inc.
+ * All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sub license, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the
+ * next paragraph) shall be included in all copies or substantial portions
+ * of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
+ * IN NO EVENT SHALL VMWARE AND/OR ITS SUPPLIERS BE LIABLE FOR
+ * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+
+#ifndef STRTOD_H
+#define STRTOD_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+extern double
+glsl_strtod(const char *s, char **end);
+
+extern float
+glsl_strtof(const char *s, char **end);
+
+
+#ifdef __cplusplus
+}
+#endif
+
+
+#endif
diff --git a/dist/Mesa/src/glsl/tests/lower_jumps/lower_breaks_1.opt_test b/dist/Mesa/src/glsl/tests/lower_jumps/lower_breaks_1.opt_test
new file mode 100755
index 000000000..b412ba8f2
--- /dev/null
+++ b/dist/Mesa/src/glsl/tests/lower_jumps/lower_breaks_1.opt_test
@@ -0,0 +1,13 @@
+#!/usr/bin/env bash
+#
+# This file was generated by create_test_cases.py.
+#
+# If a loop contains an unconditional break at the bottom of
+# it, it should not be lowered.
+../../glsl_test optpass --quiet --input-ir 'do_lower_jumps(0, 0, 0, 0, 1)' <<EOF
+((declare (out) float a)
+ (function main
+ (signature void (parameters)
+ ((loop
+ ((assign (x) (var_ref a) (constant float (1.000000))) break))))))
+EOF
diff --git a/dist/Mesa/src/glsl/tests/lower_jumps/lower_breaks_1.opt_test.expected b/dist/Mesa/src/glsl/tests/lower_jumps/lower_breaks_1.opt_test.expected
new file mode 100644
index 000000000..56ef3e424
--- /dev/null
+++ b/dist/Mesa/src/glsl/tests/lower_jumps/lower_breaks_1.opt_test.expected
@@ -0,0 +1,5 @@
+((declare (out) float a)
+ (function main
+ (signature void (parameters)
+ ((loop
+ ((assign (x) (var_ref a) (constant float (1.000000))) break))))))
diff --git a/dist/Mesa/src/glsl/tests/lower_jumps/lower_breaks_2.opt_test b/dist/Mesa/src/glsl/tests/lower_jumps/lower_breaks_2.opt_test
new file mode 100755
index 000000000..f5de80339
--- /dev/null
+++ b/dist/Mesa/src/glsl/tests/lower_jumps/lower_breaks_2.opt_test
@@ -0,0 +1,15 @@
+#!/usr/bin/env bash
+#
+# This file was generated by create_test_cases.py.
+#
+# If a loop contains a conditional break at the bottom of it,
+# it should not be lowered if it is in the then-clause.
+../../glsl_test optpass --quiet --input-ir 'do_lower_jumps(0, 0, 0, 0, 1)' <<EOF
+((declare (in) float b) (declare (out) float a)
+ (function main
+ (signature void (parameters)
+ ((loop
+ ((assign (x) (var_ref a) (constant float (1.000000)))
+ (if (expression bool > (var_ref b) (constant float (0.000000))) (break)
+ ())))))))
+EOF
diff --git a/dist/Mesa/src/glsl/tests/lower_jumps/lower_breaks_2.opt_test.expected b/dist/Mesa/src/glsl/tests/lower_jumps/lower_breaks_2.opt_test.expected
new file mode 100644
index 000000000..dc231f975
--- /dev/null
+++ b/dist/Mesa/src/glsl/tests/lower_jumps/lower_breaks_2.opt_test.expected
@@ -0,0 +1,7 @@
+((declare (in) float b) (declare (out) float a)
+ (function main
+ (signature void (parameters)
+ ((loop
+ ((assign (x) (var_ref a) (constant float (1.000000)))
+ (if (expression bool > (var_ref b) (constant float (0.0))) (break)
+ ())))))))
diff --git a/dist/Mesa/src/glsl/tests/lower_jumps/lower_breaks_3.opt_test b/dist/Mesa/src/glsl/tests/lower_jumps/lower_breaks_3.opt_test
new file mode 100755
index 000000000..60368bc1d
--- /dev/null
+++ b/dist/Mesa/src/glsl/tests/lower_jumps/lower_breaks_3.opt_test
@@ -0,0 +1,17 @@
+#!/usr/bin/env bash
+#
+# This file was generated by create_test_cases.py.
+#
+# If a loop contains a conditional break at the bottom of it,
+# it should not be lowered if it is in the then-clause, even if
+# there are statements preceding the break.
+../../glsl_test optpass --quiet --input-ir 'do_lower_jumps(0, 0, 0, 0, 1)' <<EOF
+((declare (in) float b) (declare (out) float a) (declare (out) float c)
+ (function main
+ (signature void (parameters)
+ ((loop
+ ((assign (x) (var_ref a) (constant float (1.000000)))
+ (if (expression bool > (var_ref b) (constant float (0.000000)))
+ ((assign (x) (var_ref c) (constant float (1.000000))) break)
+ ())))))))
+EOF
diff --git a/dist/Mesa/src/glsl/tests/lower_jumps/lower_breaks_3.opt_test.expected b/dist/Mesa/src/glsl/tests/lower_jumps/lower_breaks_3.opt_test.expected
new file mode 100644
index 000000000..8131b66ff
--- /dev/null
+++ b/dist/Mesa/src/glsl/tests/lower_jumps/lower_breaks_3.opt_test.expected
@@ -0,0 +1,8 @@
+((declare (in) float b) (declare (out) float a) (declare (out) float c)
+ (function main
+ (signature void (parameters)
+ ((loop
+ ((assign (x) (var_ref a) (constant float (1.000000)))
+ (if (expression bool > (var_ref b) (constant float (0.0)))
+ ((assign (x) (var_ref c) (constant float (1.000000))) break)
+ ())))))))
diff --git a/dist/Mesa/src/glsl/tests/lower_jumps/lower_breaks_4.opt_test b/dist/Mesa/src/glsl/tests/lower_jumps/lower_breaks_4.opt_test
new file mode 100755
index 000000000..cde319793
--- /dev/null
+++ b/dist/Mesa/src/glsl/tests/lower_jumps/lower_breaks_4.opt_test
@@ -0,0 +1,15 @@
+#!/usr/bin/env bash
+#
+# This file was generated by create_test_cases.py.
+#
+# If a loop contains a conditional break at the bottom of it,
+# it should not be lowered if it is in the else-clause.
+../../glsl_test optpass --quiet --input-ir 'do_lower_jumps(0, 0, 0, 0, 1)' <<EOF
+((declare (in) float b) (declare (out) float a)
+ (function main
+ (signature void (parameters)
+ ((loop
+ ((assign (x) (var_ref a) (constant float (1.000000)))
+ (if (expression bool > (var_ref b) (constant float (0.000000))) ()
+ (break))))))))
+EOF
diff --git a/dist/Mesa/src/glsl/tests/lower_jumps/lower_breaks_4.opt_test.expected b/dist/Mesa/src/glsl/tests/lower_jumps/lower_breaks_4.opt_test.expected
new file mode 100644
index 000000000..94dcb37be
--- /dev/null
+++ b/dist/Mesa/src/glsl/tests/lower_jumps/lower_breaks_4.opt_test.expected
@@ -0,0 +1,7 @@
+((declare (in) float b) (declare (out) float a)
+ (function main
+ (signature void (parameters)
+ ((loop
+ ((assign (x) (var_ref a) (constant float (1.000000)))
+ (if (expression bool > (var_ref b) (constant float (0.0))) ()
+ (break))))))))
diff --git a/dist/Mesa/src/glsl/tests/lower_jumps/lower_breaks_5.opt_test b/dist/Mesa/src/glsl/tests/lower_jumps/lower_breaks_5.opt_test
new file mode 100755
index 000000000..157b5892f
--- /dev/null
+++ b/dist/Mesa/src/glsl/tests/lower_jumps/lower_breaks_5.opt_test
@@ -0,0 +1,16 @@
+#!/usr/bin/env bash
+#
+# This file was generated by create_test_cases.py.
+#
+# If a loop contains a conditional break at the bottom of it,
+# it should not be lowered if it is in the else-clause, even if
+# there are statements preceding the break.
+../../glsl_test optpass --quiet --input-ir 'do_lower_jumps(0, 0, 0, 0, 1)' <<EOF
+((declare (in) float b) (declare (out) float a) (declare (out) float c)
+ (function main
+ (signature void (parameters)
+ ((loop
+ ((assign (x) (var_ref a) (constant float (1.000000)))
+ (if (expression bool > (var_ref b) (constant float (0.000000))) ()
+ ((assign (x) (var_ref c) (constant float (1.000000))) break))))))))
+EOF
diff --git a/dist/Mesa/src/glsl/tests/lower_jumps/lower_breaks_5.opt_test.expected b/dist/Mesa/src/glsl/tests/lower_jumps/lower_breaks_5.opt_test.expected
new file mode 100644
index 000000000..5b46ccb67
--- /dev/null
+++ b/dist/Mesa/src/glsl/tests/lower_jumps/lower_breaks_5.opt_test.expected
@@ -0,0 +1,7 @@
+((declare (in) float b) (declare (out) float a) (declare (out) float c)
+ (function main
+ (signature void (parameters)
+ ((loop
+ ((assign (x) (var_ref a) (constant float (1.000000)))
+ (if (expression bool > (var_ref b) (constant float (0.0))) ()
+ ((assign (x) (var_ref c) (constant float (1.000000))) break))))))))
diff --git a/dist/Mesa/src/glsl/tests/lower_jumps/lower_breaks_6.opt_test b/dist/Mesa/src/glsl/tests/lower_jumps/lower_breaks_6.opt_test
new file mode 100755
index 000000000..4767df13e
--- /dev/null
+++ b/dist/Mesa/src/glsl/tests/lower_jumps/lower_breaks_6.opt_test
@@ -0,0 +1,29 @@
+#!/usr/bin/env bash
+#
+# This file was generated by create_test_cases.py.
+#
+# If a loop contains conditional breaks and continues, and
+# ends in an unconditional break, then the unconditional break
+# needs to be lowered, because it will no longer be at the end
+# of the loop after the final break is added.
+../../glsl_test optpass --quiet --input-ir 'do_lower_jumps(0, 0, 0, 1, 1)' <<EOF
+((declare (in) float a) (declare (in) float ba) (declare (in) float bb)
+ (declare (in) float ca)
+ (declare (in) float cb)
+ (function main
+ (signature void (parameters)
+ ((loop
+ ((if (expression bool > (var_ref a) (constant float (0.000000)))
+ ((if (expression bool > (var_ref ba) (constant float (0.000000)))
+ ((if (expression bool > (var_ref bb) (constant float (0.000000)))
+ (continue)
+ ()))
+ ())
+ (if (expression bool > (var_ref ca) (constant float (0.000000)))
+ ((if (expression bool > (var_ref cb) (constant float (0.000000)))
+ (break)
+ ()))
+ ()))
+ ())
+ break))))))
+EOF
diff --git a/dist/Mesa/src/glsl/tests/lower_jumps/lower_breaks_6.opt_test.expected b/dist/Mesa/src/glsl/tests/lower_jumps/lower_breaks_6.opt_test.expected
new file mode 100644
index 000000000..967ce642a
--- /dev/null
+++ b/dist/Mesa/src/glsl/tests/lower_jumps/lower_breaks_6.opt_test.expected
@@ -0,0 +1,29 @@
+((declare (in) float a) (declare (in) float ba) (declare (in) float bb)
+ (declare (in) float ca)
+ (declare (in) float cb)
+ (function main
+ (signature void (parameters)
+ ((declare (temporary) bool break_flag)
+ (assign (x) (var_ref break_flag) (constant bool (0)))
+ (loop
+ ((declare (temporary) bool execute_flag)
+ (assign (x) (var_ref execute_flag) (constant bool (1)))
+ (if (expression bool > (var_ref a) (constant float (0.0)))
+ ((if (expression bool > (var_ref ba) (constant float (0.0)))
+ ((if (expression bool > (var_ref bb) (constant float (0.0)))
+ ((assign (x) (var_ref execute_flag) (constant bool (0))))
+ ()))
+ ())
+ (if (var_ref execute_flag)
+ ((if (expression bool > (var_ref ca) (constant float (0.0)))
+ ((if (expression bool > (var_ref cb) (constant float (0.0)))
+ ((assign (x) (var_ref break_flag) (constant bool (1)))
+ (assign (x) (var_ref execute_flag) (constant bool (0))))
+ ()))
+ ()))
+ ()))
+ ())
+ (if (var_ref execute_flag)
+ ((assign (x) (var_ref break_flag) (constant bool (1))))
+ ())
+ (if (var_ref break_flag) (break) ())))))))
diff --git a/dist/Mesa/src/glsl/tests/lower_jumps/lower_guarded_conditional_break.opt_test b/dist/Mesa/src/glsl/tests/lower_jumps/lower_guarded_conditional_break.opt_test
new file mode 100755
index 000000000..164914a42
--- /dev/null
+++ b/dist/Mesa/src/glsl/tests/lower_jumps/lower_guarded_conditional_break.opt_test
@@ -0,0 +1,21 @@
+#!/usr/bin/env bash
+#
+# This file was generated by create_test_cases.py.
+#
+# Normally a conditional break at the end of a loop isn't
+# lowered, however if the conditional break gets placed inside
+# an if(execute_flag) because of earlier lowering of continues,
+# then the break needs to be lowered.
+../../glsl_test optpass --quiet --input-ir 'do_lower_jumps(0, 0, 0, 1, 1)' <<EOF
+((declare (in) float aa) (declare (in) float ab) (declare (in) float b)
+ (function main
+ (signature void (parameters)
+ ((loop
+ ((if (expression bool > (var_ref aa) (constant float (0.000000)))
+ ((if (expression bool > (var_ref ab) (constant float (0.000000)))
+ (continue)
+ ()))
+ ())
+ (if (expression bool > (var_ref b) (constant float (0.000000))) (break)
+ ())))))))
+EOF
diff --git a/dist/Mesa/src/glsl/tests/lower_jumps/lower_guarded_conditional_break.opt_test.expected b/dist/Mesa/src/glsl/tests/lower_jumps/lower_guarded_conditional_break.opt_test.expected
new file mode 100644
index 000000000..841073ed9
--- /dev/null
+++ b/dist/Mesa/src/glsl/tests/lower_jumps/lower_guarded_conditional_break.opt_test.expected
@@ -0,0 +1,20 @@
+((declare (in) float aa) (declare (in) float ab) (declare (in) float b)
+ (function main
+ (signature void (parameters)
+ ((declare (temporary) bool break_flag)
+ (assign (x) (var_ref break_flag) (constant bool (0)))
+ (loop
+ ((declare (temporary) bool execute_flag)
+ (assign (x) (var_ref execute_flag) (constant bool (1)))
+ (if (expression bool > (var_ref aa) (constant float (0.0)))
+ ((if (expression bool > (var_ref ab) (constant float (0.0)))
+ ((assign (x) (var_ref execute_flag) (constant bool (0))))
+ ()))
+ ())
+ (if (var_ref execute_flag)
+ ((if (expression bool > (var_ref b) (constant float (0.0)))
+ ((assign (x) (var_ref break_flag) (constant bool (1)))
+ (assign (x) (var_ref execute_flag) (constant bool (0))))
+ ()))
+ ())
+ (if (var_ref break_flag) (break) ())))))))
diff --git a/dist/Mesa/src/glsl/tests/lower_jumps/lower_pulled_out_jump.opt_test b/dist/Mesa/src/glsl/tests/lower_jumps/lower_pulled_out_jump.opt_test
new file mode 100755
index 000000000..1a5c09690
--- /dev/null
+++ b/dist/Mesa/src/glsl/tests/lower_jumps/lower_pulled_out_jump.opt_test
@@ -0,0 +1,28 @@
+#!/usr/bin/env bash
+#
+# This file was generated by create_test_cases.py.
+#
+# If one branch of an if ends in a jump, and control cannot
+# fall out the bottom of the other branch, and pull_out_jumps is
+# True, then the jump is lifted outside the if.
+# Verify that this lowering occurs during the same pass as the
+# lowering of other jumps by checking that extra temporary
+# variables aren't generated.
+../../glsl_test optpass --quiet --input-ir 'do_lower_jumps(1, 0, 1, 0, 0)' <<EOF
+((declare (in) float aa) (declare (in) float ab) (declare (in) float b)
+ (declare (in) float c)
+ (declare (out) float d)
+ (function main
+ (signature void (parameters)
+ ((if (expression bool > (var_ref aa) (constant float (0.000000)))
+ ((if (expression bool > (var_ref ab) (constant float (0.000000)))
+ ((return))
+ ()))
+ ())
+ (loop
+ ((if (expression bool > (var_ref b) (constant float (0.000000)))
+ ((if (expression bool > (var_ref c) (constant float (0.000000))) (break)
+ (continue)))
+ ((return)))))
+ (assign (x) (var_ref d) (constant float (1.000000)))))))
+EOF
diff --git a/dist/Mesa/src/glsl/tests/lower_jumps/lower_pulled_out_jump.opt_test.expected b/dist/Mesa/src/glsl/tests/lower_jumps/lower_pulled_out_jump.opt_test.expected
new file mode 100644
index 000000000..cf2ef3f08
--- /dev/null
+++ b/dist/Mesa/src/glsl/tests/lower_jumps/lower_pulled_out_jump.opt_test.expected
@@ -0,0 +1,25 @@
+((declare (in) float aa) (declare (in) float ab) (declare (in) float b)
+ (declare (in) float c)
+ (declare (out) float d)
+ (function main
+ (signature void (parameters)
+ ((declare (temporary) bool execute_flag)
+ (assign (x) (var_ref execute_flag) (constant bool (1)))
+ (declare (temporary) bool return_flag)
+ (assign (x) (var_ref return_flag) (constant bool (0)))
+ (if (expression bool > (var_ref aa) (constant float (0.0)))
+ ((if (expression bool > (var_ref ab) (constant float (0.0)))
+ ((assign (x) (var_ref return_flag) (constant bool (1)))
+ (assign (x) (var_ref execute_flag) (constant bool (0))))
+ ()))
+ ())
+ (if (var_ref execute_flag)
+ ((loop
+ ((if (expression bool > (var_ref b) (constant float (0.0)))
+ ((if (expression bool > (var_ref c) (constant float (0.0))) ()
+ (continue)))
+ ((assign (x) (var_ref return_flag) (constant bool (1)))))
+ break))
+ (if (var_ref return_flag) ()
+ ((assign (x) (var_ref d) (constant float (1.000000))))))
+ ())))))
diff --git a/dist/Mesa/src/glsl/tests/lower_jumps/lower_returns_1.opt_test b/dist/Mesa/src/glsl/tests/lower_jumps/lower_returns_1.opt_test
new file mode 100755
index 000000000..e73c51208
--- /dev/null
+++ b/dist/Mesa/src/glsl/tests/lower_jumps/lower_returns_1.opt_test
@@ -0,0 +1,12 @@
+#!/usr/bin/env bash
+#
+# This file was generated by create_test_cases.py.
+#
+# Test that a void return at the end of a function is
+# eliminated.
+../../glsl_test optpass --quiet --input-ir 'do_lower_jumps(0, 0, 1, 0, 0)' <<EOF
+((declare (out) float a)
+ (function main
+ (signature void (parameters)
+ ((assign (x) (var_ref a) (constant float (1.000000))) (return)))))
+EOF
diff --git a/dist/Mesa/src/glsl/tests/lower_jumps/lower_returns_1.opt_test.expected b/dist/Mesa/src/glsl/tests/lower_jumps/lower_returns_1.opt_test.expected
new file mode 100644
index 000000000..7c3919c01
--- /dev/null
+++ b/dist/Mesa/src/glsl/tests/lower_jumps/lower_returns_1.opt_test.expected
@@ -0,0 +1,4 @@
+((declare (out) float a)
+ (function main
+ (signature void (parameters)
+ ((assign (x) (var_ref a) (constant float (1.000000)))))))
diff --git a/dist/Mesa/src/glsl/tests/lower_jumps/lower_returns_2.opt_test b/dist/Mesa/src/glsl/tests/lower_jumps/lower_returns_2.opt_test
new file mode 100755
index 000000000..da2dc7ee2
--- /dev/null
+++ b/dist/Mesa/src/glsl/tests/lower_jumps/lower_returns_2.opt_test
@@ -0,0 +1,13 @@
+#!/usr/bin/env bash
+#
+# This file was generated by create_test_cases.py.
+#
+# Test that lowering is not performed on a non-void return at
+# the end of subroutine.
+../../glsl_test optpass --quiet --input-ir 'do_lower_jumps(0, 1, 0, 0, 0)' <<EOF
+((declare (out) float a)
+ (function sub
+ (signature float (parameters)
+ ((assign (x) (var_ref a) (constant float (1.000000)))
+ (return (constant float (1.000000)))))))
+EOF
diff --git a/dist/Mesa/src/glsl/tests/lower_jumps/lower_returns_2.opt_test.expected b/dist/Mesa/src/glsl/tests/lower_jumps/lower_returns_2.opt_test.expected
new file mode 100644
index 000000000..7777927f5
--- /dev/null
+++ b/dist/Mesa/src/glsl/tests/lower_jumps/lower_returns_2.opt_test.expected
@@ -0,0 +1,5 @@
+((declare (out) float a)
+ (function sub
+ (signature float (parameters)
+ ((assign (x) (var_ref a) (constant float (1.000000)))
+ (return (constant float (1.000000)))))))
diff --git a/dist/Mesa/src/glsl/tests/lower_jumps/lower_returns_3.opt_test b/dist/Mesa/src/glsl/tests/lower_jumps/lower_returns_3.opt_test
new file mode 100755
index 000000000..9509781fe
--- /dev/null
+++ b/dist/Mesa/src/glsl/tests/lower_jumps/lower_returns_3.opt_test
@@ -0,0 +1,20 @@
+#!/usr/bin/env bash
+#
+# This file was generated by create_test_cases.py.
+#
+# Test lowering of returns when there is one nested inside a
+# complex structure of ifs, and one at the end of a function.
+# In this case, the latter return needs to be lowered because it
+# will not be at the end of the function once the final return
+# is inserted.
+../../glsl_test optpass --quiet --input-ir 'do_lower_jumps(0, 1, 0, 0, 0)' <<EOF
+((declare (in) float a) (declare (in) float b)
+ (function sub
+ (signature float (parameters)
+ ((if (expression bool > (var_ref a) (constant float (0.000000)))
+ ((if (expression bool > (var_ref b) (constant float (0.000000)))
+ ((return (constant float (1.000000))))
+ ()))
+ ())
+ (return (constant float (2.000000)))))))
+EOF
diff --git a/dist/Mesa/src/glsl/tests/lower_jumps/lower_returns_3.opt_test.expected b/dist/Mesa/src/glsl/tests/lower_jumps/lower_returns_3.opt_test.expected
new file mode 100644
index 000000000..5b62bbcde
--- /dev/null
+++ b/dist/Mesa/src/glsl/tests/lower_jumps/lower_returns_3.opt_test.expected
@@ -0,0 +1,21 @@
+((declare (in) float a) (declare (in) float b)
+ (function sub
+ (signature float (parameters)
+ ((declare (temporary) bool execute_flag)
+ (assign (x) (var_ref execute_flag) (constant bool (1)))
+ (declare (temporary) float return_value)
+ (declare (temporary) bool return_flag)
+ (assign (x) (var_ref return_flag) (constant bool (0)))
+ (if (expression bool > (var_ref a) (constant float (0.0)))
+ ((if (expression bool > (var_ref b) (constant float (0.0)))
+ ((assign (x) (var_ref return_value) (constant float (1.000000)))
+ (assign (x) (var_ref return_flag) (constant bool (1)))
+ (assign (x) (var_ref execute_flag) (constant bool (0))))
+ ()))
+ ())
+ (if (var_ref execute_flag)
+ ((assign (x) (var_ref return_value) (constant float (2.000000)))
+ (assign (x) (var_ref return_flag) (constant bool (1)))
+ (assign (x) (var_ref execute_flag) (constant bool (0))))
+ ())
+ (return (var_ref return_value))))))
diff --git a/dist/Mesa/src/glsl/tests/lower_jumps/lower_returns_4.opt_test b/dist/Mesa/src/glsl/tests/lower_jumps/lower_returns_4.opt_test
new file mode 100755
index 000000000..c5bb9c898
--- /dev/null
+++ b/dist/Mesa/src/glsl/tests/lower_jumps/lower_returns_4.opt_test
@@ -0,0 +1,14 @@
+#!/usr/bin/env bash
+#
+# This file was generated by create_test_cases.py.
+#
+# Test that returns are properly lowered when they occur in
+# both branches of an if-statement.
+../../glsl_test optpass --quiet --input-ir 'do_lower_jumps(0, 1, 0, 0, 0)' <<EOF
+((declare (in) float a)
+ (function sub
+ (signature float (parameters)
+ ((if (expression bool > (var_ref a) (constant float (0.000000)))
+ ((return (constant float (1.000000))))
+ ((return (constant float (2.000000)))))))))
+EOF
diff --git a/dist/Mesa/src/glsl/tests/lower_jumps/lower_returns_4.opt_test.expected b/dist/Mesa/src/glsl/tests/lower_jumps/lower_returns_4.opt_test.expected
new file mode 100644
index 000000000..07c6842d2
--- /dev/null
+++ b/dist/Mesa/src/glsl/tests/lower_jumps/lower_returns_4.opt_test.expected
@@ -0,0 +1,16 @@
+((declare (in) float a)
+ (function sub
+ (signature float (parameters)
+ ((declare (temporary) bool execute_flag)
+ (assign (x) (var_ref execute_flag) (constant bool (1)))
+ (declare (temporary) float return_value)
+ (declare (temporary) bool return_flag)
+ (assign (x) (var_ref return_flag) (constant bool (0)))
+ (if (expression bool > (var_ref a) (constant float (0.0)))
+ ((assign (x) (var_ref return_value) (constant float (1.000000)))
+ (assign (x) (var_ref return_flag) (constant bool (1)))
+ (assign (x) (var_ref execute_flag) (constant bool (0))))
+ ((assign (x) (var_ref return_value) (constant float (2.000000)))
+ (assign (x) (var_ref return_flag) (constant bool (1)))
+ (assign (x) (var_ref execute_flag) (constant bool (0)))))
+ (return (var_ref return_value))))))
diff --git a/dist/Mesa/src/glsl/tests/lower_jumps/lower_returns_main_false.opt_test b/dist/Mesa/src/glsl/tests/lower_jumps/lower_returns_main_false.opt_test
new file mode 100755
index 000000000..fdb1d0ed2
--- /dev/null
+++ b/dist/Mesa/src/glsl/tests/lower_jumps/lower_returns_main_false.opt_test
@@ -0,0 +1,17 @@
+#!/usr/bin/env bash
+#
+# This file was generated by create_test_cases.py.
+#
+# Test that do_lower_jumps respects the lower_main_return
+# flag in deciding whether to lower returns in the main
+# function.
+../../glsl_test optpass --quiet --input-ir 'do_lower_jumps(0, 0, 0, 0, 0)' <<EOF
+((declare (in) float a) (declare (in) float b)
+ (function main
+ (signature void (parameters)
+ ((if (expression bool > (var_ref a) (constant float (0.000000)))
+ ((if (expression bool > (var_ref b) (constant float (0.000000)))
+ ((return))
+ ()))
+ ())))))
+EOF
diff --git a/dist/Mesa/src/glsl/tests/lower_jumps/lower_returns_main_false.opt_test.expected b/dist/Mesa/src/glsl/tests/lower_jumps/lower_returns_main_false.opt_test.expected
new file mode 100644
index 000000000..7e3fe314f
--- /dev/null
+++ b/dist/Mesa/src/glsl/tests/lower_jumps/lower_returns_main_false.opt_test.expected
@@ -0,0 +1,8 @@
+((declare (in) float a) (declare (in) float b)
+ (function main
+ (signature void (parameters)
+ ((if (expression bool > (var_ref a) (constant float (0.0)))
+ ((if (expression bool > (var_ref b) (constant float (0.0)))
+ ((return))
+ ()))
+ ())))))
diff --git a/dist/Mesa/src/glsl/tests/lower_jumps/lower_returns_main_true.opt_test b/dist/Mesa/src/glsl/tests/lower_jumps/lower_returns_main_true.opt_test
new file mode 100755
index 000000000..939ec8b0e
--- /dev/null
+++ b/dist/Mesa/src/glsl/tests/lower_jumps/lower_returns_main_true.opt_test
@@ -0,0 +1,17 @@
+#!/usr/bin/env bash
+#
+# This file was generated by create_test_cases.py.
+#
+# Test that do_lower_jumps respects the lower_main_return
+# flag in deciding whether to lower returns in the main
+# function.
+../../glsl_test optpass --quiet --input-ir 'do_lower_jumps(0, 0, 1, 0, 0)' <<EOF
+((declare (in) float a) (declare (in) float b)
+ (function main
+ (signature void (parameters)
+ ((if (expression bool > (var_ref a) (constant float (0.000000)))
+ ((if (expression bool > (var_ref b) (constant float (0.000000)))
+ ((return))
+ ()))
+ ())))))
+EOF
diff --git a/dist/Mesa/src/glsl/tests/lower_jumps/lower_returns_main_true.opt_test.expected b/dist/Mesa/src/glsl/tests/lower_jumps/lower_returns_main_true.opt_test.expected
new file mode 100644
index 000000000..b47f5a433
--- /dev/null
+++ b/dist/Mesa/src/glsl/tests/lower_jumps/lower_returns_main_true.opt_test.expected
@@ -0,0 +1,13 @@
+((declare (in) float a) (declare (in) float b)
+ (function main
+ (signature void (parameters)
+ ((declare (temporary) bool execute_flag)
+ (assign (x) (var_ref execute_flag) (constant bool (1)))
+ (declare (temporary) bool return_flag)
+ (assign (x) (var_ref return_flag) (constant bool (0)))
+ (if (expression bool > (var_ref a) (constant float (0.0)))
+ ((if (expression bool > (var_ref b) (constant float (0.0)))
+ ((assign (x) (var_ref return_flag) (constant bool (1)))
+ (assign (x) (var_ref execute_flag) (constant bool (0))))
+ ()))
+ ())))))
diff --git a/dist/Mesa/src/glsl/tests/lower_jumps/lower_returns_sub_false.opt_test b/dist/Mesa/src/glsl/tests/lower_jumps/lower_returns_sub_false.opt_test
new file mode 100755
index 000000000..92a4e8a62
--- /dev/null
+++ b/dist/Mesa/src/glsl/tests/lower_jumps/lower_returns_sub_false.opt_test
@@ -0,0 +1,16 @@
+#!/usr/bin/env bash
+#
+# This file was generated by create_test_cases.py.
+#
+# Test that do_lower_jumps respects the lower_sub_return flag
+# in deciding whether to lower returns in subroutines.
+../../glsl_test optpass --quiet --input-ir 'do_lower_jumps(0, 0, 0, 0, 0)' <<EOF
+((declare (in) float a) (declare (in) float b)
+ (function sub
+ (signature void (parameters)
+ ((if (expression bool > (var_ref a) (constant float (0.000000)))
+ ((if (expression bool > (var_ref b) (constant float (0.000000)))
+ ((return))
+ ()))
+ ())))))
+EOF
diff --git a/dist/Mesa/src/glsl/tests/lower_jumps/lower_returns_sub_false.opt_test.expected b/dist/Mesa/src/glsl/tests/lower_jumps/lower_returns_sub_false.opt_test.expected
new file mode 100644
index 000000000..7424968b2
--- /dev/null
+++ b/dist/Mesa/src/glsl/tests/lower_jumps/lower_returns_sub_false.opt_test.expected
@@ -0,0 +1,8 @@
+((declare (in) float a) (declare (in) float b)
+ (function sub
+ (signature void (parameters)
+ ((if (expression bool > (var_ref a) (constant float (0.0)))
+ ((if (expression bool > (var_ref b) (constant float (0.0)))
+ ((return))
+ ()))
+ ())))))
diff --git a/dist/Mesa/src/glsl/tests/lower_jumps/lower_returns_sub_true.opt_test b/dist/Mesa/src/glsl/tests/lower_jumps/lower_returns_sub_true.opt_test
new file mode 100755
index 000000000..789414ecb
--- /dev/null
+++ b/dist/Mesa/src/glsl/tests/lower_jumps/lower_returns_sub_true.opt_test
@@ -0,0 +1,16 @@
+#!/usr/bin/env bash
+#
+# This file was generated by create_test_cases.py.
+#
+# Test that do_lower_jumps respects the lower_sub_return flag
+# in deciding whether to lower returns in subroutines.
+../../glsl_test optpass --quiet --input-ir 'do_lower_jumps(0, 1, 0, 0, 0)' <<EOF
+((declare (in) float a) (declare (in) float b)
+ (function sub
+ (signature void (parameters)
+ ((if (expression bool > (var_ref a) (constant float (0.000000)))
+ ((if (expression bool > (var_ref b) (constant float (0.000000)))
+ ((return))
+ ()))
+ ())))))
+EOF
diff --git a/dist/Mesa/src/glsl/tests/lower_jumps/lower_returns_sub_true.opt_test.expected b/dist/Mesa/src/glsl/tests/lower_jumps/lower_returns_sub_true.opt_test.expected
new file mode 100644
index 000000000..1a3eae5da
--- /dev/null
+++ b/dist/Mesa/src/glsl/tests/lower_jumps/lower_returns_sub_true.opt_test.expected
@@ -0,0 +1,13 @@
+((declare (in) float a) (declare (in) float b)
+ (function sub
+ (signature void (parameters)
+ ((declare (temporary) bool execute_flag)
+ (assign (x) (var_ref execute_flag) (constant bool (1)))
+ (declare (temporary) bool return_flag)
+ (assign (x) (var_ref return_flag) (constant bool (0)))
+ (if (expression bool > (var_ref a) (constant float (0.0)))
+ ((if (expression bool > (var_ref b) (constant float (0.0)))
+ ((assign (x) (var_ref return_flag) (constant bool (1)))
+ (assign (x) (var_ref execute_flag) (constant bool (0))))
+ ()))
+ ())))))
diff --git a/dist/Mesa/src/glsl/tests/lower_jumps/lower_unified_returns.opt_test b/dist/Mesa/src/glsl/tests/lower_jumps/lower_unified_returns.opt_test
new file mode 100755
index 000000000..5d6e51cff
--- /dev/null
+++ b/dist/Mesa/src/glsl/tests/lower_jumps/lower_unified_returns.opt_test
@@ -0,0 +1,26 @@
+#!/usr/bin/env bash
+#
+# This file was generated by create_test_cases.py.
+#
+# If both branches of an if statement end in a return, and
+# pull_out_jumps is True, then those returns should be lifted
+# outside the if and then properly lowered.
+# Verify that this lowering occurs during the same pass as the
+# lowering of other returns by checking that extra temporary
+# variables aren't generated.
+../../glsl_test optpass --quiet --input-ir 'do_lower_jumps(1, 0, 1, 0, 0)' <<EOF
+((declare (in) float aa) (declare (in) float ab) (declare (in) float b)
+ (declare (in) float c)
+ (function main
+ (signature void (parameters)
+ ((if (expression bool > (var_ref aa) (constant float (0.000000)))
+ ((if (expression bool > (var_ref ab) (constant float (0.000000)))
+ ((return))
+ ()))
+ ())
+ (if (expression bool > (var_ref b) (constant float (0.000000)))
+ ((if (expression bool > (var_ref c) (constant float (0.000000)))
+ ((return))
+ ((return))))
+ ())))))
+EOF
diff --git a/dist/Mesa/src/glsl/tests/lower_jumps/lower_unified_returns.opt_test.expected b/dist/Mesa/src/glsl/tests/lower_jumps/lower_unified_returns.opt_test.expected
new file mode 100644
index 000000000..c0b51e1ba
--- /dev/null
+++ b/dist/Mesa/src/glsl/tests/lower_jumps/lower_unified_returns.opt_test.expected
@@ -0,0 +1,21 @@
+((declare (in) float aa) (declare (in) float ab) (declare (in) float b)
+ (declare (in) float c)
+ (function main
+ (signature void (parameters)
+ ((declare (temporary) bool execute_flag)
+ (assign (x) (var_ref execute_flag) (constant bool (1)))
+ (declare (temporary) bool return_flag)
+ (assign (x) (var_ref return_flag) (constant bool (0)))
+ (if (expression bool > (var_ref aa) (constant float (0.0)))
+ ((if (expression bool > (var_ref ab) (constant float (0.0)))
+ ((assign (x) (var_ref return_flag) (constant bool (1)))
+ (assign (x) (var_ref execute_flag) (constant bool (0))))
+ ()))
+ ())
+ (if (var_ref execute_flag)
+ ((if (expression bool > (var_ref b) (constant float (0.0)))
+ ((if (expression bool > (var_ref c) (constant float (0.0))) () ())
+ (assign (x) (var_ref return_flag) (constant bool (1)))
+ (assign (x) (var_ref execute_flag) (constant bool (0))))
+ ()))
+ ())))))
diff --git a/dist/Mesa/src/glsl/tests/lower_jumps/remove_continue_at_end_of_loop.opt_test b/dist/Mesa/src/glsl/tests/lower_jumps/remove_continue_at_end_of_loop.opt_test
new file mode 100755
index 000000000..8403bb204
--- /dev/null
+++ b/dist/Mesa/src/glsl/tests/lower_jumps/remove_continue_at_end_of_loop.opt_test
@@ -0,0 +1,13 @@
+#!/usr/bin/env bash
+#
+# This file was generated by create_test_cases.py.
+#
+# Test that a redundant continue-statement at the end of a
+# loop is removed.
+../../glsl_test optpass --quiet --input-ir 'do_lower_jumps(0, 0, 0, 0, 0)' <<EOF
+((declare (out) float a)
+ (function main
+ (signature void (parameters)
+ ((loop
+ ((assign (x) (var_ref a) (constant float (1.000000))) continue))))))
+EOF
diff --git a/dist/Mesa/src/glsl/tests/lower_jumps/remove_continue_at_end_of_loop.opt_test.expected b/dist/Mesa/src/glsl/tests/lower_jumps/remove_continue_at_end_of_loop.opt_test.expected
new file mode 100644
index 000000000..98b74d71e
--- /dev/null
+++ b/dist/Mesa/src/glsl/tests/lower_jumps/remove_continue_at_end_of_loop.opt_test.expected
@@ -0,0 +1,5 @@
+((declare (out) float a)
+ (function main
+ (signature void (parameters)
+ ((loop
+ ((assign (x) (var_ref a) (constant float (1.000000)))))))))
diff --git a/dist/Mesa/src/glsl/tests/lower_jumps/return_non_void_at_end_of_loop_lower_nothing.opt_test b/dist/Mesa/src/glsl/tests/lower_jumps/return_non_void_at_end_of_loop_lower_nothing.opt_test
new file mode 100755
index 000000000..1f62e7349
--- /dev/null
+++ b/dist/Mesa/src/glsl/tests/lower_jumps/return_non_void_at_end_of_loop_lower_nothing.opt_test
@@ -0,0 +1,16 @@
+#!/usr/bin/env bash
+#
+# This file was generated by create_test_cases.py.
+#
+# Test that a non-void return at the end of a loop is
+# properly lowered.
+../../glsl_test optpass --quiet --input-ir 'do_lower_jumps(0, 0, 0, 0, 0)' <<EOF
+((declare (out) float a) (declare (out) float b)
+ (function sub
+ (signature float (parameters)
+ ((loop
+ ((assign (x) (var_ref a) (constant float (1.000000)))
+ (return (constant float (2.000000)))))
+ (assign (x) (var_ref b) (constant float (3.000000)))
+ (return (constant float (4.000000)))))))
+EOF
diff --git a/dist/Mesa/src/glsl/tests/lower_jumps/return_non_void_at_end_of_loop_lower_nothing.opt_test.expected b/dist/Mesa/src/glsl/tests/lower_jumps/return_non_void_at_end_of_loop_lower_nothing.opt_test.expected
new file mode 100644
index 000000000..040d383b6
--- /dev/null
+++ b/dist/Mesa/src/glsl/tests/lower_jumps/return_non_void_at_end_of_loop_lower_nothing.opt_test.expected
@@ -0,0 +1,8 @@
+((declare (out) float a) (declare (out) float b)
+ (function sub
+ (signature float (parameters)
+ ((loop
+ ((assign (x) (var_ref a) (constant float (1.000000)))
+ (return (constant float (2.000000)))))
+ (assign (x) (var_ref b) (constant float (3.000000)))
+ (return (constant float (4.000000)))))))
diff --git a/dist/Mesa/src/glsl/tests/lower_jumps/return_non_void_at_end_of_loop_lower_return.opt_test b/dist/Mesa/src/glsl/tests/lower_jumps/return_non_void_at_end_of_loop_lower_return.opt_test
new file mode 100755
index 000000000..42c4e7529
--- /dev/null
+++ b/dist/Mesa/src/glsl/tests/lower_jumps/return_non_void_at_end_of_loop_lower_return.opt_test
@@ -0,0 +1,16 @@
+#!/usr/bin/env bash
+#
+# This file was generated by create_test_cases.py.
+#
+# Test that a non-void return at the end of a loop is
+# properly lowered.
+../../glsl_test optpass --quiet --input-ir 'do_lower_jumps(0, 1, 0, 0, 0)' <<EOF
+((declare (out) float a) (declare (out) float b)
+ (function sub
+ (signature float (parameters)
+ ((loop
+ ((assign (x) (var_ref a) (constant float (1.000000)))
+ (return (constant float (2.000000)))))
+ (assign (x) (var_ref b) (constant float (3.000000)))
+ (return (constant float (4.000000)))))))
+EOF
diff --git a/dist/Mesa/src/glsl/tests/lower_jumps/return_non_void_at_end_of_loop_lower_return.opt_test.expected b/dist/Mesa/src/glsl/tests/lower_jumps/return_non_void_at_end_of_loop_lower_return.opt_test.expected
new file mode 100644
index 000000000..792cbf69a
--- /dev/null
+++ b/dist/Mesa/src/glsl/tests/lower_jumps/return_non_void_at_end_of_loop_lower_return.opt_test.expected
@@ -0,0 +1,19 @@
+((declare (out) float a) (declare (out) float b)
+ (function sub
+ (signature float (parameters)
+ ((declare (temporary) bool execute_flag)
+ (assign (x) (var_ref execute_flag) (constant bool (1)))
+ (declare (temporary) float return_value)
+ (declare (temporary) bool return_flag)
+ (assign (x) (var_ref return_flag) (constant bool (0)))
+ (loop
+ ((assign (x) (var_ref a) (constant float (1.000000)))
+ (assign (x) (var_ref return_value) (constant float (2.000000)))
+ (assign (x) (var_ref return_flag) (constant bool (1)))
+ break))
+ (if (var_ref return_flag) ()
+ ((assign (x) (var_ref b) (constant float (3.000000)))
+ (assign (x) (var_ref return_value) (constant float (4.000000)))
+ (assign (x) (var_ref return_flag) (constant bool (1)))
+ (assign (x) (var_ref execute_flag) (constant bool (0)))))
+ (return (var_ref return_value))))))
diff --git a/dist/Mesa/src/glsl/tests/lower_jumps/return_non_void_at_end_of_loop_lower_return_and_break.opt_test b/dist/Mesa/src/glsl/tests/lower_jumps/return_non_void_at_end_of_loop_lower_return_and_break.opt_test
new file mode 100755
index 000000000..b3eef39b7
--- /dev/null
+++ b/dist/Mesa/src/glsl/tests/lower_jumps/return_non_void_at_end_of_loop_lower_return_and_break.opt_test
@@ -0,0 +1,16 @@
+#!/usr/bin/env bash
+#
+# This file was generated by create_test_cases.py.
+#
+# Test that a non-void return at the end of a loop is
+# properly lowered.
+../../glsl_test optpass --quiet --input-ir 'do_lower_jumps(0, 1, 0, 0, 1)' <<EOF
+((declare (out) float a) (declare (out) float b)
+ (function sub
+ (signature float (parameters)
+ ((loop
+ ((assign (x) (var_ref a) (constant float (1.000000)))
+ (return (constant float (2.000000)))))
+ (assign (x) (var_ref b) (constant float (3.000000)))
+ (return (constant float (4.000000)))))))
+EOF
diff --git a/dist/Mesa/src/glsl/tests/lower_jumps/return_non_void_at_end_of_loop_lower_return_and_break.opt_test.expected b/dist/Mesa/src/glsl/tests/lower_jumps/return_non_void_at_end_of_loop_lower_return_and_break.opt_test.expected
new file mode 100644
index 000000000..792cbf69a
--- /dev/null
+++ b/dist/Mesa/src/glsl/tests/lower_jumps/return_non_void_at_end_of_loop_lower_return_and_break.opt_test.expected
@@ -0,0 +1,19 @@
+((declare (out) float a) (declare (out) float b)
+ (function sub
+ (signature float (parameters)
+ ((declare (temporary) bool execute_flag)
+ (assign (x) (var_ref execute_flag) (constant bool (1)))
+ (declare (temporary) float return_value)
+ (declare (temporary) bool return_flag)
+ (assign (x) (var_ref return_flag) (constant bool (0)))
+ (loop
+ ((assign (x) (var_ref a) (constant float (1.000000)))
+ (assign (x) (var_ref return_value) (constant float (2.000000)))
+ (assign (x) (var_ref return_flag) (constant bool (1)))
+ break))
+ (if (var_ref return_flag) ()
+ ((assign (x) (var_ref b) (constant float (3.000000)))
+ (assign (x) (var_ref return_value) (constant float (4.000000)))
+ (assign (x) (var_ref return_flag) (constant bool (1)))
+ (assign (x) (var_ref execute_flag) (constant bool (0)))))
+ (return (var_ref return_value))))))
diff --git a/dist/Mesa/src/glsl/tests/lower_jumps/return_void_at_end_of_loop_lower_nothing.opt_test b/dist/Mesa/src/glsl/tests/lower_jumps/return_void_at_end_of_loop_lower_nothing.opt_test
new file mode 100755
index 000000000..0408282d0
--- /dev/null
+++ b/dist/Mesa/src/glsl/tests/lower_jumps/return_void_at_end_of_loop_lower_nothing.opt_test
@@ -0,0 +1,14 @@
+#!/usr/bin/env bash
+#
+# This file was generated by create_test_cases.py.
+#
+# Test that a return of void at the end of a loop is properly
+# lowered.
+../../glsl_test optpass --quiet --input-ir 'do_lower_jumps(0, 0, 0, 0, 0)' <<EOF
+((declare (out) float a) (declare (out) float b)
+ (function main
+ (signature void (parameters)
+ ((loop
+ ((assign (x) (var_ref a) (constant float (1.000000))) (return)))
+ (assign (x) (var_ref b) (constant float (2.000000)))))))
+EOF
diff --git a/dist/Mesa/src/glsl/tests/lower_jumps/return_void_at_end_of_loop_lower_nothing.opt_test.expected b/dist/Mesa/src/glsl/tests/lower_jumps/return_void_at_end_of_loop_lower_nothing.opt_test.expected
new file mode 100644
index 000000000..569213e99
--- /dev/null
+++ b/dist/Mesa/src/glsl/tests/lower_jumps/return_void_at_end_of_loop_lower_nothing.opt_test.expected
@@ -0,0 +1,6 @@
+((declare (out) float a) (declare (out) float b)
+ (function main
+ (signature void (parameters)
+ ((loop
+ ((assign (x) (var_ref a) (constant float (1.000000))) (return)))
+ (assign (x) (var_ref b) (constant float (2.000000)))))))
diff --git a/dist/Mesa/src/glsl/tests/lower_jumps/return_void_at_end_of_loop_lower_return.opt_test b/dist/Mesa/src/glsl/tests/lower_jumps/return_void_at_end_of_loop_lower_return.opt_test
new file mode 100755
index 000000000..a7e65c86c
--- /dev/null
+++ b/dist/Mesa/src/glsl/tests/lower_jumps/return_void_at_end_of_loop_lower_return.opt_test
@@ -0,0 +1,14 @@
+#!/usr/bin/env bash
+#
+# This file was generated by create_test_cases.py.
+#
+# Test that a return of void at the end of a loop is properly
+# lowered.
+../../glsl_test optpass --quiet --input-ir 'do_lower_jumps(0, 0, 1, 0, 0)' <<EOF
+((declare (out) float a) (declare (out) float b)
+ (function main
+ (signature void (parameters)
+ ((loop
+ ((assign (x) (var_ref a) (constant float (1.000000))) (return)))
+ (assign (x) (var_ref b) (constant float (2.000000)))))))
+EOF
diff --git a/dist/Mesa/src/glsl/tests/lower_jumps/return_void_at_end_of_loop_lower_return.opt_test.expected b/dist/Mesa/src/glsl/tests/lower_jumps/return_void_at_end_of_loop_lower_return.opt_test.expected
new file mode 100644
index 000000000..66f3aeca5
--- /dev/null
+++ b/dist/Mesa/src/glsl/tests/lower_jumps/return_void_at_end_of_loop_lower_return.opt_test.expected
@@ -0,0 +1,11 @@
+((declare (out) float a) (declare (out) float b)
+ (function main
+ (signature void (parameters)
+ ((declare (temporary) bool return_flag)
+ (assign (x) (var_ref return_flag) (constant bool (0)))
+ (loop
+ ((assign (x) (var_ref a) (constant float (1.000000)))
+ (assign (x) (var_ref return_flag) (constant bool (1)))
+ break))
+ (if (var_ref return_flag) ()
+ ((assign (x) (var_ref b) (constant float (2.000000)))))))))
diff --git a/dist/Mesa/src/glsl/tests/lower_jumps/return_void_at_end_of_loop_lower_return_and_break.opt_test b/dist/Mesa/src/glsl/tests/lower_jumps/return_void_at_end_of_loop_lower_return_and_break.opt_test
new file mode 100755
index 000000000..7a5efe581
--- /dev/null
+++ b/dist/Mesa/src/glsl/tests/lower_jumps/return_void_at_end_of_loop_lower_return_and_break.opt_test
@@ -0,0 +1,14 @@
+#!/usr/bin/env bash
+#
+# This file was generated by create_test_cases.py.
+#
+# Test that a return of void at the end of a loop is properly
+# lowered.
+../../glsl_test optpass --quiet --input-ir 'do_lower_jumps(0, 0, 1, 0, 1)' <<EOF
+((declare (out) float a) (declare (out) float b)
+ (function main
+ (signature void (parameters)
+ ((loop
+ ((assign (x) (var_ref a) (constant float (1.000000))) (return)))
+ (assign (x) (var_ref b) (constant float (2.000000)))))))
+EOF
diff --git a/dist/Mesa/src/glsl/tests/lower_jumps/return_void_at_end_of_loop_lower_return_and_break.opt_test.expected b/dist/Mesa/src/glsl/tests/lower_jumps/return_void_at_end_of_loop_lower_return_and_break.opt_test.expected
new file mode 100644
index 000000000..66f3aeca5
--- /dev/null
+++ b/dist/Mesa/src/glsl/tests/lower_jumps/return_void_at_end_of_loop_lower_return_and_break.opt_test.expected
@@ -0,0 +1,11 @@
+((declare (out) float a) (declare (out) float b)
+ (function main
+ (signature void (parameters)
+ ((declare (temporary) bool return_flag)
+ (assign (x) (var_ref return_flag) (constant bool (0)))
+ (loop
+ ((assign (x) (var_ref a) (constant float (1.000000)))
+ (assign (x) (var_ref return_flag) (constant bool (1)))
+ break))
+ (if (var_ref return_flag) ()
+ ((assign (x) (var_ref b) (constant float (2.000000)))))))))
diff --git a/dist/Mesa/src/glsl/tests/ralloc_test.cpp b/dist/Mesa/src/glsl/tests/ralloc_test.cpp
new file mode 100644
index 000000000..c0a870a81
--- /dev/null
+++ b/dist/Mesa/src/glsl/tests/ralloc_test.cpp
@@ -0,0 +1,38 @@
+/*
+ * Copyright © 2012 Intel Corporation
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+#include <gtest/gtest.h>
+#include <string.h>
+
+#include "ralloc.h"
+
+/**
+ * \name Basic functionality
+ */
+/*@{*/
+TEST(ralloc_test, null_parent)
+{
+ void *mem_ctx = ralloc_context(NULL);
+
+ EXPECT_EQ(NULL, ralloc_parent(mem_ctx));
+}
+/*@}*/