[clang] [OpenACC] Implement Atomic construct variants (PR #73015)
Alexey Bataev via cfe-commits
cfe-commits at lists.llvm.org
Tue Nov 21 09:31:01 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)
----------------
alexey-bataev wrote:
I think this may cause problems in future, if new combinations of clauses will appear. It will be very hard to redesign it to represent the new clauses as directives-kind (especially if the new clauses will support non-strict use order).
https://github.com/llvm/llvm-project/pull/73015
More information about the cfe-commits
mailing list