[PATCH] D146418: Support for OpenMP 5.0 sec 2.12.7 - Declare Target initializer expressions

Alexey Bataev via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed May 10 09:30:54 PDT 2023


ABataev added inline comments.


================
Comment at: clang/lib/Sema/SemaOpenMP.cpp:23106-23107
+         it != Ex->child_end(); ++it) {
+      if (isa<Expr>(*it))
+        VisitExpr(dyn_cast<Expr>(*it));
+      if (isa<DeclRefExpr>(*it))
----------------
Why just a regular Visit does not work here? Plus, isa + dyn_cast is weird.


================
Comment at: clang/lib/Sema/SemaOpenMP.cpp:23094-23095
+public:
+  SmallVector<Decl *> DeclVector;
+  Decl *TargetDecl;
+  void VisitDeclRefExpr(const DeclRefExpr *Node) {
----------------
RitanyaB wrote:
> ABataev wrote:
> > Why public?
> As the data members are accessed from outside the class (in ActOnOpenMPImplicitDeclareTarget function), I have made them public.  
If you need them, implement getters for them and make them private.


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

https://reviews.llvm.org/D146418



More information about the cfe-commits mailing list