This is an archive of the discontinued LLVM Phabricator instance.

[flang][openacc][NFC] Make self clause value optional in ACC.td and extract the parser
ClosedPublic

Authored by clementval on Jul 28 2021, 8:05 AM.

Details

Summary

Set the isOptional flag for the self clause. Move the optional and parenthesis part of the parser. Update the rest of the code to deal with the optional value.

Preparatory work for D106968.

Diff Detail

Event Timeline

clementval created this revision.Jul 28 2021, 8:05 AM
clementval requested review of this revision.Jul 28 2021, 8:05 AM
Herald added a project: Restricted Project. · View Herald TranscriptJul 28 2021, 8:05 AM
clementval edited the summary of this revision. (Show Details)Jul 28 2021, 8:06 AM
clementval added a project: Restricted Project.
clementval updated this revision to Diff 443211.Jul 8 2022, 4:54 AM
clementval edited the summary of this revision. (Show Details)

Rebase

Herald added projects: Restricted Project, Restricted Project. · View Herald TranscriptJul 8 2022, 4:54 AM
flang/lib/Lower/OpenACC.cpp
439

I guess you mean if it is not a logical expression or an object list it is an empty self clause and should be represented by the selfAttr. If so, I think this is not nested correctly.

clementval added inline comments.Jul 8 2022, 5:42 AM
flang/lib/Lower/OpenACC.cpp
439

The parser changed a bit so this is normally correct. If the clause is present without value then it's the simple self. There are couple of test for this in acc-parallel.f90 and acc-parallel-loop.f90.

clementval added inline comments.Jul 8 2022, 5:44 AM
flang/lib/Lower/OpenACC.cpp
439

The change is mainly due because of the isOptional added in ACC.td

kiranchandramohan accepted this revision.Jul 8 2022, 5:49 AM

LGTM.

flang/lib/Lower/OpenACC.cpp
439

Ahh OK. I missed the AccClause::Self that is outside and represents the presence of the self clause.

This revision is now accepted and ready to land.Jul 8 2022, 5:49 AM
This revision was landed with ongoing or failed builds.Jul 8 2022, 6:45 AM
This revision was automatically updated to reflect the committed changes.