[PATCH] D123235: [OpenMP] atomic compare fail : Parser & AST support

Alexey Bataev via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Oct 18 03:23:42 PDT 2023


ABataev added inline comments.


================
Comment at: clang/include/clang/AST/ASTNodeTraverser.h:217-220
+    if (const auto *OMPC = dyn_cast<OMPFailClause>(C)) {
+      Visit(OMPC);
+      return;
+    }
----------------
Why do you need special logic here?


================
Comment at: clang/include/clang/AST/OpenMPClause.h:2320
+
+  OMPClause *MemoryOrderClause = nullptr;
+  OpenMPClauseKind FailParameter = llvm::omp::OMPC_unknown;
----------------
That's not the best decision, better to make this kind of clause a base class for these new class.


================
Comment at: clang/include/clang/AST/OpenMPClause.h:2373
+                SourceLocation StartLoc, SourceLocation LParenLoc,
+		SourceLocation EndLoc)
+      : OMPClause(llvm::omp::OMPC_fail, StartLoc, EndLoc), ArgumentLoc(ArgumentLoc), LParenLoc(LParenLoc)  {
----------------
Formatting


================
Comment at: clang/include/clang/AST/OpenMPClause.h:2429
+
+  const OMPClause *const_getMemoryOrderClause() const {
+    return static_cast<const OMPClause *>(MemoryOrderClause);
----------------
No need for const_ prefix in the name


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D123235/new/

https://reviews.llvm.org/D123235



More information about the cfe-commits mailing list