compiler cleanup: flag tfOldSchoolExprStmt is gone

This commit is contained in:
Araq 2018-11-05 20:20:13 +01:00 • committed by Andreas Rumpf
commit c735b75f6f
5 changed files with 5 additions and 14 deletions

View file

@ -12,7 +12,8 @@
instead. instead.
- The OpenMP parallel iterator \``||`\` now supports any `#pragma omp directives` - The OpenMP parallel iterator \``||`\` now supports any `#pragma omp directives`
and not just `#pragma omp parallel for`. See [OpenMP documentation](https://www.openmp.org/wp-content/uploads/OpenMP-4.5-1115-CPP-web.pdf). and not just `#pragma omp parallel for`. See
[OpenMP documentation](https://www.openmp.org/wp-content/uploads/OpenMP-4.5-1115-CPP-web.pdf).
The default annotation is `parallel for`, if you used OpenMP without annotation The default annotation is `parallel for`, if you used OpenMP without annotation
the change is transparent, if you used annotations you will have to prefix the change is transparent, if you used annotations you will have to prefix

View file

@ -568,9 +568,6 @@ const
tfUnion* = tfNoSideEffect tfUnion* = tfNoSideEffect
tfGcSafe* = tfThread tfGcSafe* = tfThread
tfObjHasKids* = tfEnumHasHoles tfObjHasKids* = tfEnumHasHoles
tfOldSchoolExprStmt* = tfVarargs # for now used to distinguish \
# 'varargs[expr]' from 'varargs[untyped]'. Eventually 'expr' will be
# deprecated and this mess can be cleaned up.
tfReturnsNew* = tfInheritable tfReturnsNew* = tfInheritable
skError* = skUnknown skError* = skUnknown

View file

@ -2232,8 +2232,6 @@ proc parseString*(s: string; cache: IdentCache; config: ConfigRef;
stream.lineOffset = line stream.lineOffset = line
var parser: TParser var parser: TParser
# XXX for now the builtin 'parseStmt/Expr' functions do not know about strong
# spaces...
parser.lex.errorHandler = errorHandler parser.lex.errorHandler = errorHandler
openParser(parser, AbsoluteFile filename, stream, cache, config) openParser(parser, AbsoluteFile filename, stream, cache, config)

View file

@ -1744,10 +1744,8 @@ proc processMagicType(c: PContext, m: PSym) =
setMagicType(c.config, m, tyAnything, 0) setMagicType(c.config, m, tyAnything, 0)
else: else:
setMagicType(c.config, m, tyExpr, 0) setMagicType(c.config, m, tyExpr, 0)
if m.name.s == "expr": m.typ.flags.incl tfOldSchoolExprStmt
of mStmt: of mStmt:
setMagicType(c.config, m, tyStmt, 0) setMagicType(c.config, m, tyStmt, 0)
if m.name.s == "stmt": m.typ.flags.incl tfOldSchoolExprStmt
of mTypeDesc, mType: of mTypeDesc, mType:
setMagicType(c.config, m, tyTypeDesc, 0) setMagicType(c.config, m, tyTypeDesc, 0)
rawAddSon(m.typ, newTypeS(tyNone, c)) rawAddSon(m.typ, newTypeS(tyNone, c))

View file

@ -1210,9 +1210,7 @@ proc typeRelImpl(c: var TCandidate, f, aOrig: PType,
if f.kind == tyVarargs: if f.kind == tyVarargs:
if tfVarargs in a.flags: if tfVarargs in a.flags:
return typeRel(c, f.base, a.lastSon) return typeRel(c, f.base, a.lastSon)
if tfOldSchoolExprStmt in f.sons[0].flags: if f.sons[0].kind == tyStmt: return
if f.sons[0].kind == tyExpr: return
elif f.sons[0].kind == tyStmt: return
template matchArrayOrSeq(aBase: PType) = template matchArrayOrSeq(aBase: PType) =
let ff = f.base let ff = f.base
@ -1758,7 +1756,7 @@ proc typeRelImpl(c: var TCandidate, f, aOrig: PType,
result = isNone result = isNone
of tyStmt: of tyStmt:
if aOrig != nil and tfOldSchoolExprStmt notin f.flags: if aOrig != nil:
put(c, f, aOrig) put(c, f, aOrig)
result = isGeneric result = isGeneric
@ -2215,8 +2213,7 @@ proc incrIndexType(t: PType) =
inc t.sons[0].n.sons[1].intVal inc t.sons[0].n.sons[1].intVal
template isVarargsUntyped(x): untyped = template isVarargsUntyped(x): untyped =
x.kind == tyVarargs and x.sons[0].kind == tyExpr and x.kind == tyVarargs and x.sons[0].kind == tyExpr
tfOldSchoolExprStmt notin x.sons[0].flags
proc matchesAux(c: PContext, n, nOrig: PNode, proc matchesAux(c: PContext, n, nOrig: PNode,
m: var TCandidate, marker: var IntSet) = m: var TCandidate, marker: var IntSet) =