[Mesa-dev] [PATCH v2 3/7] nir: constify instruction comparison functions
Connor Abbott
cwabbott0 at gmail.com
Wed Sep 30 08:11:58 PDT 2015
v2: rebase, don't constify nir_srcs_equal() as it's pass-by-value
anyways
Signed-off-by: Connor Abbott <cwabbott0 at gmail.com>
---
src/glsl/nir/nir_instr_set.c | 6 +++---
src/glsl/nir/nir_instr_set.h | 2 +-
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/src/glsl/nir/nir_instr_set.c b/src/glsl/nir/nir_instr_set.c
index b397442..72ab048 100644
--- a/src/glsl/nir/nir_instr_set.c
+++ b/src/glsl/nir/nir_instr_set.c
@@ -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;
diff --git a/src/glsl/nir/nir_instr_set.h b/src/glsl/nir/nir_instr_set.h
index 531bdad..f5baffa 100644
--- a/src/glsl/nir/nir_instr_set.h
+++ b/src/glsl/nir/nir_instr_set.h
@@ -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);
--
2.1.0
More information about the mesa-dev
mailing list