ABataev added inline comments.

================
Comment at: clang/lib/Sema/SemaDecl.cpp:14475-14477
+          VD->hasGlobalStorage()) {
+        ActOnOpenMPDeclareTargetInitializer(D);
+      }
----------------
Remove braces


================
Comment at: clang/lib/Sema/SemaOpenMP.cpp:23091
 
+class GlobalDeclRefChecker final
+    : public ConstStmtVisitor<GlobalDeclRefChecker> {
----------------
Please, add comments, describing the class and its functionality


================
Comment at: clang/lib/Sema/SemaOpenMP.cpp:23095
+  Decl *TargetDecl;
+  void SetTargetDecl(Decl *TD) { TargetDecl = TD; }
+  bool CheckDeclVector() { return DeclVector.empty(); }
----------------
setTargetDecl


================
Comment at: clang/lib/Sema/SemaOpenMP.cpp:23096
+  void SetTargetDecl(Decl *TD) { TargetDecl = TD; }
+  bool CheckDeclVector() { return DeclVector.empty(); }
+  void pushDecl(VarDecl *TargetVarDecl) { DeclVector.push_back(TargetVarDecl); 
}
----------------
1. checkDeclVector
2. const member function


================
Comment at: clang/lib/Sema/SemaOpenMP.cpp:23098
+  void pushDecl(VarDecl *TargetVarDecl) { DeclVector.push_back(TargetVarDecl); 
}
+  VarDecl *popDecl() { return DeclVector.pop_back_val(); }
+
----------------
const member function


================
Comment at: clang/lib/Sema/SemaOpenMP.cpp:23104
+      VD->addAttr(this->TargetDecl->getAttr<OMPDeclareTargetDeclAttr>());
+      this->pushDecl(VD);
+    }
----------------
Remove this->


================
Comment at: clang/lib/Sema/SemaOpenMP.cpp:23113
+  }
+  void DeclTargetInitializer(Decl *TD) {
+    SetTargetDecl(TD);
----------------
1. Better to make it static member function.
2. Follow the rules for function names.


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

https://reviews.llvm.org/D146418

_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to