diff options
author | Andreas Rumpf <rumpf_a@web.de> | 2021-01-23 08:06:15 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-01-23 08:06:15 +0100 |
commit | 8241e55023ee32c9ec0b5443723bbe91f4fe875f (patch) | |
tree | d14be71f134b1789db54028704748c4dbed46bfa /compiler/ccgstmts.nim | |
parent | eae3bdf8fe554cdd334b8a53de63fd9bf10a7832 (diff) | |
download | Nim-8241e55023ee32c9ec0b5443723bbe91f4fe875f.tar.gz |
IC: next steps (#16729)
* IC: dead code elimination pass * preparations for a different codegen strategy * added documentation to the newly written code * IC: backend code * IC: backend adjustments * optimized the compiler a bit * IC: yet another massive refactoring * fixes regressions * cleanups
Diffstat (limited to 'compiler/ccgstmts.nim')
-rw-r--r-- | compiler/ccgstmts.nim | 29 |
1 files changed, 15 insertions, 14 deletions
diff --git a/compiler/ccgstmts.nim b/compiler/ccgstmts.nim index 8c419caac..7269b337c 100644 --- a/compiler/ccgstmts.nim +++ b/compiler/ccgstmts.nim @@ -1530,20 +1530,21 @@ proc genDiscriminantCheck(p: BProc, a, tmp: TLoc, objtype: PType, [rdLoc(a), rdLoc(tmp), discriminatorTableName(p.module, t, field), intLiteral(toInt64(lengthOrd(p.config, field.typ))+1)]) -proc genCaseObjDiscMapping(p: BProc, e: PNode, t: PType, field: PSym; d: var TLoc) = - const ObjDiscMappingProcSlot = -5 - var theProc: PSym = nil - for idx, p in items(t.methods): - if idx == ObjDiscMappingProcSlot: - theProc = p - break - if theProc == nil: - theProc = genCaseObjDiscMapping(t, field, e.info, p.module.g.graph, p.module.idgen) - t.methods.add((ObjDiscMappingProcSlot, theProc)) - var call = newNodeIT(nkCall, e.info, getSysType(p.module.g.graph, e.info, tyUInt8)) - call.add newSymNode(theProc) - call.add e - expr(p, call, d) +when false: + proc genCaseObjDiscMapping(p: BProc, e: PNode, t: PType, field: PSym; d: var TLoc) = + const ObjDiscMappingProcSlot = -5 + var theProc: PSym = nil + for idx, p in items(t.methods): + if idx == ObjDiscMappingProcSlot: + theProc = p + break + if theProc == nil: + theProc = genCaseObjDiscMapping(t, field, e.info, p.module.g.graph, p.module.idgen) + t.methods.add((ObjDiscMappingProcSlot, theProc)) + var call = newNodeIT(nkCall, e.info, getSysType(p.module.g.graph, e.info, tyUInt8)) + call.add newSymNode(theProc) + call.add e + expr(p, call, d) proc asgnFieldDiscriminant(p: BProc, e: PNode) = var a, tmp: TLoc |