[clang] [OpenACC] Implement enter data/exit data construct parsing (PR #72916)
Erich Keane via cfe-commits
cfe-commits at lists.llvm.org
Tue Nov 21 06:53:52 PST 2023
================
@@ -91,10 +140,19 @@ OpenACCDirectiveKind ParseOpenACCDirectiveKind(Parser &P) {
P.ConsumeToken();
std::string FirstTokSpelling = P.getPreprocessor().getSpelling(FirstTok);
- OpenACCDirectiveKind DirKind = getOpenACCDirectiveKind(FirstTokSpelling);
+ OpenACCDirectiveKindEx ExDirKind = getOpenACCDirectiveKind(FirstTokSpelling);
+
+ switch (ExDirKind) {
+ case OpenACCDirectiveKindEx::Invalid:
+ P.Diag(FirstTok, diag::err_acc_invalid_directive) << 0 << FirstTokSpelling;
+ return OpenACCDirectiveKind::Invalid;
+ case OpenACCDirectiveKindEx::Enter:
+ case OpenACCDirectiveKindEx::Exit:
+ return ParseOpenACCEnterExitDataDirective(P, FirstTok, FirstTokSpelling,
+ ExDirKind);
+ }
----------------
erichkeane wrote:
Ah, thats a really good idea! I was trying to figure out a good way to make it clear what is going on here.
https://github.com/llvm/llvm-project/pull/72916
More information about the cfe-commits
mailing list