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()
1052 const auto *VD = cast<VarDecl>(Rec.first); in emitGenericVarsProlog() local
1054 QualType VarTy = VD->getType(); in emitGenericVarsProlog()
1060 CGF.MakeAddrLValue(CGF.GetAddrOfLocalVar(VD), VD->getType()); in emitGenericVarsProlog()
1065 llvm::Value *AllocArgs[] = {CGF.getTypeSize(VD->getType())}; in emitGenericVarsProlog()
1069 AllocArgs, VD->getName()); in emitGenericVarsProlog()
1078 VoidPtr, VarPtrTy, VD->getName() + "_on_stack"); in emitGenericVarsProlog()
1087 I->getSecond().MappedParams->setVarAddr(CGF, VD, VarAddr.getAddress()); in emitGenericVarsProlog()
1090 VoidPtr->setDebugLoc(DI->SourceLocToDebugLoc(VD->getLocation())); in emitGenericVarsProlog()
1094 const auto *VD = cast<VarDecl>(ValueD); in emitGenericVarsProlog() local
1096 getKmpcAllocShared(CGF, VD); in emitGenericVarsProlog()
1098 LValue Base = CGF.MakeAddrLValue(AddrSizePair.first, VD->getType(), in emitGenericVarsProlog()
1099 CGM.getContext().getDeclAlign(VD), in emitGenericVarsProlog()
1101 I->getSecond().MappedParams->setVarAddr(CGF, VD, Base.getAddress()); in emitGenericVarsProlog()
1107 const VarDecl *VD) const { in isDelayedVariableLengthDecl()
1113 return llvm::is_contained(I->getSecond().DelayedVariableLengthDecls, VD); in isDelayedVariableLengthDecl()
1118 const VarDecl *VD) { in getKmpcAllocShared() argument
1122 llvm::Value *Size = CGF.getTypeSize(VD->getType()); in getKmpcAllocShared()
1123 CharUnits Align = CGM.getContext().getDeclAlign(VD); in getKmpcAllocShared()
1136 AllocArgs, VD->getName()); in getKmpcAllocShared()
1168 const auto *VD = cast<VarDecl>(Rec.first); in emitGenericVarsEpilog() local
1172 CGF.getTypeSize(VD->getType())}; in emitGenericVarsEpilog()
2027 for (const ValueDecl *VD : VarChecker.getEscapedDecls()) { in emitFunctionProlog() local
2028 assert(VD->isCanonicalDecl() && "Expected canonical declaration"); in emitFunctionProlog()
2029 Data.insert(std::make_pair(VD, MappedVarData())); in emitFunctionProlog()
2046 const VarDecl *VD) { in getAddressOfLocalVariable() argument
2047 if (VD && VD->hasAttr<OMPAllocateDeclAttr>()) { in getAddressOfLocalVariable()
2048 const auto *A = VD->getAttr<OMPAllocateDeclAttr>(); in getAddressOfLocalVariable()
2073 llvm::Type *VarTy = CGF.ConvertTypeForMem(VD->getType()); in getAddressOfLocalVariable()
2077 VD->getName(), in getAddressOfLocalVariable()
2080 CharUnits Align = CGM.getContext().getDeclAlign(VD); in getAddressOfLocalVariable()
2085 VD->getType().getAddressSpace()))), in getAddressOfLocalVariable()
2092 VD = VD->getCanonicalDecl(); in getAddressOfLocalVariable()
2096 auto VDI = I->getSecond().LocalVarData.find(VD); in getAddressOfLocalVariable()
2099 if (VD->hasAttrs()) { in getAddressOfLocalVariable()
2100 for (specific_attr_iterator<OMPReferencedVarAttr> IT(VD->attr_begin()), in getAddressOfLocalVariable()
2101 E(VD->attr_end()); in getAddressOfLocalVariable()
2158 const VarDecl *VD = C.getCapturedVar(); in adjustTargetSpecificDataForLambdas() local
2159 const auto *RD = VD->getType() in adjustTargetSpecificDataForLambdas()
2165 Address VDAddr = CGF.GetAddrOfLocalVar(VD); in adjustTargetSpecificDataForLambdas()
2167 if (VD->getType().getCanonicalType()->isReferenceType()) in adjustTargetSpecificDataForLambdas()
2168 VDLVal = CGF.EmitLoadOfReferenceLValue(VDAddr, VD->getType()); in adjustTargetSpecificDataForLambdas()
2171 VDAddr, VD->getType().getCanonicalType().getNonReferenceType()); in adjustTargetSpecificDataForLambdas()
2184 const ValueDecl *VD = LC.getCapturedVar(); in adjustTargetSpecificDataForLambdas() local
2187 if (!CS->capturesVariable(cast<VarDecl>(VD))) in adjustTargetSpecificDataForLambdas()
2189 auto It = Captures.find(VD); in adjustTargetSpecificDataForLambdas()
2192 Address VDAddr = CGF.GetAddrOfLocalVar(cast<VarDecl>(VD)); in adjustTargetSpecificDataForLambdas()
2193 if (VD->getType().getCanonicalType()->isReferenceType()) in adjustTargetSpecificDataForLambdas()
2195 VD->getType().getCanonicalType()) in adjustTargetSpecificDataForLambdas()
2202 bool CGOpenMPRuntimeGPU::hasAllocateAttributeForGlobalVar(const VarDecl *VD, in hasAllocateAttributeForGlobalVar() argument
2204 if (!VD || !VD->hasAttr<OMPAllocateDeclAttr>()) in hasAllocateAttributeForGlobalVar()
2206 const auto *A = VD->getAttr<OMPAllocateDeclAttr>(); in hasAllocateAttributeForGlobalVar()