From 471471f83471481db0445e73f8c89e6a9149838e Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Thu, 11 Mar 2010 14:50:30 -0800 Subject: Initial pass at resolving function calls The code is still really rough and *REALLY* incomplete. This at least passes the first few trivially simple test cases. --- ir.h | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) (limited to 'ir.h') diff --git a/ir.h b/ir.h index 136b45b72b..5acf611e74 100644 --- a/ir.h +++ b/ir.h @@ -160,11 +160,19 @@ public: v->visit(this); } + /** + * Find a signature that matches a set of actual parameters. + */ + const ir_function_signature *matching_signature(exec_list *actual_param); + /** * Name of the function. */ const char *name; + /** + * Set of overloaded functions with this name. + */ struct exec_list signatures; }; /*@}*/ @@ -283,10 +291,10 @@ public: */ class ir_call : public ir_instruction { public: - ir_call() - : ir_instruction(ir_op_call), callee(NULL) + ir_call(const ir_function_signature *callee, exec_list *actual_parameters) + : ir_instruction(ir_op_call), callee(callee) { - /* empty */ + actual_parameters->move_nodes_to(& this->actual_parameters); } virtual void accept(ir_visitor *v) @@ -300,7 +308,13 @@ public: static ir_call *get_error_instruction(); private: - ir_function_signature *callee; + ir_call() + : ir_instruction(ir_op_call), callee(NULL) + { + /* empty */ + } + + const ir_function_signature *callee; exec_list actual_parameters; }; -- cgit v1.2.3