This is an archive of the discontinued LLVM Phabricator instance.

[flang] Added Semantic Checks for 5 Data Constraints
ClosedPublic

Authored by anchu-rajendran on Apr 13 2020, 1:46 AM.

Details

Summary

Semantic checks for 5 data constraints : C874, C875, C878, C880 and C881 are implemented.

Diff Detail

Event Timeline

Herald added a project: Restricted Project. · View Herald Transcript
tskeith accepted this revision.EditedApr 13 2020, 10:00 AM

LGTM, after fixing the clang-format problems.

flang/lib/Semantics/check-data.cpp
27–29

I think this is clearer as:

CheckIfConstantSubscript(std::get<0>(triplet.t));
CheckIfConstantSubscript(std::get<1>(triplet.t));
CheckIfConstantSubscript(std::get<2>(triplet.t));
This revision is now accepted and ready to land.Apr 13 2020, 10:00 AM

Fixed the clang format problems

anchu-rajendran marked 2 inline comments as done.Apr 14 2020, 1:28 AM
anchu-rajendran added inline comments.
flang/lib/Semantics/check-data.cpp
27–29

Hi, Thank your for the comment! I have made the change suggested and fixed the formatting issues.

anchu-rajendran marked an inline comment as done.Apr 14 2020, 1:33 AM

Fixed the formatting issues

Changes in formatting

ChinouneMehdi added a project: Restricted Project.Apr 15 2020, 5:45 AM
anchu-rajendran marked an inline comment as done.Apr 16 2020, 4:31 AM
anchu-rajendran added inline comments.
flang/lib/Semantics/check-data.cpp
15–16

@klausler , I have made the checks on analyzed expressions as suggested by you. Please let me know if there are any concerns.

Your code is still checking the *parse tree* for a data-ref rather than calculating a typed expression representation for the variable with AnalyzeExpr and applying constraint checks to its result.

I think you should just merge the code you have so I can clean it up here.

This revision was automatically updated to reflect the committed changes.

I think you should just merge the code you have so I can clean it up here.

Thank you! I have merged the changes.