remove debug statements

This commit is contained in:
Andrii Riabushenko
2018-12-05 21:36:42 +00:00
parent 69347f6c95
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)
proc injectDestructorCalls*(g: ModuleGraph; owner: PSym; n: PNode): PNode =
#when true: # defined(nimDebugDestroys):
# echo "injecting into ", n
when false: # defined(nimDebugDestroys):
echo "injecting into ", n
var c: Con
c.owner = owner
c.topLevelVars = newNodeI(nkVarSection, n.info)
@@ -667,10 +667,10 @@ proc injectDestructorCalls*(g: ModuleGraph; owner: PSym; n: PNode): PNode =
else:
result.add body
#when defined(nimDebugDestroys):
if true:
echo "------------------------------------"
echo n
echo "-------"
echo owner.name.s, " transformed to: "
echo result
when defined(nimDebugDestroys):
if true:
echo "------------------------------------"
echo n
echo "-------"
echo owner.name.s, " transformed to: "
echo result

View File

@@ -221,15 +221,10 @@ proc reset*[T](obj: var T) {.magic: "Reset", noSideEffect.}
## be called before any possible `object branch transition`:idx:.
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.} =
result = x
wasMoved(x)
reset(x)
type
range*{.magic: "Range".}[T] ## Generic type to construct range types.