C code generator compiles again

This commit is contained in:
Andreas Rumpf 2018-05-12 23:45:51 +02:00
commit 1284827df2
11 changed files with 208 additions and 202 deletions

View file

@ -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
@ -174,8 +176,9 @@ proc newProc*(prc: PSym, module: BModule): BProc =
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):