<div dir="auto"><div><br><div class="gmail_extra"><br><div class="gmail_quote">On Jul 30, 2017 5:38 PM, "Timothy Arceri" <<a href="mailto:tarceri@itsqueeze.com">tarceri@itsqueeze.com</a>> wrote:<br type="attribution"><blockquote class="quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Also add a comment that this should only be used by the ir_reader<br>
interface for testing purposes.<br>
---<br>
 src/compiler/glsl/ir.cpp |  8 ++++++--<br>
 src/compiler/glsl/ir.h   | 14 +++-----------<br>
 2 files changed, 9 insertions(+), 13 deletions(-)<br>
<br>
diff --git a/src/compiler/glsl/ir.cpp b/src/compiler/glsl/ir.cpp<br>
index d501e19c01..750582e40e 100644<br>
--- a/src/compiler/glsl/ir.cpp<br>
+++ b/src/compiler/glsl/ir.cpp<br>
@@ -549,38 +549,42 @@ ir_expression::ir_expression(<wbr>int op, ir_rvalue *op0, ir_rvalue *op1,<br>
    case ir_triop_csel:<br>
       this->type = op1->type;<br>
       break;<br>
<br>
    default:<br>
       assert(!"not reached: missing automatic type setup for ir_expression");<br>
       this->type = glsl_type::float_type;<br>
    }<br>
 }<br>
<br>
-unsigned int<br>
+/**<br>
+ * This is only here for ir_reader to used for testing purposes please use<br>
+ * the precomputed num_operands field if you need the number of operands.<br>
+ */<br>
+unsigned<br>
 ir_expression::get_num_<wbr>operands(ir_expression_<wbr>operation op)<br>
 {<br>
    assert(op <= ir_last_opcode);<br>
<br>
    if (op <= ir_last_unop)<br>
       return 1;<br>
<br>
    if (op <= ir_last_binop)<br>
       return 2;<br>
<br>
    if (op <= ir_last_triop)<br>
       return 3;<br>
<br>
    if (op <= ir_last_quadop)<br>
       return 4;<br>
<br>
-   assert(false);<br>
+   assert("!could not calculate number of operands");<br></blockquote></div></div></div><div dir="auto"><br></div><div dir="auto">Assert(!"...")</div><div dir="auto"><br></div><div dir="auto"><div class="gmail_extra"><div class="gmail_quote"><blockquote class="quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
    return 0;<br>
 }<br>
<br>
 #include "ir_expression_operation_<wbr>strings.h"<br>
<br>
 const char*<br>
 depth_layout_string(ir_depth_<wbr>layout layout)<br>
 {<br>
    switch(layout) {<br>
    case ir_depth_layout_none:      return "";<br>
diff --git a/src/compiler/glsl/ir.h b/src/compiler/glsl/ir.h<br>
index 377e03657d..70b5716965 100644<br>
--- a/src/compiler/glsl/ir.h<br>
+++ b/src/compiler/glsl/ir.h<br>
@@ -1531,32 +1531,24 @@ public:<br>
     * The "variable_context" hash table links ir_variable * to ir_constant *<br>
     * that represent the variables' values.  \c NULL represents an empty<br>
     * context.<br>
     *<br>
     * If the expression cannot be constant folded, this method will return<br>
     * \c NULL.<br>
     */<br>
    virtual ir_constant *constant_expression_value(<wbr>struct hash_table *variable_context = NULL);<br>
<br>
    /**<br>
-    * Determine the number of operands used by an expression<br>
+    * This is only here for ir_reader to used for testing purposes please use<br>
+    * the precomputed num_operands field if you need the number of operands.<br>
     */<br>
-   static unsigned int get_num_operands(ir_<wbr>expression_operation);<br>
-<br>
-   /**<br>
-    * Determine the number of operands used by an expression<br>
-    */<br>
-   unsigned int get_num_operands() const<br>
-   {<br>
-      return (this->operation == ir_quadop_vector)<br>
-        ? this->type->vector_elements : get_num_operands(operation);<br>
-   }<br>
+   static unsigned get_num_operands(ir_<wbr>expression_operation);<br>
<br>
    /**<br>
     * Return whether the expression operates on vectors horizontally.<br>
     */<br>
    bool is_horizontal() const<br>
    {<br>
       return operation == ir_binop_all_equal ||<br>
              operation == ir_binop_any_nequal ||<br>
              operation == ir_binop_dot ||<br>
              operation == ir_binop_vector_extract ||<br>
<font color="#888888">--<br>
2.13.3<br>
<br>
______________________________<wbr>_________________<br>
mesa-dev mailing list<br>
<a href="mailto:mesa-dev@lists.freedesktop.org">mesa-dev@lists.freedesktop.org</a><br>
<a href="https://lists.freedesktop.org/mailman/listinfo/mesa-dev" rel="noreferrer" target="_blank">https://lists.freedesktop.org/<wbr>mailman/listinfo/mesa-dev</a><br>
</font></blockquote></div><br></div></div></div>