refactoring: TLoc knows the node it originated from; it is planned to use this to produce better C code (move optimizations)

This commit is contained in:
Andreas Rumpf 2017-09-21 14:38:45 +02:00
commit 405b9c8a85
8 changed files with 215 additions and 196 deletions

View file

@ -181,10 +181,11 @@ proc encodeLoc(w: PRodWriter, loc: TLoc, result: var string) =
if loc.flags != {}:
add(result, '$')
encodeVInt(cast[int32](loc.flags), result)
if loc.t != nil:
if loc.lode != nil:
add(result, '^')
encodeVInt(cast[int32](loc.t.id), result)
pushType(w, loc.t)
encodeNode(w, unknownLineInfo(), loc.lode, result)
#encodeVInt(cast[int32](loc.t.id), result)
#pushType(w, loc.t)
if loc.r != nil:
add(result, '!')
encodeStr($loc.r, result)