Cleanups 20180401 (#7458)

This commit is contained in:
Jacek Sieka 2018-04-12 23:35:10 +08:00 • committed by Andreas Rumpf
commit 85e21158db
6 changed files with 73 additions and 78 deletions

View file

@ -1768,6 +1768,9 @@ proc gen(c: PCtx; n: PNode; dest: var TDest; flags: TGenFlags = {}) =
let constVal = if s.ast != nil: s.ast else: s.typ.n
gen(c, constVal, dest)
of skEnumField:
# we never reach this case - as of the time of this comment,
# skEnumField is folded to an int in semfold.nim, but this code
# remains for robustness
if dest < 0: dest = c.getTemp(n.typ)
if s.position >= low(int16) and s.position <= high(int16):
c.gABx(n, opcLdImmInt, dest, s.position)