aboutsummaryrefslogtreecommitdiff
path: root/src/main/stanza/ir-utils.stanza
diff options
context:
space:
mode:
authorazidar2016-01-14 15:00:33 -0800
committerazidar2016-01-16 14:28:18 -0800
commit03cf32b5e17eb306e8fe681ef245b5f528306e61 (patch)
tree4ed02def04e2c6a8287a972c51ec4cba24a9c8f5 /src/main/stanza/ir-utils.stanza
parentaf593edd19d763a4399f4bc38109d2f904ffb8c2 (diff)
Sped up some passes. Added global mname to allow easy per-module hashes for accellerating functions
Diffstat (limited to 'src/main/stanza/ir-utils.stanza')
-rw-r--r--src/main/stanza/ir-utils.stanza7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/main/stanza/ir-utils.stanza b/src/main/stanza/ir-utils.stanza
index 00b573a6..14383977 100644
--- a/src/main/stanza/ir-utils.stanza
+++ b/src/main/stanza/ir-utils.stanza
@@ -131,12 +131,17 @@ public defn children (e:Expression) -> List<Expression> :
map(f,e)
to-list(es)
+public var mname : Symbol = `blah
public defn exp-hash (e:Expression) -> Int :
turn-off-debug(false)
- val i = symbol-hash(to-symbol(to-string(e)))
+ val i = symbol-hash(to-symbol(string-join(map(to-string,list(mname `.... e)))))
+ ;val i = symbol-hash(to-symbol(to-string(e)))
turn-on-debug(false)
i
+public defn type-hash (t:Type) -> Int :
+ symbol-hash(to-symbol(to-string(t)))
+
;============= Useful functions ==============
public defn create-mask (n:Symbol,dt:Type) -> Field :
Field{n,DEFAULT,_} $ match(dt) :