rename sfAlwaysReturn to sfNeverRaises
This commit is contained in:
parent
5ba5b5202a
commit
d375120c42
4 changed files with 5 additions and 5 deletions
|
|
@ -289,7 +289,7 @@ type
|
||||||
sfTemplateParam # symbol is a template parameter
|
sfTemplateParam # symbol is a template parameter
|
||||||
sfCursor # variable/field is a cursor, see RFC 177 for details
|
sfCursor # variable/field is a cursor, see RFC 177 for details
|
||||||
sfInjectDestructors # whether the proc needs the 'injectdestructors' transformation
|
sfInjectDestructors # whether the proc needs the 'injectdestructors' transformation
|
||||||
sfAlwaysReturn # proc can never raise an exception, not even OverflowError
|
sfNeverRaises # proc can never raise an exception, not even OverflowError
|
||||||
# or out-of-memory
|
# or out-of-memory
|
||||||
|
|
||||||
TSymFlags* = set[TSymFlag]
|
TSymFlags* = set[TSymFlag]
|
||||||
|
|
|
||||||
|
|
@ -559,7 +559,7 @@ proc genNamedParamCall(p: BProc, ri: PNode, d: var TLoc) =
|
||||||
|
|
||||||
proc canRaiseDisp(p: BProc; n: PNode): bool =
|
proc canRaiseDisp(p: BProc; n: PNode): bool =
|
||||||
# we assume things like sysFatal cannot raise themselves
|
# we assume things like sysFatal cannot raise themselves
|
||||||
if n.kind == nkSym and sfAlwaysReturn in n.sym.flags:
|
if n.kind == nkSym and sfNeverRaises in n.sym.flags:
|
||||||
result = false
|
result = false
|
||||||
elif optPanics in p.config.globalOptions or
|
elif optPanics in p.config.globalOptions or
|
||||||
(n.kind == nkSym and sfSystemModule in getModule(n.sym).flags):
|
(n.kind == nkSym and sfSystemModule in getModule(n.sym).flags):
|
||||||
|
|
|
||||||
|
|
@ -40,7 +40,7 @@ proc genEnumToStrProc*(t: PType; info: TLineInfo; g: ModuleGraph): PSym =
|
||||||
n[resultPos] = newSymNode(res)
|
n[resultPos] = newSymNode(res)
|
||||||
result.ast = n
|
result.ast = n
|
||||||
incl result.flags, sfFromGeneric
|
incl result.flags, sfFromGeneric
|
||||||
incl result.flags, sfAlwaysReturn
|
incl result.flags, sfNeverRaises
|
||||||
|
|
||||||
proc searchObjCaseImpl(obj: PNode; field: PSym): PNode =
|
proc searchObjCaseImpl(obj: PNode; field: PSym): PNode =
|
||||||
case obj.kind
|
case obj.kind
|
||||||
|
|
@ -102,4 +102,4 @@ proc genCaseObjDiscMapping*(t: PType; field: PSym; info: TLineInfo; g: ModuleGra
|
||||||
n[resultPos] = newSymNode(res)
|
n[resultPos] = newSymNode(res)
|
||||||
result.ast = n
|
result.ast = n
|
||||||
incl result.flags, sfFromGeneric
|
incl result.flags, sfFromGeneric
|
||||||
incl result.flags, sfAlwaysReturn
|
incl result.flags, sfNeverRaises
|
||||||
|
|
|
||||||
|
|
@ -165,7 +165,7 @@ proc stopCompile*(g: ModuleGraph): bool {.inline.} =
|
||||||
proc createMagic*(g: ModuleGraph; name: string, m: TMagic): PSym =
|
proc createMagic*(g: ModuleGraph; name: string, m: TMagic): PSym =
|
||||||
result = newSym(skProc, getIdent(g.cache, name), nil, unknownLineInfo, {})
|
result = newSym(skProc, getIdent(g.cache, name), nil, unknownLineInfo, {})
|
||||||
result.magic = m
|
result.magic = m
|
||||||
result.flags = {sfAlwaysReturn}
|
result.flags = {sfNeverRaises}
|
||||||
|
|
||||||
proc newModuleGraph*(cache: IdentCache; config: ConfigRef): ModuleGraph =
|
proc newModuleGraph*(cache: IdentCache; config: ConfigRef): ModuleGraph =
|
||||||
result = ModuleGraph()
|
result = ModuleGraph()
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue