diff options
author | Juan M Gómez <info@jmgomez.me> | 2023-09-09 09:34:20 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-09-09 10:34:20 +0200 |
commit | e6ca13ec857dc065ebf3297129cc1538d4698f87 (patch) | |
tree | 1558f221071299fae8082ba23d069719c0c9aead /compiler/ic/ic.nim | |
parent | 5f13e15e0a6f90c462a71cd30addc677f688c4dc (diff) | |
download | Nim-e6ca13ec857dc065ebf3297129cc1538d4698f87.tar.gz |
Instantiates generics in the module that uses it (#22513)
Attempts to move the generic instantiation to the module that uses it. This should decrease re-compilation times as the source module where the generic lives doesnt need to be recompiled --------- Co-authored-by: ringabout <43030857+ringabout@users.noreply.github.com> Co-authored-by: Andreas Rumpf <rumpf_a@web.de>
Diffstat (limited to 'compiler/ic/ic.nim')
-rw-r--r-- | compiler/ic/ic.nim | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/compiler/ic/ic.nim b/compiler/ic/ic.nim index 845e3d1fa..8b0a31054 100644 --- a/compiler/ic/ic.nim +++ b/compiler/ic/ic.nim @@ -413,6 +413,7 @@ proc storeSym*(s: PSym; c: var PackedEncoder; m: var PackedModule): PackedItemId p.annex = toPackedLib(s.annex, c, m) when hasFFI: p.cname = toLitId(s.cname, m) + p.instantiatedFrom = s.instantiatedFrom.safeItemId(c, m) # fill the reserved slot, nothing else: m.syms[s.itemId.item] = p @@ -876,6 +877,7 @@ proc symBodyFromPacked(c: var PackedDecoder; g: var PackedModuleGraph; if externalName != "": result.loc.r = rope externalName result.loc.flags = s.locFlags + result.instantiatedFrom = loadSym(c, g, si, s.instantiatedFrom) proc loadSym(c: var PackedDecoder; g: var PackedModuleGraph; thisModule: int; s: PackedItemId): PSym = if s == nilItemId: |