*/
if (signature == NULL) {
signature = new ir_function_signature(return_type);
- f->signatures.push_tail(signature);
+ f->add_signature(signature);
} else {
/* Destroy all of the previous parameter information. The previous
* parameter information comes from the function prototype, and it can
ir_variable *declarations[17];
ir_function_signature *const sig = new ir_function_signature(type);
- f->signatures.push_tail(sig);
+ f->add_signature(sig);
ir_label *const label = new ir_label(name);
instructions->push_tail(label);
assert(added);
ir_function_signature *const sig = new ir_function_signature(this);
- f->signatures.push_tail(sig);
+ f->add_signature(sig);
for (unsigned i = 0; i < length; i++) {
char *const param_name = (char *) malloc(10);
* appropriate from-scalars constructor.
*/
ir_function_signature *const sig = new ir_function_signature(& types[i]);
- f->signatures.push_tail(sig);
+ f->add_signature(sig);
sig->definition =
generate_constructor_intro(& types[i], 1, & sig->parameters,
ir_function_signature *const vec_sig =
new ir_function_signature(& types[i]);
- f->signatures.push_tail(vec_sig);
+ f->add_signature(vec_sig);
vec_sig->definition =
generate_constructor_intro(& types[i], types[i].vector_elements,
ir_function_signature *const mat_sig =
new ir_function_signature(& types[i]);
- f->signatures.push_tail(mat_sig);
+ f->add_signature(mat_sig);
mat_sig->definition =
generate_constructor_intro(& types[i],
* Pointer to the label that begins the function definition.
*/
ir_label *definition;
+
+private:
+ /** Function of which this signature is one overload. */
+ class ir_function *function;
+
+ friend class ir_function;
};
v->visit(this);
}
+ void add_signature(ir_function_signature *sig)
+ {
+ sig->function = this;
+ signatures.push_tail(sig);
+ }
+
/**
* Find a signature that matches a set of actual parameters.
*/