glsl: Split code to generate an ir_call out from match_function_by_name.
authorKenneth Graunke <kenneth@whitecape.org>
Wed, 9 Nov 2011 11:01:54 +0000 (03:01 -0800)
committerKenneth Graunke <kenneth@whitecape.org>
Tue, 15 Nov 2011 01:18:03 +0000 (17:18 -0800)
commitcdc94082664c329e6c55cf6053893360946275bf
tree3886b620ac3f82bba0dd1c07ea5d5706d4ea820d
parent861d0a5e12b1baa31211cb8aff983b8fb9b97482
glsl: Split code to generate an ir_call out from match_function_by_name.

match_function_by_name performs two fairly separate tasks:
1. Hunt down the appropriate ir_function_signature for the callee.
2. Generate the actual ir_call (assuming we found the callee).

Both of these are complicated.  The first has to handle exact/inexact
matches, lazy importing of built-in prototypes, different scoping rules
for 1.10, 1.20+, and ES.  Not to mention printing a user-friendly error
message with pretty-printed "maybe you meant this" candidate signatures.

The second has to deal with void/non-void functions, pre-call implicit
conversions for "in" parmeters, and post-call "out" call conversions.

Trying to do both in one function is just too unwieldy.  Time to split.

This patch purely moves the code to generate an ir_call into a separate
function and reindents it.  Otherwise, the code is identical.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
src/glsl/ast_function.cpp