IC: some progress

This commit is contained in:
Andreas Rumpf 2019-07-26 13:28:00 +02:00
commit f58d87cb43
5 changed files with 12 additions and 14 deletions

View file

@ -1886,7 +1886,8 @@ proc shouldRecompile(m: BModule; code: Rope, cfile: Cfile): bool =
result = true result = true
if optForceFullMake notin m.config.globalOptions: if optForceFullMake notin m.config.globalOptions:
if not equalsFile(code, cfile.cname): if not equalsFile(code, cfile.cname):
if m.config.symbolFiles == readOnlySf: #isDefined(m.config, "nimdiff"): if false:
#m.config.symbolFiles == readOnlySf: #isDefined(m.config, "nimdiff"):
if fileExists(cfile.cname): if fileExists(cfile.cname):
copyFile(cfile.cname.string, cfile.cname.string & ".backup") copyFile(cfile.cname.string, cfile.cname.string & ".backup")
echo "diff ", cfile.cname.string, ".backup ", cfile.cname.string echo "diff ", cfile.cname.string, ".backup ", cfile.cname.string

View file

@ -88,9 +88,7 @@ proc commandCompileToC(graph: ModuleGraph) =
let proj = changeFileExt(conf.projectFull, "") let proj = changeFileExt(conf.projectFull, "")
if not changeDetectedViaJsonBuildInstructions(conf, proj): if not changeDetectedViaJsonBuildInstructions(conf, proj):
# nothing changed # nothing changed
# Little hack here in order to not lose our precious graph.config.notes = graph.config.mainPackageNotes
# hintSuccessX message:
conf.notes.incl hintSuccessX
return return
compileProject(graph) compileProject(graph)

View file

@ -112,6 +112,14 @@ const
nkMacroDef, nkConverterDef, nkIteratorDef, nkFuncDef, nkPragma, nkMacroDef, nkConverterDef, nkIteratorDef, nkFuncDef, nkPragma,
nkExportStmt, nkExportExceptStmt, nkFromStmt, nkImportStmt, nkImportExceptStmt} nkExportStmt, nkExportExceptStmt, nkFromStmt, nkImportStmt, nkImportExceptStmt}
proc prepareConfigNotes(graph: ModuleGraph; module: PSym) =
# don't be verbose unless the module belongs to the main package:
if module.owner.id == graph.config.mainPackageId:
graph.config.notes = graph.config.mainPackageNotes
else:
if graph.config.mainPackageNotes == {}: graph.config.mainPackageNotes = graph.config.notes
graph.config.notes = graph.config.foreignPackageNotes
proc processModule*(graph: ModuleGraph; module: PSym, stream: PLLStream): bool {.discardable.} = proc processModule*(graph: ModuleGraph; module: PSym, stream: PLLStream): bool {.discardable.} =
if graph.stopCompile(): return true if graph.stopCompile(): return true
var var
@ -119,6 +127,7 @@ proc processModule*(graph: ModuleGraph; module: PSym, stream: PLLStream): bool {
a: TPassContextArray a: TPassContextArray
s: PLLStream s: PLLStream
fileIdx = module.fileIdx fileIdx = module.fileIdx
prepareConfigNotes(graph, module)
if module.id < 0: if module.id < 0:
# new module caching mechanism: # new module caching mechanism:
for i in 0 ..< graph.passes.len: for i in 0 ..< graph.passes.len:

View file

@ -221,10 +221,6 @@ proc encodeType(g: ModuleGraph, t: PType, result: var string) =
if t.lockLevel.ord != UnspecifiedLockLevel.ord: if t.lockLevel.ord != UnspecifiedLockLevel.ord:
add(result, '\14') add(result, '\14')
encodeVInt(t.lockLevel.int16, result) encodeVInt(t.lockLevel.int16, result)
if t.destructor != nil and t.destructor.id != 0:
add(result, '\15')
encodeVInt(t.destructor.id, result)
pushSym(w, t.destructor)
for a in t.attachedOps: for a in t.attachedOps:
add(result, '\16') add(result, '\16')
if a == nil: if a == nil:

View file

@ -523,12 +523,6 @@ proc myOpen(graph: ModuleGraph; module: PSym): PPassContext =
if sfSystemModule in module.flags: if sfSystemModule in module.flags:
graph.systemModule = module graph.systemModule = module
c.topLevelScope = openScope(c) c.topLevelScope = openScope(c)
# don't be verbose unless the module belongs to the main package:
if module.owner.id == graph.config.mainPackageId:
graph.config.notes = graph.config.mainPackageNotes
else:
if graph.config.mainPackageNotes == {}: graph.config.mainPackageNotes = graph.config.notes
graph.config.notes = graph.config.foreignPackageNotes
result = c result = c
proc isImportSystemStmt(g: ModuleGraph; n: PNode): bool = proc isImportSystemStmt(g: ModuleGraph; n: PNode): bool =