Lines Matching refs:VD
134 const ValueDecl *VD = Pair.second; in buildRecordForGlobalizedVars() local
135 QualType Type = VD->getType(); in buildRecordForGlobalizedVars()
140 SourceLocation Loc = VD->getLocation(); in buildRecordForGlobalizedVars()
142 if (SingleEscaped.count(VD)) { in buildRecordForGlobalizedVars()
144 C, GlobalizedRD, Loc, Loc, VD->getIdentifier(), Type, in buildRecordForGlobalizedVars()
149 if (VD->hasAttrs()) { in buildRecordForGlobalizedVars()
150 for (specific_attr_iterator<AlignedAttr> I(VD->getAttrs().begin()), in buildRecordForGlobalizedVars()
151 E(VD->getAttrs().end()); in buildRecordForGlobalizedVars()
162 C, GlobalizedRD, Loc, Loc, VD->getIdentifier(), Type, in buildRecordForGlobalizedVars()
176 MappedDeclsFields.try_emplace(VD, Field); in buildRecordForGlobalizedVars()
195 void markAsEscaped(const ValueDecl *VD) { in markAsEscaped() argument
197 if (!isa<VarDecl>(VD) || in markAsEscaped()
198 OMPDeclareTargetDeclAttr::isDeclareTargetDeclaration(VD)) in markAsEscaped()
200 VD = cast<ValueDecl>(VD->getCanonicalDecl()); in markAsEscaped()
202 if (VD->hasAttrs() && VD->hasAttr<OMPAllocateDeclAttr>()) in markAsEscaped()
207 if (const FieldDecl *FD = CSI->lookup(cast<VarDecl>(VD))) { in markAsEscaped()
224 assert(!VD->getType()->isVariablyModifiedType() && in markAsEscaped()
226 EscapedParameters.insert(VD); in markAsEscaped()
234 VD->getType()->isReferenceType()) in markAsEscaped()
237 if (VD->getType()->isVariablyModifiedType()) { in markAsEscaped()
241 EscapedVariableLengthDecls.insert(VD); in markAsEscaped()
243 DelayedVariableLengthDecls.insert(VD); in markAsEscaped()
245 EscapedDecls.insert(VD); in markAsEscaped()
248 void VisitValueDecl(const ValueDecl *VD) { in VisitValueDecl() argument
249 if (VD->getType()->isLValueReferenceType()) in VisitValueDecl()
250 markAsEscaped(VD); in VisitValueDecl()
251 if (const auto *VarD = dyn_cast<VarDecl>(VD)) { in VisitValueDecl()
254 AllEscaped = VD->getType()->isLValueReferenceType(); in VisitValueDecl()
267 const ValueDecl *VD = C.getCapturedVar(); in VisitOpenMPCapturedStmt() local
290 if (D == VD->getCanonicalDecl()) { in VisitOpenMPCapturedStmt()
299 markAsEscaped(VD); in VisitOpenMPCapturedStmt()
300 if (isa<OMPCapturedExprDecl>(VD)) in VisitOpenMPCapturedStmt()
301 VisitValueDecl(VD); in VisitOpenMPCapturedStmt()
331 if (const auto *VD = dyn_cast_or_null<ValueDecl>(D)) in VisitDeclStmt() local
332 VisitValueDecl(VD); in VisitDeclStmt()
360 const ValueDecl *VD = C.getCapturedVar(); in VisitCapturedStmt() local
361 markAsEscaped(VD); in VisitCapturedStmt()
362 if (isa<OMPCapturedExprDecl>(VD)) in VisitCapturedStmt()
363 VisitValueDecl(VD); in VisitCapturedStmt()
373 const ValueDecl *VD = C.getCapturedVar(); in VisitLambdaExpr() local
374 markAsEscaped(VD); in VisitLambdaExpr()
375 if (E->isInitCapture(&C) || isa<OMPCapturedExprDecl>(VD)) in VisitLambdaExpr()
376 VisitValueDecl(VD); in VisitLambdaExpr()
386 const VarDecl *VD = C.getVariable(); in VisitBlockExpr() local
387 markAsEscaped(VD); in VisitBlockExpr()
388 if (isa<OMPCapturedExprDecl>(VD) || VD->isInitCapture()) in VisitBlockExpr()
389 VisitValueDecl(VD); in VisitBlockExpr()
413 const ValueDecl *VD = E->getDecl(); in VisitDeclRefExpr() local
415 markAsEscaped(VD); in VisitDeclRefExpr()
416 if (isa<OMPCapturedExprDecl>(VD)) in VisitDeclRefExpr()
417 VisitValueDecl(VD); in VisitDeclRefExpr()
418 else if (VD->isInitCapture()) in VisitDeclRefExpr()
419 VisitValueDecl(VD); in VisitDeclRefExpr()
473 const FieldDecl *getFieldForGlobalizedVar(const ValueDecl *VD) const { in getFieldForGlobalizedVar()
476 return MappedDeclsFields.lookup(VD); in getFieldForGlobalizedVar()
1072 const auto *VD = cast<VarDecl>(Rec.first); in emitGenericVarsProlog() local
1074 QualType VarTy = VD->getType(); in emitGenericVarsProlog()
1080 CGF.MakeAddrLValue(CGF.GetAddrOfLocalVar(VD), VD->getType()); in emitGenericVarsProlog()
1085 llvm::Value *AllocArgs[] = {CGF.getTypeSize(VD->getType())}; in emitGenericVarsProlog()
1089 AllocArgs, VD->getName()); in emitGenericVarsProlog()
1098 VoidPtr, VarPtrTy, VD->getName() + "_on_stack"); in emitGenericVarsProlog()
1106 I->getSecond().MappedParams->setVarAddr(CGF, VD, VarAddr.getAddress(CGF)); in emitGenericVarsProlog()
1109 VoidPtr->setDebugLoc(DI->SourceLocToDebugLoc(VD->getLocation())); in emitGenericVarsProlog()
1113 const auto *VD = cast<VarDecl>(ValueD); in emitGenericVarsProlog() local
1115 getKmpcAllocShared(CGF, VD); in emitGenericVarsProlog()
1117 LValue Base = CGF.MakeAddrLValue(AddrSizePair.first, VD->getType(), in emitGenericVarsProlog()
1118 CGM.getContext().getDeclAlign(VD), in emitGenericVarsProlog()
1120 I->getSecond().MappedParams->setVarAddr(CGF, VD, Base.getAddress(CGF)); in emitGenericVarsProlog()
1126 const VarDecl *VD) const { in isDelayedVariableLengthDecl()
1132 return llvm::is_contained(I->getSecond().DelayedVariableLengthDecls, VD); in isDelayedVariableLengthDecl()
1137 const VarDecl *VD) { in getKmpcAllocShared() argument
1141 llvm::Value *Size = CGF.getTypeSize(VD->getType()); in getKmpcAllocShared()
1142 CharUnits Align = CGM.getContext().getDeclAlign(VD); in getKmpcAllocShared()
1155 AllocArgs, VD->getName()); in getKmpcAllocShared()
1187 const auto *VD = cast<VarDecl>(Rec.first); in emitGenericVarsEpilog() local
1191 CGF.getTypeSize(VD->getType())}; in emitGenericVarsEpilog()
2215 const ValueDecl *VD = cast<DeclRefExpr>(Private)->getDecl(); in emitListToGlobalCopyFunction() local
2217 const FieldDecl *FD = VarFieldMap.lookup(VD); in emitListToGlobalCopyFunction()
2317 const ValueDecl *VD = cast<DeclRefExpr>(*IPriv)->getDecl(); in emitListToGlobalReduceFunction() local
2318 const FieldDecl *FD = VarFieldMap.lookup(VD); in emitListToGlobalReduceFunction()
2422 const ValueDecl *VD = cast<DeclRefExpr>(Private)->getDecl(); in emitGlobalToListCopyFunction() local
2424 const FieldDecl *FD = VarFieldMap.lookup(VD); in emitGlobalToListCopyFunction()
2524 const ValueDecl *VD = cast<DeclRefExpr>(*IPriv)->getDecl(); in emitGlobalToListReduceFunction() local
2525 const FieldDecl *FD = VarFieldMap.lookup(VD); in emitGlobalToListReduceFunction()
3233 for (const ValueDecl *VD : VarChecker.getEscapedDecls()) { in emitFunctionProlog() local
3234 assert(VD->isCanonicalDecl() && "Expected canonical declaration"); in emitFunctionProlog()
3235 Data.insert(std::make_pair(VD, MappedVarData())); in emitFunctionProlog()
3252 const VarDecl *VD) { in getAddressOfLocalVariable() argument
3253 if (VD && VD->hasAttr<OMPAllocateDeclAttr>()) { in getAddressOfLocalVariable()
3254 const auto *A = VD->getAttr<OMPAllocateDeclAttr>(); in getAddressOfLocalVariable()
3279 llvm::Type *VarTy = CGF.ConvertTypeForMem(VD->getType()); in getAddressOfLocalVariable()
3283 VD->getName(), in getAddressOfLocalVariable()
3286 CharUnits Align = CGM.getContext().getDeclAlign(VD); in getAddressOfLocalVariable()
3291 VD->getType().getAddressSpace()))), in getAddressOfLocalVariable()
3298 VD = VD->getCanonicalDecl(); in getAddressOfLocalVariable()
3302 auto VDI = I->getSecond().LocalVarData.find(VD); in getAddressOfLocalVariable()
3305 if (VD->hasAttrs()) { in getAddressOfLocalVariable()
3306 for (specific_attr_iterator<OMPReferencedVarAttr> IT(VD->attr_begin()), in getAddressOfLocalVariable()
3307 E(VD->attr_end()); in getAddressOfLocalVariable()
3364 const VarDecl *VD = C.getCapturedVar(); in adjustTargetSpecificDataForLambdas() local
3365 const auto *RD = VD->getType() in adjustTargetSpecificDataForLambdas()
3371 Address VDAddr = CGF.GetAddrOfLocalVar(VD); in adjustTargetSpecificDataForLambdas()
3373 if (VD->getType().getCanonicalType()->isReferenceType()) in adjustTargetSpecificDataForLambdas()
3374 VDLVal = CGF.EmitLoadOfReferenceLValue(VDAddr, VD->getType()); in adjustTargetSpecificDataForLambdas()
3377 VDAddr, VD->getType().getCanonicalType().getNonReferenceType()); in adjustTargetSpecificDataForLambdas()
3390 const ValueDecl *VD = LC.getCapturedVar(); in adjustTargetSpecificDataForLambdas() local
3393 if (!CS->capturesVariable(cast<VarDecl>(VD))) in adjustTargetSpecificDataForLambdas()
3395 auto It = Captures.find(VD); in adjustTargetSpecificDataForLambdas()
3398 Address VDAddr = CGF.GetAddrOfLocalVar(cast<VarDecl>(VD)); in adjustTargetSpecificDataForLambdas()
3399 if (VD->getType().getCanonicalType()->isReferenceType()) in adjustTargetSpecificDataForLambdas()
3401 VD->getType().getCanonicalType()) in adjustTargetSpecificDataForLambdas()
3408 bool CGOpenMPRuntimeGPU::hasAllocateAttributeForGlobalVar(const VarDecl *VD, in hasAllocateAttributeForGlobalVar() argument
3410 if (!VD || !VD->hasAttr<OMPAllocateDeclAttr>()) in hasAllocateAttributeForGlobalVar()
3412 const auto *A = VD->getAttr<OMPAllocateDeclAttr>(); in hasAllocateAttributeForGlobalVar()