This reverts commit ab740cb5b9.
This commit is contained in:
parent
cee58ccf7f
commit
9edf719e1e
7 changed files with 127 additions and 138 deletions
|
|
@ -632,10 +632,8 @@ proc aliases*(obj, field: PNode): AliasKind =
|
|||
case currFieldPath.kind
|
||||
of nkSym:
|
||||
if currFieldPath.sym != currObjPath.sym: return no
|
||||
of nkDotExpr:
|
||||
of nkDotExpr, nkCheckedFieldExpr:
|
||||
if currFieldPath[1].sym != currObjPath[1].sym: return no
|
||||
of nkCheckedFieldExpr:
|
||||
if currFieldPath[0][1].sym != currObjPath[0][1].sym: return no
|
||||
of nkBracketExpr:
|
||||
if currFieldPath[1].kind in nkLiterals and currObjPath[1].kind in nkLiterals:
|
||||
if currFieldPath[1].intVal != currObjPath[1].intVal:
|
||||
|
|
@ -644,6 +642,19 @@ proc aliases*(obj, field: PNode): AliasKind =
|
|||
result = maybe
|
||||
else: assert false # unreachable
|
||||
|
||||
type InstrTargetKind* = enum
|
||||
None, Full, Partial
|
||||
|
||||
proc instrTargets*(insloc, loc: PNode): InstrTargetKind =
|
||||
case insloc.aliases(loc)
|
||||
of yes:
|
||||
Full # x -> x; x -> x.f
|
||||
of maybe:
|
||||
Partial # We treat this like a partial write/read
|
||||
elif loc.aliases(insloc) != no:
|
||||
Partial # x.f -> x
|
||||
else: None
|
||||
|
||||
proc isAnalysableFieldAccess*(orig: PNode; owner: PSym): bool =
|
||||
var n = orig
|
||||
while true:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue