diff --git a/compiler/nir/nirtypes.nim b/compiler/nir/nirtypes.nim index 35883e3e39..d6c876d394 100644 --- a/compiler/nir/nirtypes.nim +++ b/compiler/nir/nirtypes.nim @@ -190,14 +190,25 @@ proc getFloat128Type*(tree: var TypeGraph): TypeId = proc addBuiltinType*(g: var TypeGraph; id: TypeId) = g.nodes.add g[id] +template firstSon(n: TypeId): TypeId = TypeId(n.int+1) + proc addType*(g: var TypeGraph; t: TypeId) = - let pos = t.int - let L = span(g, pos) - let d = g.nodes.len - g.nodes.setLen(d + L) - assert L > 0 - for i in 0.. 0 + for i in 0..