================ @@ -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 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits