parent
06dfd31612
commit
de74362213
4 changed files with 44 additions and 7 deletions
|
|
@ -23,7 +23,7 @@ type
|
|||
errGeneralParseError,
|
||||
errNewSectionExpected,
|
||||
errInvalidDirectiveX,
|
||||
errProveInit,
|
||||
errProveInit, # deadcode
|
||||
errGenerated,
|
||||
errUser,
|
||||
warnCannotOpenFile,
|
||||
|
|
@ -66,7 +66,7 @@ const
|
|||
errGeneralParseError: "general parse error",
|
||||
errNewSectionExpected: "new section expected",
|
||||
errInvalidDirectiveX: "invalid directive: '$1'",
|
||||
errProveInit: "Cannot prove that '$1' is initialized.",
|
||||
errProveInit: "Cannot prove that '$1' is initialized.", # deadcode
|
||||
errGenerated: "$1",
|
||||
errUser: "$1",
|
||||
warnCannotOpenFile: "cannot open '$1'",
|
||||
|
|
|
|||
|
|
@ -1151,12 +1151,17 @@ proc initEffects(g: ModuleGraph; effects: PNode; s: PSym; t: var TEffects; c: PC
|
|||
t.config = g.config
|
||||
t.c = c
|
||||
|
||||
proc hasRealBody(s: PSym): bool =
|
||||
## also handles importc procs with runnableExamples, which requires `=`,
|
||||
## which is not a real implementation, refs #14314
|
||||
result = {sfForward, sfImportc} * s.flags == {}
|
||||
|
||||
proc trackProc*(c: PContext; s: PSym, body: PNode) =
|
||||
let g = c.graph
|
||||
var effects = s.typ.n[0]
|
||||
if effects.kind != nkEffectList: return
|
||||
# effects already computed?
|
||||
if sfForward in s.flags: return
|
||||
if not s.hasRealBody: return
|
||||
if effects.len == effectListLen: return
|
||||
|
||||
var t: TEffects
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue