diff --git a/frontend/lib/uast/post-parse-checks.cpp b/frontend/lib/uast/post-parse-checks.cpp index 58e7a5f6cd54..f102c338527b 100644 --- a/frontend/lib/uast/post-parse-checks.cpp +++ b/frontend/lib/uast/post-parse-checks.cpp @@ -672,9 +672,11 @@ void Visitor::checkSparseKeyword(const FnCall* node) { // TODO: remove this check and warning after 1.34? void Visitor::checkPrimCallInUserCode(const PrimCall* node) { + // suppress this warning from chpldoc if (isUserCode()) - if (node->prim() == PrimitiveTag::PRIM_CHPL_COMM_GET || - node->prim() == PrimitiveTag::PRIM_CHPL_COMM_PUT) + if ((node->prim() == PrimitiveTag::PRIM_CHPL_COMM_GET || + node->prim() == PrimitiveTag::PRIM_CHPL_COMM_PUT) && + context_->configuration().toolName != "chpldoc") warn(node, "the primitives 'chpl_comm_get' and 'chpl_comm_put'," " have changed behavior in Chapel 1.32. Please use" " the 'Communication' module's 'get' and 'put' procedures" diff --git a/test/chpldoc/noWarnCommGetPut.doc.chpl b/test/chpldoc/noWarnCommGetPut.doc.chpl new file mode 120000 index 000000000000..d114441bc185 --- /dev/null +++ b/test/chpldoc/noWarnCommGetPut.doc.chpl @@ -0,0 +1 @@ +../deprecated/chplCommGetPut.chpl \ No newline at end of file diff --git a/test/chpldoc/noWarnCommGetPut.doc.good b/test/chpldoc/noWarnCommGetPut.doc.good new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/test/deprecated/chplCommGetPut.chpl b/test/deprecated/chplCommGetPut.chpl index 7a90a183d259..4f4f10626a5f 100644 --- a/test/deprecated/chplCommGetPut.chpl +++ b/test/deprecated/chplCommGetPut.chpl @@ -1,3 +1,9 @@ +/* + Test to make sure we do/don't warn about the changed behavior (depending on + if using chpl or chpldoc) in these primitives from v1.31 to v1.32. + Should remove when we stop warning about the change, likely with v1.34. +*/ + inline proc GET(addr, node, rAddr, size) { __primitive("chpl_comm_get", addr, node, rAddr, size); } diff --git a/test/deprecated/chplCommGetPut.good b/test/deprecated/chplCommGetPut.good index f04de919db7e..d62ca3316610 100644 --- a/test/deprecated/chplCommGetPut.good +++ b/test/deprecated/chplCommGetPut.good @@ -1,4 +1,4 @@ -chplCommGetPut.chpl:1: In function 'GET': -chplCommGetPut.chpl:2: warning: the primitives 'chpl_comm_get' and 'chpl_comm_put', have changed behavior in Chapel 1.32. Please use the 'Communication' module's 'get' and 'put' procedures as replacements for calling the primitives directly -chplCommGetPut.chpl:5: In function 'PUT': -chplCommGetPut.chpl:6: warning: the primitives 'chpl_comm_get' and 'chpl_comm_put', have changed behavior in Chapel 1.32. Please use the 'Communication' module's 'get' and 'put' procedures as replacements for calling the primitives directly +chplCommGetPut.chpl:7: In function 'GET': +chplCommGetPut.chpl:8: warning: the primitives 'chpl_comm_get' and 'chpl_comm_put', have changed behavior in Chapel 1.32. Please use the 'Communication' module's 'get' and 'put' procedures as replacements for calling the primitives directly +chplCommGetPut.chpl:11: In function 'PUT': +chplCommGetPut.chpl:12: warning: the primitives 'chpl_comm_get' and 'chpl_comm_put', have changed behavior in Chapel 1.32. Please use the 'Communication' module's 'get' and 'put' procedures as replacements for calling the primitives directly