diff options
author | Andreas Rumpf <rumpf_a@web.de> | 2017-02-22 16:27:52 +0100 |
---|---|---|
committer | Andreas Rumpf <rumpf_a@web.de> | 2017-02-22 16:27:52 +0100 |
commit | 46efaf294bfc230d0259d89fd0fbd7f1418b7ac4 (patch) | |
tree | 0b2d4c3970fe65b0ae41bebf33f555b2ccc537da /compiler/passaux.nim | |
parent | 311253ef2ffd63716ee69f4fd156462df26ae186 (diff) | |
download | Nim-46efaf294bfc230d0259d89fd0fbd7f1418b7ac4.tar.gz |
big compiler refactoring; avoid globals for multi method dispatcher generation
Diffstat (limited to 'compiler/passaux.nim')
-rw-r--r-- | compiler/passaux.nim | 18 |
1 files changed, 0 insertions, 18 deletions
diff --git a/compiler/passaux.nim b/compiler/passaux.nim index eeaf12953..2065d5893 100644 --- a/compiler/passaux.nim +++ b/compiler/passaux.nim @@ -29,21 +29,3 @@ proc verboseProcess(context: PPassContext, n: PNode): PNode = message(n.info, hintProcessing, $idgen.gFrontendId) const verbosePass* = makePass(open = verboseOpen, process = verboseProcess) - -proc cleanUp(c: PPassContext, n: PNode): PNode = - result = n - # we cannot clean up if dead code elimination is activated - if optDeadCodeElim in gGlobalOptions or n == nil: return - case n.kind - of nkStmtList: - for i in countup(0, sonsLen(n) - 1): discard cleanUp(c, n.sons[i]) - of nkProcDef, nkMethodDef: - if n.sons[namePos].kind == nkSym: - var s = n.sons[namePos].sym - if sfDeadCodeElim notin getModule(s).flags and not astNeeded(s): - s.ast.sons[bodyPos] = ast.emptyNode # free the memory - else: - discard - -const cleanupPass* = makePass(process = cleanUp, close = cleanUp) - |