some progress on destructors for builtin seqs
This commit is contained in:
parent
696c0c48c7
commit
ddaf2e3805
2 changed files with 6 additions and 2 deletions
|
|
@ -65,7 +65,8 @@ proc genLiteral(p: BProc, n: PNode, ty: PType): Rope =
|
||||||
of tyString:
|
of tyString:
|
||||||
# with the new semantics for 'nil' strings, we can map "" to nil and
|
# with the new semantics for 'nil' strings, we can map "" to nil and
|
||||||
# save tons of allocations:
|
# save tons of allocations:
|
||||||
if n.strVal.len == 0 and optNilSeqs notin p.options:
|
if n.strVal.len == 0 and optNilSeqs notin p.options and
|
||||||
|
p.config.selectedGc != gcDestructors:
|
||||||
result = genNilStringLiteral(p.module, n.info)
|
result = genNilStringLiteral(p.module, n.info)
|
||||||
else:
|
else:
|
||||||
result = genStringLiteral(p.module, n)
|
result = genStringLiteral(p.module, n)
|
||||||
|
|
|
||||||
|
|
@ -795,7 +795,9 @@ proc afterCallActions(c: PContext; n, orig: PNode, flags: TExprFlags): PNode =
|
||||||
analyseIfAddressTakenInCall(c, result)
|
analyseIfAddressTakenInCall(c, result)
|
||||||
if callee.magic != mNone:
|
if callee.magic != mNone:
|
||||||
result = magicsAfterOverloadResolution(c, result, flags)
|
result = magicsAfterOverloadResolution(c, result, flags)
|
||||||
if result.typ != nil: liftTypeBoundOps(c, result.typ, n.info)
|
if result.typ != nil and
|
||||||
|
not (result.typ.kind == tySequence and result.typ.sons[0].kind == tyEmpty):
|
||||||
|
liftTypeBoundOps(c, result.typ, n.info)
|
||||||
#result = patchResolvedTypeBoundOp(c, result)
|
#result = patchResolvedTypeBoundOp(c, result)
|
||||||
if c.matchedConcept == nil:
|
if c.matchedConcept == nil:
|
||||||
result = evalAtCompileTime(c, result)
|
result = evalAtCompileTime(c, result)
|
||||||
|
|
@ -1560,6 +1562,7 @@ proc semAsgn(c: PContext, n: PNode; mode=asgnNormal): PNode =
|
||||||
|
|
||||||
n.sons[1] = fitNode(c, le, rhs, n.info)
|
n.sons[1] = fitNode(c, le, rhs, n.info)
|
||||||
liftTypeBoundOps(c, lhs.typ, lhs.info)
|
liftTypeBoundOps(c, lhs.typ, lhs.info)
|
||||||
|
#liftTypeBoundOps(c, n.sons[0].typ, n.sons[0].info)
|
||||||
|
|
||||||
fixAbstractType(c, n)
|
fixAbstractType(c, n)
|
||||||
asgnToResultVar(c, n, n.sons[0], n.sons[1])
|
asgnToResultVar(c, n, n.sons[0], n.sons[1])
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue