This is an archive of the discontinued LLVM Phabricator instance.

[OpenMP] diagnose zero-length array section in the depend clause
ClosedPublic

Authored by kkwli0 on Dec 28 2019, 7:02 PM.

Details

Summary

The OpenMP specification disallows having zero-length array sections in the depend clause (OpenMP 5.0 2.17.11).

Diff Detail

Event Timeline

kkwli0 created this revision.Dec 28 2019, 7:02 PM
jdoerfert added a comment.EditedDec 29 2019, 8:20 AM

Is there a reason not to put this check right next to the one that issues err_omp_section_length_negative. SemaExpr.cpp +4668

ABataev added inline comments.Dec 30 2019, 7:18 AM
clang/lib/Sema/SemaOpenMP.cpp
15030–15032

Just .. Length->EvaluateAsInt(Result, Context) && Result.Val.getInt().isNullValue()) {

Is there a reason not to put this check right next to the one that issues err_omp_section_length_negative. SemaExpr.cpp +4668

It is a good idea to group the checking together however this check is specific for the depend clause. The map clause allows the zero-length array section. Isn't it better to keep it in ActOnOpenMPDependClause?

kkwli0 marked an inline comment as done.Jan 2 2020, 9:20 AM
kkwli0 updated this revision to Diff 235894.EditedJan 2 2020, 9:23 AM

Update based on suggestion to simply the check and rebase.

This revision is now accepted and ready to land.Jan 2 2020, 9:43 AM
This revision was automatically updated to reflect the committed changes.
Herald added a project: Restricted Project. · View Herald TranscriptJan 3 2020, 9:09 AM