_function(NULL)
{
this->ir_type = ir_type_function_signature;
- this->is_builtin = builtin_info != NULL;
this->origin = NULL;
}
+bool
+ir_function_signature::is_builtin() const
+{
+ return builtin_info != NULL;
+}
+
+
static bool
modes_match(unsigned a, unsigned b)
{
{
foreach_list(n, &this->signatures) {
ir_function_signature *const sig = (ir_function_signature *) n;
- if (!sig->is_builtin)
+ if (!sig->is_builtin())
return true;
}
return false;
unsigned is_defined:1;
/** Whether or not this function signature is a built-in. */
- unsigned is_builtin:1;
+ bool is_builtin() const;
/** Body of instructions in the function. */
struct exec_list body;
ir_type = ir_type_call;
assert(callee->return_type != NULL);
actual_parameters->move_nodes_to(& this->actual_parameters);
- this->use_builtin = callee->is_builtin;
+ this->use_builtin = callee->is_builtin();
}
virtual ir_call *clone(void *mem_ctx, struct hash_table *ht) const;
new(mem_ctx) ir_function_signature(this->return_type);
copy->is_defined = false;
- copy->is_builtin = this->is_builtin;
copy->builtin_info = this->builtin_info;
copy->origin = this;
* "Function calls to user-defined functions (non-built-in functions)
* cannot be used to form constant expressions."
*/
- if (!this->is_builtin)
+ if (!this->is_builtin())
return NULL;
/*
f->exact_matching_signature(&callee->parameters);
if ((linked_sig == NULL)
|| ((linked_sig != NULL)
- && (linked_sig->is_builtin != ir->use_builtin))) {
+ && (linked_sig->is_builtin() != ir->use_builtin))) {
linked_sig = new(linked) ir_function_signature(callee->return_type);
f->add_signature(linked_sig);
}
* signature that we found isn't a built-in, keep looking. Also keep
* looking if we expect a non-built-in but found a built-in.
*/
- if (use_builtin != sig->is_builtin)
+ if (use_builtin != sig->is_builtin())
continue;
return sig;
ir_function_signature *sig =
(ir_function_signature *) iter.get();
- if (!sig->is_defined || sig->is_builtin)
+ if (!sig->is_defined || sig->is_builtin())
continue;
ir_function_signature *other_sig =
other->exact_matching_signature(& sig->parameters);
if ((other_sig != NULL) && other_sig->is_defined
- && !other_sig->is_builtin) {
+ && !other_sig->is_builtin()) {
linker_error(prog, "function `%s' is multiply defined",
f->name);
return NULL;