nir/spirv: Add a missing break statement
[mesa.git] / src / glsl / opt_function_inlining.cpp
index b84bb8e11bb7f1e8e3c24f7b1d8575abe2ae799b..84a9e4fa0933d910bea5da697e272ea9e1af5b53 100644 (file)
@@ -100,16 +100,13 @@ ir_call::generate_inline(ir_instruction *next_ir)
 {
    void *ctx = ralloc_parent(this);
    ir_variable **parameters;
-   int num_parameters;
+   unsigned num_parameters;
    int i;
    struct hash_table *ht;
 
    ht = hash_table_ctor(0, hash_table_pointer_hash, hash_table_pointer_compare);
 
-   num_parameters = 0;
-   foreach_in_list(ir_rvalue, param, &this->callee->parameters)
-      num_parameters++;
-
+   num_parameters = this->callee->parameters.length();
    parameters = new ir_variable *[num_parameters];
 
    /* Generate the declarations for the parameters to our inlined code,
@@ -133,7 +130,7 @@ ir_call::generate_inline(ir_instruction *next_ir)
         parameters[i] = sig_param->clone(ctx, ht);
         parameters[i]->data.mode = ir_var_auto;
 
-        /* Remove the read-only decoration becuase we're going to write
+        /* Remove the read-only decoration because we're going to write
          * directly to this variable.  If the cloned variable is left
          * read-only and the inlined function is inside a loop, the loop
          * analysis code will get confused.