[flang][openacc] Fix ambiguity in the self clause parsing
authorValentin Clement <clementval@gmail.com>
Wed, 28 Oct 2020 01:09:48 +0000 (21:09 -0400)
committerclementval <clementval@gmail.com>
Wed, 28 Oct 2020 01:10:00 +0000 (21:10 -0400)
commit990222931ba2c87803f8b0381a2088b0e2969848
treedac4abfb6607431036e41f3b15f1488a1cc98981
parent44eea0b1a7301de4c284afed1c023014c391372f
[flang][openacc] Fix ambiguity in the self clause parsing

In the OpenACC specification, there are two different self clause. One for the
update directive with a var-list argument. This clause is a synonym of the host clause.
The second self clause is present for most of the compute construct and takes an optional
condition. To solve this ambiguity, the self clause for the update directive is directly
translated to a host clause during the parsing. The self clause in AccClause refers always
to the compute construct clause.

Reviewed By: kiranktp

Differential Revision: https://reviews.llvm.org/D90185
flang/lib/Parser/openacc-parsers.cpp
flang/test/Semantics/acc-clause-validity.f90