summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorAndreas Rumpf <rumpf_a@web.de>2016-11-02 08:39:44 +0100
committerAndreas Rumpf <rumpf_a@web.de>2016-11-02 08:39:51 +0100
commita6d17b5503c6e655875807685ef437a0148c2af4 (patch)
treebce5fedfabdad4eb456d92236197f3c4a14b7edd
parent9a1c87d6bf35cd13b2e635e6a4e1136ffc1be69f (diff)
downloadNim-a6d17b5503c6e655875807685ef437a0148c2af4.tar.gz
some progress on --symbolfiles:on
-rw-r--r--compiler/cgmeth.nim5
-rw-r--r--compiler/nversion.nim2
-rw-r--r--compiler/rodwrite.nim14
3 files changed, 16 insertions, 5 deletions
diff --git a/compiler/cgmeth.nim b/compiler/cgmeth.nim
index bcf0b535b..5f0d71cc6 100644
--- a/compiler/cgmeth.nim
+++ b/compiler/cgmeth.nim
@@ -165,8 +165,9 @@ proc methodDef*(s: PSym, fromCache: bool) =
       if witness.isNil: witness = gMethods[i].methods[0]
   # create a new dispatcher:
   add(gMethods, (methods: @[s], dispatcher: createDispatcher(s)))
-  if fromCache:
-    internalError(s.info, "no method dispatcher found")
+  #echo "adding ", s.info
+  #if fromCache:
+  #  internalError(s.info, "no method dispatcher found")
   if witness != nil:
     localError(s.info, "invalid declaration order; cannot attach '" & s.name.s &
                        "' to method defined here: " & $witness.info)
diff --git a/compiler/nversion.nim b/compiler/nversion.nim
index d69e1e553..4d4fe6c95 100644
--- a/compiler/nversion.nim
+++ b/compiler/nversion.nim
@@ -13,5 +13,5 @@
 const
   MaxSetElements* = 1 shl 16  # (2^16) to support unicode character sets?
   VersionAsString* = system.NimVersion
-  RodFileVersion* = "1221"       # modify this if the rod-format changes!
+  RodFileVersion* = "1222"       # modify this if the rod-format changes!
 
diff --git a/compiler/rodwrite.nim b/compiler/rodwrite.nim
index b5d36d46d..4e8b27733 100644
--- a/compiler/rodwrite.nim
+++ b/compiler/rodwrite.nim
@@ -577,15 +577,25 @@ proc process(c: PPassContext, n: PNode): PNode =
     for i in countup(0, sonsLen(n) - 1): discard process(c, n.sons[i])
     #var s = n.sons[namePos].sym
     #addInterfaceSym(w, s)
-  of nkProcDef, nkMethodDef, nkIteratorDef, nkConverterDef,
+  of nkProcDef, nkIteratorDef, nkConverterDef,
       nkTemplateDef, nkMacroDef:
-    var s = n.sons[namePos].sym
+    let s = n.sons[namePos].sym
     if s == nil: internalError(n.info, "rodwrite.process")
     if n.sons[bodyPos] == nil:
       internalError(n.info, "rodwrite.process: body is nil")
     if n.sons[bodyPos].kind != nkEmpty or s.magic != mNone or
         sfForward notin s.flags:
       addInterfaceSym(w, s)
+  of nkMethodDef:
+    let s = n.sons[namePos].sym
+    if s == nil: internalError(n.info, "rodwrite.process")
+    if n.sons[bodyPos] == nil:
+      internalError(n.info, "rodwrite.process: body is nil")
+    if n.sons[bodyPos].kind != nkEmpty or s.magic != mNone or
+        sfForward notin s.flags:
+      pushSym(w, s)
+      processStacks(w, false)
+
   of nkVarSection, nkLetSection, nkConstSection:
     for i in countup(0, sonsLen(n) - 1):
       var a = n.sons[i]