13 Commits

Author SHA1 Message Date
erichkeane
bb97c99283 [OpenACC] Enable serial/kernels Compute Constructs
So far, all the work we've done for compute constructs has only used
'parallel'.  This patch does the work to enable the same logic for
'serial' and 'kernels' constructs as well, since they are the same
semantic behavior.
2024-03-04 12:47:18 -08:00
Erich Keane
cb89112797
[OpenACC] Implement beginning parts of the 'parallel' Sema impl (#81659)
This patch Implements AST node creation and appertainment enforcement
for 'parallel', as well as changes the 'not implemented' messages to be
more specific. It does not deal with clauses/clause legality, nor a few
of the other rules from the standard, but this gets us most of the way
for a framework for future construct implementation.
2024-02-16 08:53:09 -08:00
erichkeane
db4ea21dfd [OpenACC] Change 'not implemented' diagnostic to be more specific
Currently we just emit a generic 'not implemented' diagnostic for all
OpenACC pragmas. This patch moves the diagnostic to 'Sema' and diagnoses
for a specific clause or construct, in preperation of implementing Sema
for constructs.
2024-02-15 12:22:11 -08:00
Erich Keane
fdee0a35d9
[OpenACC] Add 'clause' parsing infrastructure plus a few clauses (#75052)
As we've now finished parsing the constructs, we're moving onto
implementing 'clause' parsing. While some are complicated and require
their own patch, the handful added here are simple to parse (that is,
    they are a single identifier).

This patch adds the infrastructure to parse these and a clause-list in
its entirety. This adds some complication to how we are diagnosing
parsing errors elsewhere, so a few changes were made to better recover
from errors.
2023-12-18 18:53:37 -08:00
erichkeane
731361cd15 [OpenACC] Fix bug with directive name being a 'special token'
If the 'directive name' is a special token instead of an identifier, we
end up asserting.  This fixes that.
2023-12-08 09:32:49 -08:00
erichkeane
26f8e1461e [OpenACC] NFC: Stop using 'getSpelling' while parsing OpenACC
It was brought up during the cache review that we shouldn't be using
'getSpelling', and instead should use the IdentifierInfo itself.  This
patch replaces all uses of it.
2023-12-06 07:12:01 -08:00
Erich Keane
ba1c869f00
[OpenACC] Implement 'routine' construct parsing (#73143)
The 'routine' construct applies either to a function directly, or, when
provided a name, applies to the function named (and is visible in the
current scope). This patch implements the parsing for this.  The
identifier provided (or Id Expression) is required to be a valid,
declared identifier, though the semantic analysis portion of the Routine
directive will need to enforce it being a function/overload set.
2023-11-27 06:49:29 -08:00
Erich Keane
04e9b61cec
[OpenACC] Implement Atomic construct variants (#73015)
`atomic` is required to be followed by a special `atomic clause`, so
this patch manages the parsing of that. We are representing each of the
variants of the atomic construct as separate kinds, because they have
distinct rules/application/etc, and this should make it easier to check
rules in the future.
2023-11-21 11:08:48 -08:00
Erich Keane
147b38b146
[OpenACC] Implement enter data/exit data construct parsing (#72916)
These two constructs, 'enter data' and 'exit data', are novel compared
to what is currently in the parser, as this is the first set implemented
where the first token is itself not a valid construct. Because of this,
it requires some additional work to do the first keyword parsing.
2023-11-21 07:46:12 -08:00
Erich Keane
70f4102254
[OpenACC] Implement compound construct parsing (#72692)
This patch implements the compound construct parsing, which allows
'parallel loop', 'serial loop', and 'kernel loop' to act as their own
constructs.
2023-11-20 11:46:07 -08:00
erichkeane
6168337640 [OpenACC] Handle lack of construct/directive
Discovered while working on another patch, this patch fixes the case
where are construct/directive name isn't provided.
2023-11-17 13:48:50 -08:00
erichkeane
9bd5f808cc [OpenACC] Implement 'trivial' construct/directive parsing.
Now that the `parallel` support has landed, add the other 'trivial' to
implement ones that don't require any additional work other than adding
them to the StringSwitch.
2023-11-17 11:26:22 -08:00
Erich Keane
64b6ef02e2
[OpenACC] Implement initial parsing for parallel construct (#72661)
As the first real parsing effort for the OpenACC implementation effort,
this implements the parsing for first construct/directive name. This
does not do any semantic analysis, nor any of the clauses. Those will
come in a future patch.

For the time being, we warn when we hit a point that we don't implement
the parsing for either of these situations.
2023-11-17 10:47:42 -08:00