second attempt to fix code gen for pegs.nim
This commit is contained in:
parent
aa14667ca1
commit
3e91b456e5
2 changed files with 1 additions and 5 deletions
|
|
@ -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)
|
||||||
|
|
|
||||||
|
|
@ -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
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue