mirror of
https://github.com/nim-lang/Nim.git
synced 2026-04-19 05:50:30 +00:00
compiler cleanup: flag tfOldSchoolExprStmt is gone
This commit is contained in:
@@ -12,7 +12,8 @@
|
||||
instead.
|
||||
|
||||
- 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 change is transparent, if you used annotations you will have to prefix
|
||||
|
||||
@@ -568,9 +568,6 @@ const
|
||||
tfUnion* = tfNoSideEffect
|
||||
tfGcSafe* = tfThread
|
||||
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
|
||||
skError* = skUnknown
|
||||
|
||||
|
||||
@@ -2232,8 +2232,6 @@ proc parseString*(s: string; cache: IdentCache; config: ConfigRef;
|
||||
stream.lineOffset = line
|
||||
|
||||
var parser: TParser
|
||||
# XXX for now the builtin 'parseStmt/Expr' functions do not know about strong
|
||||
# spaces...
|
||||
parser.lex.errorHandler = errorHandler
|
||||
openParser(parser, AbsoluteFile filename, stream, cache, config)
|
||||
|
||||
|
||||
@@ -1744,10 +1744,8 @@ proc processMagicType(c: PContext, m: PSym) =
|
||||
setMagicType(c.config, m, tyAnything, 0)
|
||||
else:
|
||||
setMagicType(c.config, m, tyExpr, 0)
|
||||
if m.name.s == "expr": m.typ.flags.incl tfOldSchoolExprStmt
|
||||
of mStmt:
|
||||
setMagicType(c.config, m, tyStmt, 0)
|
||||
if m.name.s == "stmt": m.typ.flags.incl tfOldSchoolExprStmt
|
||||
of mTypeDesc, mType:
|
||||
setMagicType(c.config, m, tyTypeDesc, 0)
|
||||
rawAddSon(m.typ, newTypeS(tyNone, c))
|
||||
|
||||
@@ -1210,9 +1210,7 @@ proc typeRelImpl(c: var TCandidate, f, aOrig: PType,
|
||||
if f.kind == tyVarargs:
|
||||
if tfVarargs in a.flags:
|
||||
return typeRel(c, f.base, a.lastSon)
|
||||
if tfOldSchoolExprStmt in f.sons[0].flags:
|
||||
if f.sons[0].kind == tyExpr: return
|
||||
elif f.sons[0].kind == tyStmt: return
|
||||
if f.sons[0].kind == tyStmt: return
|
||||
|
||||
template matchArrayOrSeq(aBase: PType) =
|
||||
let ff = f.base
|
||||
@@ -1758,7 +1756,7 @@ proc typeRelImpl(c: var TCandidate, f, aOrig: PType,
|
||||
result = isNone
|
||||
|
||||
of tyStmt:
|
||||
if aOrig != nil and tfOldSchoolExprStmt notin f.flags:
|
||||
if aOrig != nil:
|
||||
put(c, f, aOrig)
|
||||
result = isGeneric
|
||||
|
||||
@@ -2215,8 +2213,7 @@ proc incrIndexType(t: PType) =
|
||||
inc t.sons[0].n.sons[1].intVal
|
||||
|
||||
template isVarargsUntyped(x): untyped =
|
||||
x.kind == tyVarargs and x.sons[0].kind == tyExpr and
|
||||
tfOldSchoolExprStmt notin x.sons[0].flags
|
||||
x.kind == tyVarargs and x.sons[0].kind == tyExpr
|
||||
|
||||
proc matchesAux(c: PContext, n, nOrig: PNode,
|
||||
m: var TCandidate, marker: var IntSet) =
|
||||
|
||||
Reference in New Issue
Block a user