nir: constify instruction comparison functions
authorConnor Abbott <cwabbott0@gmail.com>
Thu, 24 Sep 2015 05:05:15 +0000 (01:05 -0400)
committerConnor Abbott <cwabbott0@gmail.com>
Fri, 9 Oct 2015 14:14:28 +0000 (10:14 -0400)
v2: rebase, don't constify nir_srcs_equal() as it's pass-by-value
anyways

Reviewed-by: Jason Ekstrand <jason.ekstrand@intel.com>
Signed-off-by: Connor Abbott <cwabbott0@gmail.com>
src/glsl/nir/nir_instr_set.c
src/glsl/nir/nir_instr_set.h

index b397442fbe596d274283c31f576a2b5c856f0eeb..72ab04895f6c1c67dd357dd99bc11f5d4183dc4a 100644 (file)
@@ -51,8 +51,8 @@ nir_srcs_equal(nir_src src1, nir_src src2)
 }
 
 static bool
-nir_alu_srcs_equal(nir_alu_instr *alu1, nir_alu_instr *alu2, unsigned src1,
-                   unsigned src2)
+nir_alu_srcs_equal(const nir_alu_instr *alu1, const nir_alu_instr *alu2,
+                   unsigned src1, unsigned src2)
 {
    if (alu1->src[src1].abs != alu2->src[src2].abs ||
        alu1->src[src1].negate != alu2->src[src2].negate)
@@ -67,7 +67,7 @@ nir_alu_srcs_equal(nir_alu_instr *alu1, nir_alu_instr *alu2, unsigned src1,
 }
 
 bool
-nir_instrs_equal(nir_instr *instr1, nir_instr *instr2)
+nir_instrs_equal(const nir_instr *instr1, const nir_instr *instr2)
 {
    if (instr1->type != instr2->type)
       return false;
index 531bdade319c22fcf89ed3d4b6b6ab022f106e16..f5baffacb0eb6ff4d15539481dff0a99b7a4c028 100644 (file)
@@ -25,5 +25,5 @@
 
 #include "nir.h"
 
-bool nir_instrs_equal(nir_instr *instr1, nir_instr *instr2);
+bool nir_instrs_equal(const nir_instr *instr1, const nir_instr *instr2);