Lines Matching refs:expr

84    s_expression *expr = s_expression::read_expression(sx_mem_ctx, src);  in read()  local
85 if (expr == NULL) { in read()
91 scan_for_prototypes(instructions, expr); in read()
96 read_instructions(instructions, expr, NULL); in read()
104 ir_reader::ir_read_error(s_expression *expr, const char *fmt, ...) in ir_read_error() argument
120 if (expr != NULL) { in ir_read_error()
122 expr->print(); in ir_read_error()
128 ir_reader::read_type(s_expression *expr) in read_type() argument
134 if (MATCH(expr, pat)) { in read_type()
144 s_symbol *type_sym = SX_AS_SYMBOL(expr); in read_type()
146 ir_read_error(expr, "expected <type>"); in read_type()
152 ir_read_error(expr, "invalid type: %s", type_sym->value()); in read_type()
159 ir_reader::scan_for_prototypes(exec_list *instructions, s_expression *expr) in scan_for_prototypes() argument
161 s_list *list = SX_AS_LIST(expr); in scan_for_prototypes()
163 ir_read_error(expr, "Expected (<instruction> ...); found an atom."); in scan_for_prototypes()
184 ir_reader::read_function(s_expression *expr, bool skip_body) in read_function() argument
190 if (!PARTIAL_MATCH(expr, pat)) { in read_function()
191 ir_read_error(expr, "Expected (function <name> (signature ...) ...)"); in read_function()
202 exec_list_iterator it = ((s_list *) expr)->subexpressions.iterator(); in read_function()
213 ir_reader::read_function_sig(ir_function *f, s_expression *expr, bool skip_body) in read_function_sig() argument
220 if (!MATCH(expr, pat)) { in read_function_sig()
221 ir_read_error(expr, "Expected (signature <type> (parameters ...) " in read_function_sig()
258 ir_read_error(expr, "function `%s' parameter `%s' qualifiers " in read_function_sig()
264 ir_read_error(expr, "function `%s' return type doesn't " in read_function_sig()
279 ir_read_error(expr, "function %s redefined", f->name); in read_function_sig()
292 ir_reader::read_instructions(exec_list *instructions, s_expression *expr, in read_instructions() argument
296 s_list *list = SX_AS_LIST(expr); in read_instructions()
298 ir_read_error(expr, "Expected (<instruction> ...); found an atom."); in read_instructions()
321 ir_reader::read_instruction(s_expression *expr, ir_loop *loop_ctx) in read_instruction() argument
323 s_symbol *symbol = SX_AS_SYMBOL(expr); in read_instruction()
331 s_list *list = SX_AS_LIST(expr); in read_instruction()
333 ir_read_error(expr, "Invalid instruction.\n"); in read_instruction()
339 ir_read_error(expr, "expected instruction tag"); in read_instruction()
367 ir_reader::read_declaration(s_expression *expr) in read_declaration() argument
374 if (!MATCH(expr, pat)) { in read_declaration()
375 ir_read_error(expr, "expected (declare (<qualifiers>) <type> <name>)"); in read_declaration()
389 ir_read_error(expr, "qualifier list must contain only symbols"); in read_declaration()
419 ir_read_error(expr, "unknown qualifier: %s", qualifier->value()); in read_declaration()
432 ir_reader::read_if(s_expression *expr, ir_loop *loop_ctx) in read_if() argument
439 if (!MATCH(expr, pat)) { in read_if()
440 ir_read_error(expr, "expected (if <condition> (<then>...) (<else>...))"); in read_if()
463 ir_reader::read_loop(s_expression *expr) in read_loop() argument
468 if (!MATCH(expr, pat)) { in read_loop()
469 ir_read_error(expr, "expected (loop <counter> <from> <to> " in read_loop()
487 ir_reader::read_return(s_expression *expr) in read_return() argument
493 if (MATCH(expr, return_value_pat)) { in read_return()
500 } else if (MATCH(expr, return_void_pat)) { in read_return()
503 ir_read_error(expr, "expected (return <rvalue>) or (return)"); in read_return()
510 ir_reader::read_rvalue(s_expression *expr) in read_rvalue() argument
512 s_list *list = SX_AS_LIST(expr); in read_rvalue()
518 ir_read_error(expr, "expected rvalue tag"); in read_rvalue()
534 ir_read_error(expr, "unrecognized rvalue tag: %s", tag->value()); in read_rvalue()
541 ir_reader::read_assignment(s_expression *expr) in read_assignment() argument
549 if (!MATCH(expr, pat4) && !MATCH(expr, pat5)) { in read_assignment()
550 ir_read_error(expr, "expected (assign [<condition>] (<write mask>) " in read_assignment()
572 ir_read_error(expr, "invalid write mask: %s", mask_str); in read_assignment()
580 ir_read_error(expr, "write mask contains invalid character: %c", in read_assignment()
604 ir_read_error(expr, "non-zero write mask required."); in read_assignment()
612 ir_reader::read_call(s_expression *expr) in read_call() argument
622 if (MATCH(expr, non_void_pat)) { in read_call()
628 } else if (!MATCH(expr, void_pat)) { in read_call()
629 ir_read_error(expr, "expected (call <name> [<deref>] (<param> ...))"); in read_call()
636 s_expression *expr = (s_expression*) it.get(); in read_call() local
637 ir_rvalue *param = read_rvalue(expr); in read_call()
639 ir_read_error(expr, "when reading parameter to function call"); in read_call()
647 ir_read_error(expr, "found call to undefined function %s", in read_call()
654 ir_read_error(expr, "couldn't find matching signature for function " in read_call()
660 ir_read_error(expr, "call has return value storage but void type"); in read_call()
663 ir_read_error(expr, "call has non-void type but no return value storage"); in read_call()
671 ir_reader::read_expression(s_expression *expr) in read_expression() argument
678 if (!PARTIAL_MATCH(expr, pat)) { in read_expression()
679 ir_read_error(expr, "expected (expression <type> <operator> " in read_expression()
692 ir_read_error(expr, "invalid operator: %s", s_op->value()); in read_expression()
698 ir_read_error(expr, "expected (expression <type> %s <operand>)", in read_expression()
712 ir_read_error(expr, "expected (expression <type> %s <operand> " in read_expression()
728 ir_reader::read_swizzle(s_expression *expr) in read_swizzle() argument
734 if (!MATCH(expr, pat)) { in read_swizzle()
735 ir_read_error(expr, "expected (swiz <swizzle> <rvalue>)"); in read_swizzle()
740 ir_read_error(expr, "expected a valid swizzle; found %s", swiz->value()); in read_swizzle()
751 ir_read_error(expr, "invalid swizzle"); in read_swizzle()
757 ir_reader::read_constant(s_expression *expr) in read_constant() argument
763 if (!MATCH(expr, pat)) { in read_constant()
764 ir_read_error(expr, "expected (constant <type> (...))"); in read_constant()
773 ir_read_error(expr, "expected (constant <type> (...))"); in read_constant()
807 s_expression *expr = (s_expression*) it.get(); in read_constant() local
810 s_number *value = SX_AS_NUMBER(expr); in read_constant()
817 s_int *value = SX_AS_INT(expr); in read_constant()
853 ir_reader::read_var_ref(s_expression *expr) in read_var_ref() argument
858 if (MATCH(expr, var_pat)) { in read_var_ref()
861 ir_read_error(expr, "undeclared variable: %s", s_var->value()); in read_var_ref()
870 ir_reader::read_dereference(s_expression *expr) in read_dereference() argument
879 ir_dereference_variable *var_ref = read_var_ref(expr); in read_dereference()
882 } else if (MATCH(expr, array_pat)) { in read_dereference()
895 } else if (MATCH(expr, record_pat)) { in read_dereference()
907 ir_reader::read_texture(s_expression *expr) in read_texture() argument
929 if (MATCH(expr, tex_pattern)) { in read_texture()
931 } else if (MATCH(expr, txf_pattern)) { in read_texture()
933 } else if (MATCH(expr, txs_pattern)) { in read_texture()
935 } else if (MATCH(expr, other_pattern)) { in read_texture()