diff options
author | Mamy Ratsimbazafy <mratsim@users.noreply.github.com> | 2018-10-25 18:09:35 +0200 |
---|---|---|
committer | Andreas Rumpf <rumpf_a@web.de> | 2018-10-25 18:09:35 +0200 |
commit | 5b977627870d925e79dca1dd5cee615015314b5d (patch) | |
tree | 32fbf5d09c2568b389cab979c684049239532aac /compiler | |
parent | c844a9169ccb445cc16584db4f434074614b357e (diff) | |
download | Nim-5b977627870d925e79dca1dd5cee615015314b5d.tar.gz |
Openmp parallel iterator improvements (#9493)
* More flexibility in OpenMP pragma * Use static to constrain to compile-time annotation string * Update changelog with OpenMP change
Diffstat (limited to 'compiler')
-rw-r--r-- | compiler/ccgstmts.nim | 2 | ||||
-rw-r--r-- | compiler/semexprs.nim | 5 |
2 files changed, 1 insertions, 6 deletions
diff --git a/compiler/ccgstmts.nim b/compiler/ccgstmts.nim index 907b56dac..7905d3daf 100644 --- a/compiler/ccgstmts.nim +++ b/compiler/ccgstmts.nim @@ -557,7 +557,7 @@ proc genParForStmt(p: BProc, t: PNode) = initLocExpr(p, call.sons[1], rangeA) initLocExpr(p, call.sons[2], rangeB) - lineF(p, cpsStmts, "#pragma omp parallel for $4$n" & + lineF(p, cpsStmts, "#pragma omp $4$n" & "for ($1 = $2; $1 <= $3; ++$1)", [forLoopVar.loc.rdLoc, rangeA.rdLoc, rangeB.rdLoc, diff --git a/compiler/semexprs.nim b/compiler/semexprs.nim index a13281cd6..1725d7a31 100644 --- a/compiler/semexprs.nim +++ b/compiler/semexprs.nim @@ -2041,11 +2041,6 @@ proc semMagic(c: PContext, n: PNode, s: PSym, flags: TExprFlags): PNode = result = c.graph.emptyNode of mOmpParFor: checkMinSonsLen(n, 3, c.config) - if n.sonsLen == 4: - let annotationStr = getConstExpr(c.module, semExpr(c, n[^1]), c.graph) - if annotationStr == nil or annotationStr.kind notin nkStrKinds: - localError(c.config, result[^1].info, - "The annotation string for `||` must be known at compile time") result = semDirectOp(c, n, flags) else: result = semDirectOp(c, n, flags) |