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

Shilei Tian via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon May 2 18:01:31 PDT 2022


tianshilei1992 added inline comments.


================
Comment at: clang/include/clang/AST/ASTNodeTraverser.h:217
   void Visit(const OMPClause *C) {
+    if(OMPFailClause::classof(C)) {
+      Visit(static_cast<const OMPFailClause *>(C));
----------------
clang-format plz.


================
Comment at: clang/include/clang/AST/ASTNodeTraverser.h:228
 
+  void Visit(const OMPFailClause *C) {
+    getNodeDelegate().AddChild([=] {
----------------
Why would we want a dedicated function since it is only called once?


================
Comment at: clang/include/clang/AST/OpenMPClause.h:2308-2317
+  /// Sets the mem_order clause for 'atomic compare fail' directive.
+  void setMemOrderClause(OMPClause *MemoryOrderClauseParam) {
+    MemoryOrderClause = MemoryOrderClauseParam;
+  }
+public:
+  /// Build 'fail' clause.
+  ///
----------------



================
Comment at: clang/include/clang/AST/OpenMPClause.h:2350
+
+  void
+  initFailClause(SourceLocation LParenLoc,
----------------
clang-format plz


================
Comment at: clang/include/clang/AST/OpenMPClause.h:2352
+  initFailClause(SourceLocation LParenLoc,
+                 OMPClause *memOClause,
+                 SourceLocation MemOrderLoc) {
----------------
Please refer to https://llvm.org/docs/CodingStandards.html for variable naming style, etc.


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

https://reviews.llvm.org/D123235



More information about the cfe-commits mailing list