some varargs handling

This commit is contained in:
araq
2023-10-01 01:28:19 +02:00
parent 42ebed76e6
commit 284bbe2eb7
2 changed files with 5 additions and 0 deletions

View File

@@ -180,6 +180,9 @@ proc addNominalType*(tree: var TypeGraph; kind: NirTypeKind; name: string) =
assert kind in {ObjectTy, UnionTy}
tree.nodes.add TypeNode(x: toX(kind, tree.names.getOrIncl(name)))
proc addVarargs*(tree: var TypeGraph) =
tree.nodes.add TypeNode(x: toX(VarargsTy, 0'u32))
proc getFloat128Type*(tree: var TypeGraph): TypeId =
result = TypeId tree.nodes.len
tree.nodes.add TypeNode(x: toX(FloatTy, 128'u32))

View File

@@ -101,6 +101,8 @@ proc procToIr(c: var Context; t: PType): TypeId =
# XXX Add Calling convention here!
for i in 0..<t.len:
c.g.addType fieldTypes[i]
if tfVarargs in t.flags:
c.g.addVarargs()
result = sealType(c.g, obj)
proc nativeInt(c: Context): TypeId =