parent
881fa94b57
commit
b3029ba213
1 changed files with 6 additions and 7 deletions
|
|
@ -268,19 +268,18 @@ proc ccgIntroducedPtr(conf: ConfigRef; s: PSym, retType: PType): bool =
|
||||||
result = true
|
result = true
|
||||||
elif (optByRef in s.options) or (getSize(conf, pt) > conf.target.floatSize * 3):
|
elif (optByRef in s.options) or (getSize(conf, pt) > conf.target.floatSize * 3):
|
||||||
result = true # requested anyway
|
result = true # requested anyway
|
||||||
elif retType != nil and retType.kind == tyLent:
|
|
||||||
result = true
|
|
||||||
elif (tfFinal in pt.flags) and (pt[0] == nil):
|
elif (tfFinal in pt.flags) and (pt[0] == nil):
|
||||||
result = false # no need, because no subtyping possible
|
result = false # no need, because no subtyping possible
|
||||||
else:
|
else:
|
||||||
result = true # ordinary objects are always passed by reference,
|
result = true # ordinary objects are always passed by reference,
|
||||||
# otherwise casting doesn't work
|
# otherwise casting doesn't work
|
||||||
of tyTuple:
|
of tyTuple:
|
||||||
if retType != nil and retType.kind == tyLent:
|
result = (getSize(conf, pt) > conf.target.floatSize*3) or (optByRef in s.options)
|
||||||
result = true
|
else:
|
||||||
else:
|
result = false
|
||||||
result = (getSize(conf, pt) > conf.target.floatSize*3) or (optByRef in s.options)
|
# first parameter and return type is 'lent T'? --> use pass by pointer
|
||||||
else: result = false
|
if s.position == 0 and retType != nil and retType.kind == tyLent:
|
||||||
|
result = true
|
||||||
|
|
||||||
proc fillResult(conf: ConfigRef; param: PNode) =
|
proc fillResult(conf: ConfigRef; param: PNode) =
|
||||||
fillLoc(param.sym.loc, locParam, param, ~"Result",
|
fillLoc(param.sym.loc, locParam, param, ~"Result",
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue