[clang] [OpenACC] Implement enter data/exit data construct parsing (PR #72916)
Alexey Bataev via cfe-commits
cfe-commits at lists.llvm.org
Tue Nov 21 04:17:44 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);
+ }
----------------
alexey-bataev wrote:
All branches have return statement. Looks like the rest of the code in the function is dead.
https://github.com/llvm/llvm-project/pull/72916
More information about the cfe-commits
mailing list