diff options
author | Andreas Rumpf <rumpf_a@web.de> | 2017-09-21 14:38:45 +0200 |
---|---|---|
committer | Andreas Rumpf <rumpf_a@web.de> | 2017-09-21 14:38:45 +0200 |
commit | 405b9c8a8535563f337e23dfbab8453738816b96 (patch) | |
tree | 4fc99613eb027d421cb6cc7e56f00e6a56c51156 /compiler/ast.nim | |
parent | a04c7d8b38fd0027c2562dbd1401bf6ee7b909e4 (diff) | |
download | Nim-405b9c8a8535563f337e23dfbab8453738816b96.tar.gz |
refactoring: TLoc knows the node it originated from; it is planned to use this to produce better C code (move optimizations)
Diffstat (limited to 'compiler/ast.nim')
-rw-r--r-- | compiler/ast.nim | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/compiler/ast.nim b/compiler/ast.nim index 2b1871bb8..5a99e0c82 100644 --- a/compiler/ast.nim +++ b/compiler/ast.nim @@ -755,7 +755,7 @@ type k*: TLocKind # kind of location storage*: TStorageLoc flags*: TLocFlags # location's flags - t*: PType # type of location + lode*: PNode # Node where the location came from; can be faked r*: Rope # rope value of location (code generators) # ---------------- end of backend information ------------------------------ @@ -1264,9 +1264,8 @@ proc mergeLoc(a: var TLoc, b: TLoc) = if a.k == low(a.k): a.k = b.k if a.storage == low(a.storage): a.storage = b.storage a.flags = a.flags + b.flags - if a.t == nil: a.t = b.t + if a.lode == nil: a.lode = b.lode if a.r == nil: a.r = b.r - #if a.a == 0: a.a = b.a proc newSons*(father: PNode, length: int) = if isNil(father.sons): |