diff options
author | data-man <datamanrb@gmail.com> | 2018-05-19 16:19:29 +0300 |
---|---|---|
committer | data-man <datamanrb@gmail.com> | 2018-05-19 16:19:29 +0300 |
commit | 2a9843c68fc60be6bcb41771dce88df004868e42 (patch) | |
tree | af0396a389f0d35b9239827a7915139e72e6ad9b /compiler/cgendata.nim | |
parent | 606d8b2f6d0ed4c26d44d2b07b8fef39cabc0b3c (diff) | |
parent | 04ddd069a1b3315dc0e323d98fefd621d1430a4d (diff) | |
download | Nim-2a9843c68fc60be6bcb41771dce88df004868e42.tar.gz |
Merge branch 'devel' of https://github.com/nim-lang/Nim into fix_2753
Diffstat (limited to 'compiler/cgendata.nim')
-rw-r--r-- | compiler/cgendata.nim | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/compiler/cgendata.nim b/compiler/cgendata.nim index f8167acdc..ce3fc2f90 100644 --- a/compiler/cgendata.nim +++ b/compiler/cgendata.nim @@ -14,6 +14,7 @@ import tables, ndi from msgs import TLineInfo +from modulegraphs import ModuleGraph type TLabel* = Rope # for the C generator a label is just a rope @@ -116,6 +117,7 @@ type breakpoints*: Rope # later the breakpoints are inserted into the main proc typeInfoMarker*: TypeCache config*: ConfigRef + graph*: ModuleGraph strVersion*, seqVersion*: int # version of the string/seq implementation to use TCGen = object of TPassContext # represents a C source file @@ -148,6 +150,9 @@ type g*: BModuleList ndi*: NdiFile +template config*(m: BModule): ConfigRef = m.g.config +template config*(p: BProc): ConfigRef = p.module.g.config + proc includeHeader*(this: BModule; header: string) = if not this.headerFiles.contains header: this.headerFiles.add header @@ -165,14 +170,15 @@ proc newProc*(prc: PSym, module: BModule): BProc = result.prc = prc result.module = module if prc != nil: result.options = prc.options - else: result.options = gOptions + else: result.options = module.config.options newSeq(result.blocks, 1) result.nestedTryStmts = @[] result.finallySafePoints = @[] result.sigConflicts = initCountTable[string]() -proc newModuleList*(config: ConfigRef): BModuleList = - BModuleList(modules: @[], typeInfoMarker: initTable[SigHash, Rope](), config: config) +proc newModuleList*(g: ModuleGraph): BModuleList = + BModuleList(modules: @[], typeInfoMarker: initTable[SigHash, Rope](), config: g.config, + graph: g) iterator cgenModules*(g: BModuleList): BModule = for i in 0..high(g.modules): |