a few tiny cleanups (#5712)

exposes emitLazily (for nlvm) and simplifies some conditionals
This commit is contained in:
Jacek Sieka 2017-05-29 15:42:26 +08:00 • committed by Andreas Rumpf
commit ba4cc4bf35
4 changed files with 12 additions and 30 deletions

View file

@ -2148,8 +2148,7 @@ proc expr(p: BProc, n: PNode, d: var TLoc) =
# are not transformed correctly. We work around this issue (#411) here
# by ensuring it's no inner proc (owner is a module):
if prc.skipGenericOwner.kind == skModule and sfCompileTime notin prc.flags:
if (optDeadCodeElim notin gGlobalOptions and
sfDeadCodeElim notin getModule(prc).flags) or
if (not emitLazily(prc)) or
({sfExportc, sfCompilerProc} * prc.flags == {sfExportc}) or
(sfExportc in prc.flags and lfExportLib in prc.loc.flags) or
(prc.kind == skMethod):