Lines Matching refs:VD
329 ValueDecl *VD, bool CurrentRegionOnly, in checkMappableExprComponentListsForDecl() argument
345 auto MI = SI->MappedExprComponents.find(VD); in checkMappableExprComponentListsForDecl()
357 ValueDecl *VD, in addMappableExpressionComponents() argument
361 auto &MEC = Stack.back().MappedExprComponents[VD]; in addMappableExpressionComponents()
394 auto *VD = dyn_cast<VarDecl>(D); in getCanonicalDecl() local
396 if (VD != nullptr) { in getCanonicalDecl()
397 VD = VD->getCanonicalDecl(); in getCanonicalDecl()
398 D = VD; in getCanonicalDecl()
410 auto *VD = dyn_cast<VarDecl>(D); in getDSA() local
419 if (VD && !VD->isFunctionOrMethodVarDecl() && !isa<ParmVarDecl>(D)) in getDSA()
426 if (VD && VD->hasGlobalStorage()) in getDSA()
441 if (VD && isOpenMPLocal(VD, Iter) && VD->isLocalVarDecl() && in getDSA()
442 (VD->getStorageClass() == SC_Auto || VD->getStorageClass() == SC_None)) { in getDSA()
651 auto *VD = dyn_cast<VarDecl>(D); in getTopDSA() local
652 if ((VD && VD->getTLSKind() != VarDecl::TLS_None && in getTopDSA()
653 !(VD->hasAttr<OMPThreadPrivateDeclAttr>() && in getTopDSA()
656 (VD && VD->getStorageClass() == SC_Register && in getTopDSA()
657 VD->hasAttr<AsmLabelAttr>() && !VD->isLocalVarDecl())) { in getTopDSA()
658 addDSA(D, buildDeclRefExpr(SemaRef, VD, D->getType().getNonReferenceType(), in getTopDSA()
681 if (VD && VD->isStaticDataMember()) { in getTopDSA()
991 auto *VD = dyn_cast<VarDecl>(D); in IsOpenMPCapturedDecl() local
992 if (VD && !VD->hasLocalStorage()) { in IsOpenMPCapturedDecl()
995 return VD; in IsOpenMPCapturedDecl()
1002 return VD; in IsOpenMPCapturedDecl()
1010 (VD && VD->hasLocalStorage() && in IsOpenMPCapturedDecl()
1012 (VD && DSAStack->isForceVarCapturing())) in IsOpenMPCapturedDecl()
1013 return VD ? VD : Info.second; in IsOpenMPCapturedDecl()
1016 return VD ? VD : cast<VarDecl>(DVarPrivate.PrivateCopy->getDecl()); in IsOpenMPCapturedDecl()
1021 return VD ? VD : cast<VarDecl>(DVarPrivate.PrivateCopy->getDecl()); in IsOpenMPCapturedDecl()
1036 auto *VD = dyn_cast<VarDecl>(D); in isOpenMPTargetCapturedDecl() local
1037 return VD && !VD->hasLocalStorage() && in isOpenMPTargetCapturedDecl()
1075 VarDecl *VD = cast<VarDecl>(DRE->getDecl()); in EndOpenMPDSABlock() local
1076 QualType Type = VD->getType().getNonReferenceType(); in EndOpenMPDSABlock()
1077 auto DVar = DSAStack->getTopDSA(VD, false); in EndOpenMPDSABlock()
1086 VD->getName(), VD->hasAttrs() ? &VD->getAttrs() : nullptr); in EndOpenMPDSABlock()
1124 if (VarDecl *VD = dyn_cast_or_null<VarDecl>(ND)) { in ValidateCandidate() local
1125 return VD->hasGlobalStorage() && in ValidateCandidate()
1160 VarDecl *VD; in ActOnOpenMPIdExpression() local
1170 VD = Corrected.getCorrectionDeclAs<VarDecl>(); in ActOnOpenMPIdExpression()
1178 if (!(VD = Lookup.getAsSingle<VarDecl>())) { in ActOnOpenMPIdExpression()
1188 if (!VD->hasGlobalStorage()) { in ActOnOpenMPIdExpression()
1190 << getOpenMPDirectiveName(OMPD_threadprivate) << !VD->isStaticLocal(); in ActOnOpenMPIdExpression()
1192 VD->isThisDeclarationADefinition(Context) == VarDecl::DeclarationOnly; in ActOnOpenMPIdExpression()
1193 Diag(VD->getLocation(), in ActOnOpenMPIdExpression()
1195 << VD; in ActOnOpenMPIdExpression()
1199 VarDecl *CanonicalVD = VD->getCanonicalDecl(); in ActOnOpenMPIdExpression()
1207 << getOpenMPDirectiveName(OMPD_threadprivate) << VD; in ActOnOpenMPIdExpression()
1209 VD->isThisDeclarationADefinition(Context) == VarDecl::DeclarationOnly; in ActOnOpenMPIdExpression()
1210 Diag(VD->getLocation(), in ActOnOpenMPIdExpression()
1212 << VD; in ActOnOpenMPIdExpression()
1222 << getOpenMPDirectiveName(OMPD_threadprivate) << VD; in ActOnOpenMPIdExpression()
1224 VD->isThisDeclarationADefinition(Context) == VarDecl::DeclarationOnly; in ActOnOpenMPIdExpression()
1225 Diag(VD->getLocation(), in ActOnOpenMPIdExpression()
1227 << VD; in ActOnOpenMPIdExpression()
1238 << getOpenMPDirectiveName(OMPD_threadprivate) << VD; in ActOnOpenMPIdExpression()
1240 VD->isThisDeclarationADefinition(Context) == VarDecl::DeclarationOnly; in ActOnOpenMPIdExpression()
1241 Diag(VD->getLocation(), in ActOnOpenMPIdExpression()
1243 << VD; in ActOnOpenMPIdExpression()
1252 << getOpenMPDirectiveName(OMPD_threadprivate) << VD; in ActOnOpenMPIdExpression()
1254 VD->isThisDeclarationADefinition(Context) == VarDecl::DeclarationOnly; in ActOnOpenMPIdExpression()
1255 Diag(VD->getLocation(), in ActOnOpenMPIdExpression()
1257 << VD; in ActOnOpenMPIdExpression()
1264 if (VD->isUsed() && !DSAStack->isThreadPrivate(VD)) { in ActOnOpenMPIdExpression()
1266 << getOpenMPDirectiveName(OMPD_threadprivate) << VD; in ActOnOpenMPIdExpression()
1270 QualType ExprType = VD->getType().getNonReferenceType(); in ActOnOpenMPIdExpression()
1272 SourceLocation(), VD, in ActOnOpenMPIdExpression()
1293 if (auto VD = dyn_cast<VarDecl>(E->getDecl())) { in VisitDeclRefExpr() local
1294 if (VD->hasLocalStorage()) { in VisitDeclRefExpr()
1298 SemaRef.Diag(VD->getLocation(), diag::note_defined_here) in VisitDeclRefExpr()
1299 << VD << VD->getSourceRange(); in VisitDeclRefExpr()
1321 VarDecl *VD = cast<VarDecl>(DE->getDecl()); in CheckOMPThreadPrivateDecl() local
1325 VD->setReferenced(); in CheckOMPThreadPrivateDecl()
1326 VD->markUsed(Context); in CheckOMPThreadPrivateDecl()
1328 QualType QType = VD->getType(); in CheckOMPThreadPrivateDecl()
1337 if (RequireCompleteType(ILoc, VD->getType(), in CheckOMPThreadPrivateDecl()
1344 if (VD->getType()->isReferenceType()) { in CheckOMPThreadPrivateDecl()
1346 << getOpenMPDirectiveName(OMPD_threadprivate) << VD->getType(); in CheckOMPThreadPrivateDecl()
1348 VD->isThisDeclarationADefinition(Context) == VarDecl::DeclarationOnly; in CheckOMPThreadPrivateDecl()
1349 Diag(VD->getLocation(), in CheckOMPThreadPrivateDecl()
1351 << VD; in CheckOMPThreadPrivateDecl()
1357 if ((VD->getTLSKind() != VarDecl::TLS_None && in CheckOMPThreadPrivateDecl()
1358 !(VD->hasAttr<OMPThreadPrivateDeclAttr>() && in CheckOMPThreadPrivateDecl()
1361 (VD->getStorageClass() == SC_Register && VD->hasAttr<AsmLabelAttr>() && in CheckOMPThreadPrivateDecl()
1362 !VD->isLocalVarDecl())) { in CheckOMPThreadPrivateDecl()
1364 << VD << ((VD->getTLSKind() != VarDecl::TLS_None) ? 0 : 1); in CheckOMPThreadPrivateDecl()
1366 VD->isThisDeclarationADefinition(Context) == VarDecl::DeclarationOnly; in CheckOMPThreadPrivateDecl()
1367 Diag(VD->getLocation(), in CheckOMPThreadPrivateDecl()
1369 << VD; in CheckOMPThreadPrivateDecl()
1375 if (auto Init = VD->getAnyInitializer()) { in CheckOMPThreadPrivateDecl()
1382 DSAStack->addDSA(VD, DE, OMPC_threadprivate); in CheckOMPThreadPrivateDecl()
1383 VD->addAttr(OMPThreadPrivateDeclAttr::CreateImplicit( in CheckOMPThreadPrivateDecl()
1386 ML->DeclarationMarkedOpenMPThreadPrivate(VD); in CheckOMPThreadPrivateDecl()
1419 auto *VD = dyn_cast<VarDecl>(D); in ReportOriginalDSA() local
1431 } else if (VD && VD->isStaticLocal()) in ReportOriginalDSA()
1433 else if (VD && VD->isStaticDataMember()) in ReportOriginalDSA()
1435 else if (VD && VD->isFileVarDecl()) in ReportOriginalDSA()
1439 else if (VD && VD->isLocalVarDecl() && DVar.CKind == OMPC_private) { in ReportOriginalDSA()
1467 if (auto *VD = dyn_cast<VarDecl>(E->getDecl())) { in VisitDeclRefExpr() local
1469 if (VD->isLocalVarDecl() && !CS->capturesVariable(VD)) in VisitDeclRefExpr()
1472 auto DVar = Stack->getTopDSA(VD, false); in VisitDeclRefExpr()
1484 VarsWithInheritedDSA.count(VD) == 0) { in VisitDeclRefExpr()
1485 VarsWithInheritedDSA[VD] = E; in VisitDeclRefExpr()
1494 VD, [](OpenMPClauseKind C) -> bool { return C == OMPC_reduction; }, in VisitDeclRefExpr()
1503 ReportOriginalDSA(SemaRef, Stack, VD, DVar); in VisitDeclRefExpr()
1508 DVar = Stack->getImplicitDSA(VD, false); in VisitDeclRefExpr()
1510 !Stack->isLoopControlVariable(VD).first) in VisitDeclRefExpr()
1755 if (auto *VD = S.IsOpenMPCapturedDecl(D)) in buildCapture() local
1756 CD = cast<OMPCapturedExprDecl>(VD); in buildCapture()
4197 if (auto *VD = dyn_cast<VarDecl>(DRE->getDecl())) { in GetInitLCDecl() local
4198 if (auto *CED = dyn_cast<OMPCapturedExprDecl>(VD)) in GetInitLCDecl()
4201 return getCanonicalDecl(VD); in GetInitLCDecl()
4518 auto *VD = dyn_cast<VarDecl>(LCDecl); in BuildCounterVar() local
4519 if (!VD) { in BuildCounterVar()
4520 VD = SemaRef.IsOpenMPCapturedDecl(LCDecl); in BuildCounterVar()
4522 SemaRef, VD, VD->getType().getNonReferenceType(), DefaultLoc); in BuildCounterVar()
4530 return buildDeclRefExpr(SemaRef, VD, VD->getType().getNonReferenceType(), in BuildCounterVar()
4590 auto *VD = dyn_cast<VarDecl>(D); in ActOnOpenMPLoopInitialization() local
4591 if (!VD) { in ActOnOpenMPLoopInitialization()
4593 VD = Private; in ActOnOpenMPLoopInitialization()
4597 VD = cast<VarDecl>(Ref->getDecl()); in ActOnOpenMPLoopInitialization()
4600 DSAStack->addLoopControlVariable(D, VD); in ActOnOpenMPLoopInitialization()
5281 auto *VD = cast<VarDecl>(cast<DeclRefExpr>(IS.CounterVar)->getDecl()); in CheckOpenMPLoop() local
5282 auto *CounterVar = buildDeclRefExpr(SemaRef, VD, IS.CounterVar->getType(), in CheckOpenMPLoop()
8223 auto *VD = dyn_cast<VarDecl>(D); in ActOnOpenMPPrivateClause() local
8254 !VD || in ActOnOpenMPPrivateClause()
8255 VD->isThisDeclarationADefinition(Context) == VarDecl::DeclarationOnly; in ActOnOpenMPPrivateClause()
8267 VD, /* CurrentRegionOnly = */ true, in ActOnOpenMPPrivateClause()
8297 if (!VD && !CurContext->isDependentContext()) in ActOnOpenMPPrivateClause()
8300 Vars.push_back((VD || CurContext->isDependentContext()) in ActOnOpenMPPrivateClause()
8366 auto *VD = dyn_cast<VarDecl>(D); in ActOnOpenMPFirstprivateClause() local
8412 if (!(IsConstant || (VD && VD->isStaticDataMember())) && !DVar.RefExpr && in ActOnOpenMPFirstprivateClause()
8518 VD, /* CurrentRegionOnly = */ true, in ActOnOpenMPFirstprivateClause()
8537 !VD || in ActOnOpenMPFirstprivateClause()
8538 VD->isThisDeclarationADefinition(Context) == VarDecl::DeclarationOnly; in ActOnOpenMPFirstprivateClause()
8597 if (!VD && !CurContext->isDependentContext()) { in ActOnOpenMPFirstprivateClause()
8607 Vars.push_back((VD || CurContext->isDependentContext()) in ActOnOpenMPFirstprivateClause()
8650 auto *VD = dyn_cast<VarDecl>(D); in ActOnOpenMPLastprivateClause() local
8738 if (!VD && !CurContext->isDependentContext()) { in ActOnOpenMPLastprivateClause()
8762 Vars.push_back((VD || CurContext->isDependentContext()) in ActOnOpenMPLastprivateClause()
8798 auto *VD = dyn_cast<VarDecl>(D); in ActOnOpenMPSharedClause() local
8816 if (!VD && IsOpenMPCapturedDecl(D) && !CurContext->isDependentContext()) in ActOnOpenMPSharedClause()
8819 Vars.push_back((VD || !Ref || CurContext->isDependentContext()) in ActOnOpenMPSharedClause()
8836 if (VarDecl *VD = dyn_cast<VarDecl>(E->getDecl())) { in VisitDeclRefExpr() local
8837 DSAStackTy::DSAVarData DVar = Stack->getTopDSA(VD, false); in VisitDeclRefExpr()
8843 VD, isOpenMPPrivate, [](OpenMPDirectiveKind) -> bool { return true; }, in VisitDeclRefExpr()
8951 if (auto *VD = filterLookupForUDR<ValueDecl *>( in buildDeclareReductionRef() local
8958 return SemaRef.BuildDeclRefExpr(VD, Ty, VK_LValue, Loc); in buildDeclareReductionRef()
8959 if (auto *VD = filterLookupForUDR<ValueDecl *>( in buildDeclareReductionRef() local
8969 if (SemaRef.IsDerivedFrom(Loc, Ty, VD->getType(), Paths)) { in buildDeclareReductionRef()
8971 VD->getType().getUnqualifiedType()))) { in buildDeclareReductionRef()
8972 if (SemaRef.CheckBaseClassAccess(Loc, VD->getType(), Ty, Paths.front(), in buildDeclareReductionRef()
8976 return SemaRef.BuildDeclRefExpr(VD, Ty, VK_LValue, Loc); in buildDeclareReductionRef()
9144 auto *VD = dyn_cast<VarDecl>(D); in ActOnOpenMPReductionClause() local
9159 bool IsDecl = !VD || in ActOnOpenMPReductionClause()
9160 VD->isThisDeclarationADefinition(Context) == in ActOnOpenMPReductionClause()
9171 if (!ASE && !OASE && VD) { in ActOnOpenMPReductionClause()
9172 VarDecl *VDDef = VD->getDefinition(); in ActOnOpenMPReductionClause()
9173 if (VD->getType()->isReferenceType() && VDDef) { in ActOnOpenMPReductionClause()
9267 bool IsDecl = !VD || in ActOnOpenMPReductionClause()
9268 VD->isThisDeclarationADefinition(Context) == in ActOnOpenMPReductionClause()
9280 bool IsDecl = !VD || in ActOnOpenMPReductionClause()
9281 VD->isThisDeclarationADefinition(Context) == in ActOnOpenMPReductionClause()
9441 !VD || in ActOnOpenMPReductionClause()
9442 VD->isThisDeclarationADefinition(Context) == VarDecl::DeclarationOnly; in ActOnOpenMPReductionClause()
9502 if (!VD && !CurContext->isDependentContext()) { in ActOnOpenMPReductionClause()
9559 auto *VD = dyn_cast_or_null<VarDecl>(D); in CheckOpenMPLinearDecl() local
9577 !VD || in CheckOpenMPLinearDecl()
9578 VD->isThisDeclarationADefinition(Context) == VarDecl::DeclarationOnly; in CheckOpenMPLinearDecl()
9594 !VD || in CheckOpenMPLinearDecl()
9595 VD->isThisDeclarationADefinition(Context) == VarDecl::DeclarationOnly; in CheckOpenMPLinearDecl()
9634 auto *VD = dyn_cast<VarDecl>(D); in ActOnOpenMPLinearClause() local
9660 if (!VD && !CurContext->isDependentContext()) { in ActOnOpenMPLinearClause()
9679 InitExpr = VD ? VD->getInit() : SimpleRefExpr; in ActOnOpenMPLinearClause()
9681 InitExpr = VD ? SimpleRefExpr : Ref; in ActOnOpenMPLinearClause()
9687 Vars.push_back((VD || CurContext->isDependentContext()) in ActOnOpenMPLinearClause()
9847 auto *VD = dyn_cast<VarDecl>(D); in ActOnOpenMPAlignedClause() local
9858 !VD || in ActOnOpenMPAlignedClause()
9859 VD->isThisDeclarationADefinition(Context) == VarDecl::DeclarationOnly; in ActOnOpenMPAlignedClause()
9876 if (!VD && IsOpenMPCapturedDecl(D)) in ActOnOpenMPAlignedClause()
9879 (VD || !Ref) ? RefExpr->IgnoreParens() : Ref) in ActOnOpenMPAlignedClause()
9934 VarDecl *VD = cast<VarDecl>(D); in ActOnOpenMPCopyinClause() local
9936 QualType Type = VD->getType(); in ActOnOpenMPCopyinClause()
9948 if (!DSAStack->isThreadPrivate(VD)) { in ActOnOpenMPCopyinClause()
9962 ".copyin.src", VD->hasAttrs() ? &VD->getAttrs() : nullptr); in ActOnOpenMPCopyinClause()
9967 VD->hasAttrs() ? &VD->getAttrs() : nullptr); in ActOnOpenMPCopyinClause()
9981 DSAStack->addDSA(VD, DE, OMPC_copyin); in ActOnOpenMPCopyinClause()
10022 auto *VD = dyn_cast<VarDecl>(D); in ActOnOpenMPCopyprivateClause() local
10027 if (!VD || !DSAStack->isThreadPrivate(VD)) { in ActOnOpenMPCopyprivateClause()
10059 !VD || in ActOnOpenMPCopyprivateClause()
10060 VD->isThisDeclarationADefinition(Context) == VarDecl::DeclarationOnly; in ActOnOpenMPCopyprivateClause()
10093 assert(VD || IsOpenMPCapturedDecl(D)); in ActOnOpenMPCopyprivateClause()
10095 VD ? RefExpr->IgnoreParens() in ActOnOpenMPCopyprivateClause()
10316 } else if (auto *VD = dyn_cast<VarDecl>(I)) { in IsCXXRecordForMappable() local
10317 if (VD->isStaticDataMember()) { in IsCXXRecordForMappable()
10319 SemaRef.Diag(VD->getLocation(), in IsCXXRecordForMappable()
10651 Sema &SemaRef, DSAStackTy *DSAS, ValueDecl *VD, Expr *E, in CheckMapConflicts() argument
10655 assert(VD && E); in CheckMapConflicts()
10664 assert(CurComponents.back().getAssociatedDeclaration() == VD && in CheckMapConflicts()
10672 VD, CurrentRegionOnly, in CheckMapConflicts()
10678 assert(StackComponents.back().getAssociatedDeclaration() == VD && in CheckMapConflicts()
10930 auto *VD = dyn_cast<VarDecl>(CurDeclaration); in checkMappableExpressionList() local
10933 assert((VD || FD) && "Only variables or fields are expected here!"); in checkMappableExpressionList()
10940 if (VD && DSAS->isThreadPrivate(VD)) { in checkMappableExpressionList()
10941 auto DVar = DSAS->getTopDSA(VD, false); in checkMappableExpressionList()
10944 ReportOriginalDSA(SemaRef, DSAS, VD, DVar); in checkMappableExpressionList()
11010 if (DKind == OMPD_target && VD) { in checkMappableExpressionList()
11011 auto DVar = DSAS->getTopDSA(VD, false); in checkMappableExpressionList()
11608 ValueDecl *VD) { in checkValueDeclInTarget() argument
11609 if (VD->hasAttr<OMPDeclareTargetDeclAttr>()) in checkValueDeclInTarget()
11611 if (!CheckTypeMappable(SL, SR, SemaRef, Stack, VD->getType())) in checkValueDeclInTarget()
11622 if (VarDecl *VD = dyn_cast<VarDecl>(D)) { in checkDeclIsAllowedInOpenMPTarget() local
11623 if (DSAStack->isThreadPrivate(VD)) { in checkDeclIsAllowedInOpenMPTarget()
11625 ReportOriginalDSA(*this, DSAStack, VD, DSAStack->getTopDSA(VD, false)); in checkDeclIsAllowedInOpenMPTarget()
11629 if (ValueDecl *VD = dyn_cast<ValueDecl>(D)) { in checkDeclIsAllowedInOpenMPTarget() local
11632 if ((E || !VD->getType()->isIncompleteType()) && in checkDeclIsAllowedInOpenMPTarget()
11633 !checkValueDeclInTarget(SL, SR, *this, DSAStack, VD)) { in checkDeclIsAllowedInOpenMPTarget()
11635 if (isa<VarDecl>(VD) || isa<FunctionDecl>(VD)) { in checkDeclIsAllowedInOpenMPTarget()
11638 VD->addAttr(A); in checkDeclIsAllowedInOpenMPTarget()
11640 ML->DeclarationMarkedOpenMPDeclareTarget(VD, A); in checkDeclIsAllowedInOpenMPTarget()