ABataev added inline comments.

================
Comment at: clang/lib/Sema/SemaOpenMP.cpp:23106
+class GlobalDeclRefChecker final
+    : public ConstStmtVisitor<GlobalDeclRefChecker> {
+  SmallVector<VarDecl *> DeclVector;
----------------
Use just a StmtVisitor, if you still dropping const modifier.


================
Comment at: clang/lib/Sema/SemaOpenMP.cpp:23114
+  void VisitDeclRefExpr(const DeclRefExpr *Node) {
+    if (auto *VD = const_cast<VarDecl *>(dyn_cast<VarDecl>(Node->getDecl()))) {
+      VD->addAttr(A);
----------------
remove const_cast


================
Comment at: clang/lib/Sema/SemaOpenMP.cpp:23131
+    A = TD->getAttr<OMPDeclareTargetDeclAttr>();
+    DeclVector.push_back(dyn_cast<VarDecl>(TD));
+    while (!DeclVector.empty()) {
----------------
You don't need to use dyn_cast here, use just cast


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