[clang] [OpenACC] Implement Atomic construct variants (PR #73015)
Erich Keane via cfe-commits
cfe-commits at lists.llvm.org
Tue Nov 21 10:01:02 PST 2023
================
@@ -59,9 +60,21 @@ OpenACCDirectiveKindEx getOpenACCDirectiveKind(StringRef Name) {
return llvm::StringSwitch<OpenACCDirectiveKindEx>(Name)
.Case("enter", OpenACCDirectiveKindEx::Enter)
.Case("exit", OpenACCDirectiveKindEx::Exit)
+ .Case("atomic", OpenACCDirectiveKindEx::Atomic)
.Default(OpenACCDirectiveKindEx::Invalid);
}
+// Since 'atomic' is effectively a compound directive, this will decode the
+// second part of the directive.
+OpenACCDirectiveKind getOpenACCAtomicDirectiveKind(StringRef Name) {
+ return llvm::StringSwitch<OpenACCDirectiveKind>(Name)
+ .Case("read", OpenACCDirectiveKind::AtomicRead)
+ .Case("write", OpenACCDirectiveKind::AtomicWrite)
+ .Case("update", OpenACCDirectiveKind::AtomicUpdate)
+ .Case("capture", OpenACCDirectiveKind::AtomicCapture)
----------------
erichkeane wrote:
Ok, i've refactored this to treat the 'atomic-clause' no longer as a directive, and we'll see what the fallout of that ends up being.
https://github.com/llvm/llvm-project/pull/73015
More information about the cfe-commits
mailing list