RitanyaB added inline comments.
================ Comment at: clang/lib/Parse/ParseDecl.cpp:2093-2115 +void ParseImplicitDeclareTargetAttr(Decl *TargetDecl) { + if (TargetDecl && TargetDecl->hasAttr<OMPDeclareTargetDeclAttr>() && + isa<VarDecl>(TargetDecl)) { + VarDecl *TargetVarDecl = cast<VarDecl>(TargetDecl); + Expr *Ex = TargetVarDecl->getInit()->IgnoreCasts(); + const DeclRefExpr *DeclRef = nullptr; + if (Ex && isa<UnaryOperator>(Ex) && TargetVarDecl->hasGlobalStorage()) { ---------------- ABataev wrote: > RitanyaB wrote: > > ABataev wrote: > > > It has nothing to do with parsing, sema analysis. Make it part of > > > Sema::checkDeclIsAllowedInOpenMPTarget > > The Declaration in Sema::checkDeclIsAllowedInOpenMPTarget is incomplete. > > > > ``` > > VarDecl 0x1582b278 <test3.c:6:1, col:7> col:7 ptr1 'int **' > > `-OMPDeclareTargetDeclAttr 0x1582b2e0 <line:5:21> Implicit MT_To DT_Any 1 > > `-<<<NULL>>> > > > > ``` > > At this point, I do not have access to the initializer expression. Any > > suggestions? > The try to do it ActOnOpenMPDeclareTargetName In the absence of a declare target clause, this function is not invoked (in the examples used above, the function is never called). Do you have any suggestions? Repository: rG LLVM Github Monorepo 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