From aa1341dd4a881caa579aa161fe991190f1671302 Mon Sep 17 00:00:00 2001 From: Michael Beck Date: Wed, 23 Jul 2008 15:10:26 +0000 Subject: [PATCH] do NOT overwrite custom hash function [r20630] --- ir/ir/iropt.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/ir/ir/iropt.c b/ir/ir/iropt.c index 907a8fe96..7603a490b 100644 --- a/ir/ir/iropt.c +++ b/ir/ir/iropt.c @@ -6205,11 +6205,15 @@ static ir_op_ops *firm_set_default_hash(ir_opcode code, ir_op_ops *ops) ops->hash = hash_##a; \ break + /* hash function already set */ + if (ops->hash != NULL) + return ops; + switch (code) { CASE(Const); CASE(SymConst); default: - /* use input/mode default hash */ + /* use input/mode default hash if no function was given */ ops->hash = firm_default_hash; } -- 2.20.1