rename sfAlwaysReturn to sfNeverRaises

This commit is contained in:
Araq
2020-03-16 18:49:27 +01:00
parent 5ba5b5202a
commit d375120c42
4 changed files with 5 additions and 5 deletions

View File

@@ -289,7 +289,7 @@ type
sfTemplateParam # symbol is a template parameter
sfCursor # variable/field is a cursor, see RFC 177 for details
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
TSymFlags* = set[TSymFlag]

View File

@@ -559,7 +559,7 @@ proc genNamedParamCall(p: BProc, ri: PNode, d: var TLoc) =
proc canRaiseDisp(p: BProc; n: PNode): bool =
# 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
elif optPanics in p.config.globalOptions or
(n.kind == nkSym and sfSystemModule in getModule(n.sym).flags):

View File

@@ -40,7 +40,7 @@ proc genEnumToStrProc*(t: PType; info: TLineInfo; g: ModuleGraph): PSym =
n[resultPos] = newSymNode(res)
result.ast = n
incl result.flags, sfFromGeneric
incl result.flags, sfAlwaysReturn
incl result.flags, sfNeverRaises
proc searchObjCaseImpl(obj: PNode; field: PSym): PNode =
case obj.kind
@@ -102,4 +102,4 @@ proc genCaseObjDiscMapping*(t: PType; field: PSym; info: TLineInfo; g: ModuleGra
n[resultPos] = newSymNode(res)
result.ast = n
incl result.flags, sfFromGeneric
incl result.flags, sfAlwaysReturn
incl result.flags, sfNeverRaises

View File

@@ -165,7 +165,7 @@ proc stopCompile*(g: ModuleGraph): bool {.inline.} =
proc createMagic*(g: ModuleGraph; name: string, m: TMagic): PSym =
result = newSym(skProc, getIdent(g.cache, name), nil, unknownLineInfo, {})
result.magic = m
result.flags = {sfAlwaysReturn}
result.flags = {sfNeverRaises}
proc newModuleGraph*(cache: IdentCache; config: ConfigRef): ModuleGraph =
result = ModuleGraph()