return v;
}
-void
-ir_call::set_callee(ir_function_signature *sig)
-{
- this->callee = sig;
-}
void
visit_exec_list(exec_list *list, ir_visitor *visitor)
return callee->function_name();
}
- /**
- * Get the function signature bound to this function call
- */
- ir_function_signature *get_callee()
- {
- return callee;
- }
-
- /**
- * Set the function call target
- */
- void set_callee(ir_function_signature *sig);
-
/**
* Generates an inline version of the function before @ir,
* storing the return value in return_deref.
*/
ir_dereference_variable *return_deref;
+ /**
+ * The specific function signature being called.
+ */
+ ir_function_signature *callee;
+
/* List of ir_rvalue of paramaters passed in this call. */
exec_list actual_parameters;
/** Should this call only bind to a built-in function? */
bool use_builtin;
-
-private:
- ir_function_signature *callee;
};
* table. If it is found, replace it with the value from the table.
*/
ir_function_signature *sig =
- (ir_function_signature *) hash_table_find(this->ht, ir->get_callee());
+ (ir_function_signature *) hash_table_find(this->ht, ir->callee);
if (sig != NULL)
- ir->set_callee(sig);
+ ir->callee = sig;
/* Since this may be used before function call parameters are flattened,
* the children also need to be processed.
can_inline(ir_call *call)
{
ir_function_can_inline_visitor v;
- const ir_function_signature *callee = call->get_callee();
+ const ir_function_signature *callee = call->callee;
if (!callee->is_defined)
return false;
if (this->current == NULL)
return visit_continue;
- function *const target = this->get_function(call->get_callee());
+ function *const target = this->get_function(call->callee);
/* Create a link from the caller to the callee.
*/
ir_visitor_status
ir_validate::visit_enter(ir_call *ir)
{
- ir_function_signature *const callee = ir->get_callee();
+ ir_function_signature *const callee = ir->callee;
if (callee->ir_type != ir_type_function_signature) {
printf("IR called by ir_call is not ir_function_signature!\n");
* Doing so will modify the original shader. This may prevent that
* shader from being linkable in other programs.
*/
- const ir_function_signature *const callee = ir->get_callee();
+ const ir_function_signature *const callee = ir->callee;
assert(callee != NULL);
const char *const name = callee->function_name();
find_matching_signature(name, &callee->parameters, &linked, 1,
ir->use_builtin);
if (sig != NULL) {
- ir->set_callee(sig);
+ ir->callee = sig;
return visit_continue;
}
*/
linked_sig->accept(this);
- ir->set_callee(linked_sig);
+ ir->callee = linked_sig;
return visit_continue;
}
virtual ir_visitor_status visit_enter(ir_call *ir)
{
- exec_list_iterator sig_iter = ir->get_callee()->parameters.iterator();
+ exec_list_iterator sig_iter = ir->callee->parameters.iterator();
foreach_iter(exec_list_iterator, iter, *ir) {
ir_rvalue *param_rval = (ir_rvalue *)iter.get();
ir_variable *sig_param = (ir_variable *)sig_iter.get();
{
void *ctx = ralloc_parent(ir);
- const exec_node *formal_param_node = ir->get_callee()->parameters.head;
+ const exec_node *formal_param_node = ir->callee->parameters.head;
const exec_node *actual_param_node = ir->actual_parameters.head;
while (!actual_param_node->is_tail_sentinel()) {
ir_variable *formal_param = (ir_variable *) formal_param_node;
ir_constant_folding_visitor::visit_enter(ir_call *ir)
{
/* Attempt to constant fold parameters */
- exec_list_iterator sig_iter = ir->get_callee()->parameters.iterator();
+ exec_list_iterator sig_iter = ir->callee->parameters.iterator();
foreach_iter(exec_list_iterator, iter, *ir) {
ir_rvalue *param_rval = (ir_rvalue *)iter.get();
ir_variable *sig_param = (ir_variable *)sig_iter.get();
ir_constant_propagation_visitor::visit_enter(ir_call *ir)
{
/* Do constant propagation on call parameters, but skip any out params */
- exec_list_iterator sig_param_iter = ir->get_callee()->parameters.iterator();
+ exec_list_iterator sig_param_iter = ir->callee->parameters.iterator();
foreach_iter(exec_list_iterator, iter, ir->actual_parameters) {
ir_variable *sig_param = (ir_variable *)sig_param_iter.get();
ir_rvalue *param = (ir_rvalue *)iter.get();
ir_constant_variable_visitor::visit_enter(ir_call *ir)
{
/* Mark any out parameters as assigned to */
- exec_list_iterator sig_iter = ir->get_callee()->parameters.iterator();
+ exec_list_iterator sig_iter = ir->callee->parameters.iterator();
foreach_iter(exec_list_iterator, iter, *ir) {
ir_rvalue *param_rval = (ir_rvalue *)iter.get();
ir_variable *param = (ir_variable *)sig_iter.get();
ir_copy_propagation_visitor::visit_enter(ir_call *ir)
{
/* Do copy propagation on call parameters, but skip any out params */
- exec_list_iterator sig_param_iter = ir->get_callee()->parameters.iterator();
+ exec_list_iterator sig_param_iter = ir->callee->parameters.iterator();
foreach_iter(exec_list_iterator, iter, ir->actual_parameters) {
ir_variable *sig_param = (ir_variable *)sig_param_iter.get();
ir_instruction *ir = (ir_instruction *)iter.get();
ir_copy_propagation_elements_visitor::visit_enter(ir_call *ir)
{
/* Do copy propagation on call parameters, but skip any out params */
- exec_list_iterator sig_param_iter = ir->get_callee()->parameters.iterator();
+ exec_list_iterator sig_param_iter = ir->callee->parameters.iterator();
foreach_iter(exec_list_iterator, iter, ir->actual_parameters) {
ir_variable *sig_param = (ir_variable *)sig_param_iter.get();
ir_instruction *ir = (ir_instruction *)iter.get();
ir_visitor_status
ir_dead_functions_visitor::visit_enter(ir_call *ir)
{
- signature_entry *entry = this->get_signature_entry(ir->get_callee());
+ signature_entry *entry = this->get_signature_entry(ir->callee);
entry->used = true;
ir_visitor_status
ir_tree_grafting_visitor::visit_enter(ir_call *ir)
{
- exec_list_iterator sig_iter = ir->get_callee()->parameters.iterator();
+ exec_list_iterator sig_iter = ir->callee->parameters.iterator();
/* Reminder: iterating ir_call iterates its parameters. */
foreach_iter(exec_list_iterator, iter, *ir) {
ir_variable *sig_param = (ir_variable *)sig_iter.get();
ir_to_mesa_visitor::visit(ir_call *ir)
{
ir_to_mesa_instruction *call_inst;
- ir_function_signature *sig = ir->get_callee();
+ ir_function_signature *sig = ir->callee;
function_entry *entry = get_function_signature(sig);
int i;
glsl_to_tgsi_visitor::visit(ir_call *ir)
{
glsl_to_tgsi_instruction *call_inst;
- ir_function_signature *sig = ir->get_callee();
+ ir_function_signature *sig = ir->callee;
function_entry *entry = get_function_signature(sig);
int i;