[clang] [OpenACC] Implement 'cache' construct parsing (PR #74324)

Alexey Bataev via cfe-commits cfe-commits at lists.llvm.org
Tue Dec 5 06:57:24 PST 2023


================
@@ -298,7 +367,18 @@ void Parser::ParseOpenACCDirective() {
         T.consumeClose();
       break;
     }
+    case OpenACCDirectiveKind::Cache:
+      ParseOpenACCCacheVarList();
+      // The ParseOpenACCCacheVarList function manages to recover from failures,
+      // so we can always consume the close.
+      T.consumeClose();
+      break;
     }
+  } else if (DirKind == OpenACCDirectiveKind::Cache) {
+    // Cache's paren var-list is required, so error here if it isn't provided.
+    // We know that the consumeOpen above left the first non-paren here, so use
+    // expectAndConsume to emit the proper dialog, then continue.
+    (void)T.expectAndConsume();
----------------
alexey-bataev wrote:

Ah, ok, I see. Yes, I think better explicitly diagnose missed '(' here

https://github.com/llvm/llvm-project/pull/74324


More information about the cfe-commits mailing list