diff options
-rw-r--r-- | compiler/options.nim | 6 | ||||
-rw-r--r-- | compiler/pragmas.nim | 11 | ||||
-rw-r--r-- | compiler/rodimpl.nim | 4 |
3 files changed, 13 insertions, 8 deletions
diff --git a/compiler/options.nim b/compiler/options.nim index bebbf4544..d3f2f9d1c 100644 --- a/compiler/options.nim +++ b/compiler/options.nim @@ -246,11 +246,7 @@ template depConfigFields*(fn) {.dirty.} = fn(selectedGC) template serializeConfigFields(fn) {.dirty.} = - fn(cppDefines) - fn(externalToLink) - fn(linkOptions) - fn(compileOptions) - fn(toCompile) + fn(cppDefines) # XXX TODO: Replay this. const oldExperimentalFeatures* = {implicitDeref, dotOperators, callOperator, parallel} diff --git a/compiler/pragmas.nim b/compiler/pragmas.nim index de9636809..a51d250a2 100644 --- a/compiler/pragmas.nim +++ b/compiler/pragmas.nim @@ -82,7 +82,6 @@ proc getPragmaVal*(procAst: PNode; name: TSpecialWord): PNode = return it[1] proc pragma*(c: PContext, sym: PSym, n: PNode, validPragmas: TSpecialWords) -# implementation proc recordPragma(c: PContext; n: PNode; key, val: string; val2 = "") = var recorded = newNodeI(nkCommentStmt, n.info) @@ -933,8 +932,14 @@ proc singlePragma(c: PContext, sym: PSym, n: PNode, i: var int, of wCompile: processCompile(c, it) of wLink: processCommonLink(c, it, linkNormal) of wLinksys: processCommonLink(c, it, linkSys) - of wPassl: extccomp.addLinkOption(c.config, expectStrLit(c, it)) - of wPassc: extccomp.addCompileOption(c.config, expectStrLit(c, it)) + of wPassl: + let s = expectStrLit(c, it) + extccomp.addLinkOption(c.config, s) + recordPragma(c, it, "passl", s) + of wPassc: + let s = expectStrLit(c, it) + extccomp.addCompileOption(c.config, s) + recordPragma(c, it, "passc", s) of wBreakpoint: pragmaBreakpoint(c, it) of wWatchPoint: pragmaWatchpoint(c, it) of wPush: diff --git a/compiler/rodimpl.nim b/compiler/rodimpl.nim index e9054fd26..8cac5d030 100644 --- a/compiler/rodimpl.nim +++ b/compiler/rodimpl.nim @@ -789,6 +789,10 @@ proc replay(g: ModuleGraph; module: PSym; n: PNode) = extccomp.addExternalFileToCompile(g.config, cf) of "link": extccomp.addExternalFileToLink(g.config, n[1].strVal) + of "passl": + extccomp.addLinkOption(g.config, n[1].strVal) + of "passc": + extccomp.addCompileOption(g.config, n[1].strVal) of "inc": let destKey = n[1].strVal let by = n[2].intVal |