remove debug statements

This commit is contained in:
Andrii Riabushenko 2018-12-05 21:36:42 +00:00
commit f46573c1ed
2 changed files with 10 additions and 15 deletions

View file

@ -632,8 +632,8 @@ proc p(n: PNode; c: var Con): PNode =
recurse(n, result) recurse(n, result)
proc injectDestructorCalls*(g: ModuleGraph; owner: PSym; n: PNode): PNode = proc injectDestructorCalls*(g: ModuleGraph; owner: PSym; n: PNode): PNode =
#when true: # defined(nimDebugDestroys): when false: # defined(nimDebugDestroys):
# echo "injecting into ", n echo "injecting into ", n
var c: Con var c: Con
c.owner = owner c.owner = owner
c.topLevelVars = newNodeI(nkVarSection, n.info) c.topLevelVars = newNodeI(nkVarSection, n.info)
@ -667,7 +667,7 @@ proc injectDestructorCalls*(g: ModuleGraph; owner: PSym; n: PNode): PNode =
else: else:
result.add body result.add body
#when defined(nimDebugDestroys): when defined(nimDebugDestroys):
if true: if true:
echo "------------------------------------" echo "------------------------------------"
echo n echo n

View file

@ -221,15 +221,10 @@ proc reset*[T](obj: var T) {.magic: "Reset", noSideEffect.}
## be called before any possible `object branch transition`:idx:. ## be called before any possible `object branch transition`:idx:.
when defined(nimNewRuntime): when defined(nimNewRuntime):
proc wasMoved*[T](obj: var T) {.magic: "WasMoved", noSideEffect.} =
## resets an object `obj` to its initial (binary zero) value to signify
## it was "moved" and to signify its destructor should do nothing and
## ideally be optimized away.
discard
proc move*[T](x: var T): T {.magic: "Move", noSideEffect.} = proc move*[T](x: var T): T {.magic: "Move", noSideEffect.} =
result = x result = x
wasMoved(x) reset(x)
type type
range*{.magic: "Range".}[T] ## Generic type to construct range types. range*{.magic: "Range".}[T] ## Generic type to construct range types.