diff options
author | awr <41453959+awr1@users.noreply.github.com> | 2018-09-05 09:03:44 -0500 |
---|---|---|
committer | awr <41453959+awr1@users.noreply.github.com> | 2018-09-05 09:03:44 -0500 |
commit | 2b8c4096a48449d424db6869c7281c837e3e0904 (patch) | |
tree | dad588f887a08aa801e031cb4470f390462563e1 /compiler/pragmas.nim | |
parent | 02306020b27a69a6f5f9eaa0926c87da0636a018 (diff) | |
download | Nim-2b8c4096a48449d424db6869c7281c837e3e0904.tar.gz |
brought back pragmaNoForward, deprecated
Diffstat (limited to 'compiler/pragmas.nim')
-rw-r--r-- | compiler/pragmas.nim | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/compiler/pragmas.nim b/compiler/pragmas.nim index 8f6b6e362..aa0783bd5 100644 --- a/compiler/pragmas.nim +++ b/compiler/pragmas.nim @@ -230,6 +230,19 @@ proc onOff(c: PContext, n: PNode, op: TOptions, resOptions: var TOptions) = if isTurnedOn(c, n): resOptions = resOptions + op else: resOptions = resOptions - op +proc pragmaNoForward(c: PContext, n: PNode; flag=sfNoForward) = + if isTurnedOn(c, n): + incl(c.module.flags, flag) + c.features.incl codeReordering + else: + excl(c.module.flags, flag) + # c.features.excl codeReordering + + # deprecated as of 0.18.1 + message(c.config, n.info, warnDeprecated, + "use {.experimental: \"codeReordering.\".} instead; " & + (if flag == sfNoForward: "{.noForward.}" else: "{.reorder.}")) + proc processCallConv(c: PContext, n: PNode) = if n.kind in nkPragmaCallKinds and n.len == 2 and n.sons[1].kind == nkIdent: let sw = whichKeyword(n.sons[1].ident) @@ -823,6 +836,8 @@ proc singlePragma(c: PContext, sym: PSym, n: PNode, i: var int, noVal(c, it) incl(sym.flags, {sfThread, sfGlobal}) of wDeadCodeElimUnused: discard # deprecated, dead code elim always on + of wNoForward: pragmaNoForward(c, it) + of wReorder: pragmaNoForward(c, it, flag = sfReorder) of wMagic: processMagic(c, it, sym) of wCompileTime: noVal(c, it) |