implemented mixed mode codegen

This commit is contained in:
Araq 2014-10-03 01:21:35 +02:00
commit e65c296bcc
15 changed files with 133 additions and 95 deletions

View file

@ -103,9 +103,9 @@ proc openArrayLoc(p: BProc, n: PNode): PRope =
result = ropef("$1, $1Len0", [rdLoc(a)])
of tyString, tySequence:
if skipTypes(n.typ, abstractInst).kind == tyVar:
result = ropef("(*$1)->data, (*$1)->$2", [a.rdLoc, lenField()])
result = ropef("(*$1)->data, (*$1)->$2", [a.rdLoc, lenField(p)])
else:
result = ropef("$1->data, $1->$2", [a.rdLoc, lenField()])
result = ropef("$1->data, $1->$2", [a.rdLoc, lenField(p)])
of tyArray, tyArrayConstr:
result = ropef("$1, $2", [rdLoc(a), toRope(lengthOrd(a.t))])
else: internalError("openArrayLoc: " & typeToString(a.t))