second attempt to fix code gen for pegs.nim

This commit is contained in:
Araq 2011-06-26 23:55:47 +02:00
commit 3e91b456e5
2 changed files with 1 additions and 5 deletions

View file

@ -499,8 +499,7 @@ proc unaryArith(p: BProc, e: PNode, d: var TLoc, op: TMagic) =
proc genDeref(p: BProc, e: PNode, d: var TLoc) = proc genDeref(p: BProc, e: PNode, d: var TLoc) =
var a: TLoc var a: TLoc
if mapType(e.sons[0].typ) == ctArray and if mapType(e.sons[0].typ) == ctArray:
skipTypes(e.sons[0].typ.sons[0], abstractInst).kind != tySet:
# XXX the amount of hacks for C's arrays is incredible, maybe we should # XXX the amount of hacks for C's arrays is incredible, maybe we should
# simply wrap them in a struct? --> Losing auto vectorization then? # simply wrap them in a struct? --> Losing auto vectorization then?
expr(p, e.sons[0], d) expr(p, e.sons[0], d)

View file

@ -94,9 +94,6 @@ proc mapType(typ: PType): TCTypeKind =
var base = skipTypes(typ.sons[0], abstractInst) var base = skipTypes(typ.sons[0], abstractInst)
case base.kind case base.kind
of tyOpenArray, tyArrayConstr, tyArray: result = ctArray of tyOpenArray, tyArrayConstr, tyArray: result = ctArray
of tySet:
result = mapSetType(base)
if result != ctArray: result = ctPtr
else: result = ctPtr else: result = ctPtr
of tyPointer: result = ctPtr of tyPointer: result = ctPtr
of tySequence: result = ctNimSeq of tySequence: result = ctNimSeq