second attempt to fix code gen for pegs.nim

This commit is contained in:
Araq
2011-06-26 23:55:47 +02:00
parent aa14667ca1
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) =
var a: TLoc
if mapType(e.sons[0].typ) == ctArray and
skipTypes(e.sons[0].typ.sons[0], abstractInst).kind != tySet:
if mapType(e.sons[0].typ) == ctArray:
# XXX the amount of hacks for C's arrays is incredible, maybe we should
# simply wrap them in a struct? --> Losing auto vectorization then?
expr(p, e.sons[0], d)

View File

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