summary refs log tree commit diff stats
path: root/lib
diff options
context:
space:
mode:
authorcooldome <cdome@bk.ru>2018-10-18 19:21:25 +0100
committerAndreas Rumpf <rumpf_a@web.de>2018-10-18 20:21:25 +0200
commiteaca5be9d6e205e8aa7055306122a6c053ef35a6 (patch)
tree784c5f2726a94b656e3f85ab231c4dfc377cc167 /lib
parent15dbd973dec848f1c429fe7043e53254a501812b (diff)
downloadNim-eaca5be9d6e205e8aa7055306122a6c053ef35a6.tar.gz
Change the order of compilation passes, transformation is made lazy at code gen (#8489)
* Ast no transformation
* Add getImplNoTransform to the macros module
* progress on delaying transf
* Fix methods tranformation
* Fix lazy lambdalifting
* fix create thread wrapper
* transform for lambda lifting
* improve getImplTransformed
* Fix destructor tests
* try to fix nimprof for linux
Diffstat (limited to 'lib')
-rw-r--r--lib/core/macros.nim4
-rw-r--r--lib/pure/nimprof.nim8
2 files changed, 8 insertions, 4 deletions
diff --git a/lib/core/macros.nim b/lib/core/macros.nim
index 79195966e..3801adfc5 100644
--- a/lib/core/macros.nim
+++ b/lib/core/macros.nim
@@ -252,6 +252,10 @@ else: # bootstrapping substitute
     else:
       n.strValOld
 
+when defined(nimSymImplTransform):
+  proc getImplTransformed*(symbol: NimNode): NimNode {.magic: "GetImplTransf", noSideEffect.}
+    ## for a typed proc returns the AST after transformation pass
+
 when defined(nimHasSymOwnerInMacro):
   proc owner*(sym: NimNode): NimNode {.magic: "SymOwner", noSideEffect.}
     ## accepts node of kind nnkSym and returns its owner's symbol.
diff --git a/lib/pure/nimprof.nim b/lib/pure/nimprof.nim
index 506c6bfaa..e153de81f 100644
--- a/lib/pure/nimprof.nim
+++ b/lib/pure/nimprof.nim
@@ -118,13 +118,13 @@ when defined(memProfiler):
   var
     gTicker {.threadvar.}: int
 
-  proc requestedHook(): bool {.nimcall.} =
+  proc requestedHook(): bool {.nimcall, locks: 0.} =
     if gTicker == 0:
       gTicker = SamplingInterval
       result = true
     dec gTicker
 
-  proc hook(st: StackTrace, size: int) {.nimcall.} =
+  proc hook(st: StackTrace, size: int) {.nimcall, locks: 0.} =
     when defined(ignoreAllocationSize):
       hookAux(st, 1)
     else:
@@ -136,7 +136,7 @@ else:
     gTicker: int # we use an additional counter to
                  # avoid calling 'getTicks' too frequently
 
-  proc requestedHook(): bool {.nimcall.} =
+  proc requestedHook(): bool {.nimcall, locks: 0.} =
     if interval == 0: result = true
     elif gTicker == 0:
       gTicker = 500
@@ -145,7 +145,7 @@ else:
     else:
       dec gTicker
 
-  proc hook(st: StackTrace) {.nimcall.} =
+  proc hook(st: StackTrace) {.nimcall locks: 0.} =
     #echo "profiling! ", interval
     if interval == 0:
       hookAux(st, 1)