Home
last modified time | relevance | path

Searched refs:VD (Results 1 – 25 of 249) sorted by relevance

12345678910

/llvm-project-15.0.7/clang/lib/AST/Interp/
H A DByteCodeExprGen.cpp328 auto It = Locals.find(VD); in dereferenceVar()
382 if (VD->hasLocalStorage() && VD->hasInit() && !VD->isConstexpr()) { in dereferenceVar()
430 Locals.insert({VD, Local}); in allocateLocalPrimitive()
443 Key = VD; in allocateLocal()
444 Ty = VD->getType(); in allocateLocal()
479 return this->bail(VD); in getPtrVarDecl()
485 if (VD->isConstexpr()) { in getGlobalIdx()
487 return P.getGlobal(VD); in getGlobalIdx()
489 if (!VD->hasLocalStorage()) { in getGlobalIdx()
544 if (!this->emitDup(*T, VD)) in visitDecl()
[all …]
H A DByteCodeStmtGen.cpp147 if (auto *VD = dyn_cast<VarDecl>(D)) { in visitDeclStmt() local
148 if (!visitVarDecl(VD)) in visitDeclStmt()
234 bool ByteCodeStmtGen<Emitter>::visitVarDecl(const VarDecl *VD) { in visitVarDecl() argument
235 auto DT = VD->getType(); in visitVarDecl()
237 if (!VD->hasLocalStorage()) { in visitVarDecl()
244 auto Off = this->allocateLocalPrimitive(VD, *T, DT.isConstQualified()); in visitVarDecl()
248 if (!this->visit(VD->getInit())) in visitVarDecl()
252 return this->emitSetLocal(*T, Off, VD); in visitVarDecl()
255 if (auto Off = this->allocateLocal(VD)) { in visitVarDecl()
256 return this->visitLocalInitializer(VD->getInit(), *Off); in visitVarDecl()
[all …]
H A DProgram.cpp102 llvm::Optional<unsigned> Program::getGlobal(const ValueDecl *VD) { in getGlobal() argument
103 auto It = GlobalIndices.find(VD); in getGlobal()
109 for (const Decl *P = VD; P; P = P->getPreviousDecl()) { in getGlobal()
119 GlobalIndices[VD] = *Index; in getGlobal()
127 if (auto Idx = getGlobal(VD)) in getOrCreateGlobal()
130 if (auto Idx = createGlobal(VD)) { in getOrCreateGlobal()
131 GlobalIndices[VD] = *Idx; in getOrCreateGlobal()
156 llvm::Optional<unsigned> Program::createGlobal(const ValueDecl *VD) { in createGlobal() argument
158 if (auto *Var = dyn_cast<VarDecl>(VD)) { in createGlobal()
165 if (auto Idx = createGlobal(VD, VD->getType(), IsStatic, IsExtern)) { in createGlobal()
[all …]
/llvm-project-15.0.7/llvm/lib/Transforms/Utils/
H A DPredicateInfo.cpp153 if (!VD.Def && VD.U) { in getBlockEdge()
196 if (VD.Def) in getMiddleDef()
197 return VD.Def; in getMiddleDef()
204 if (!VD.U) { in getMiddleDef()
205 assert(VD.PInfo && in getMiddleDef()
338 ValueDFS VD; in convertUsesToDFSOrdered() local
345 VD.LocalNum = LN_Last; in convertUsesToDFSOrdered()
358 VD.U = &U; in convertUsesToDFSOrdered()
630 ValueDFS VD; in renameUses() local
730 << *VD.U->get() << " in " << *(VD.U->getUser()) in renameUses()
[all …]
/llvm-project-15.0.7/clang-tools-extra/clang-tidy/misc/
H A DDefinitionsInHeadersCheck.cpp136 } else if (const auto *VD = dyn_cast<VarDecl>(ND)) { in check() local
138 if (VD->getDescribedVarTemplate()) in check()
141 if (VD->getDeclContext()->isDependentContext() && VD->isStaticDataMember()) in check()
144 if (isTemplateInstantiation(VD->getTemplateSpecializationKind())) in check()
147 if (VD->hasLocalStorage() || VD->isStaticLocal()) in check()
150 if (VD->isInline()) in check()
153 if (isa<VarTemplatePartialSpecializationDecl>(VD)) in check()
156 diag(VD->getLocation(), in check()
159 << VD; in check()
/llvm-project-15.0.7/clang/lib/StaticAnalyzer/Checkers/
H A DDeadStoresChecker.cpp269 if (!VD->hasLocalStorage()) in CheckVarDecl()
276 if (!isLive(Live, VD) && in CheckVarDecl()
277 !(VD->hasAttr<UnusedAttr>() || VD->hasAttr<BlocksAttr>() || in CheckVarDecl()
289 CheckVarDecl(VD, DR, Val, dsk, Live); in CheckDeclRef()
305 if (DR->getDecl() == VD) in isIncrement()
309 if (DR->getDecl() == VD) in isIncrement()
337 QualType T = VD->getType(); in observeStmt()
435 if (isa<ParmVarDecl>(VD) && VD->getType()->isScalarType()) in observeStmt()
501 Escaped.insert(VD); in operator ()()
515 VarDecl *VD = C.getCapturedVar(); in findLambdaReferenceCaptures() local
[all …]
H A DUndefCapturedBlockVarChecker.cpp37 const VarDecl *VD) { in FindBlockDeclRefExpr() argument
39 if (BR->getDecl() == VD) in FindBlockDeclRefExpr()
44 if (const DeclRefExpr *BR = FindBlockDeclRefExpr(Child, VD)) in FindBlockDeclRefExpr()
66 const VarDecl *VD = VR->getDecl(); in checkPostStmt() local
68 if (VD->hasAttr<BlocksAttr>() || !VD->hasLocalStorage()) in checkPostStmt()
83 os << "Variable '" << VD->getName() in checkPostStmt()
87 if (const Expr *Ex = FindBlockDeclRefExpr(BE->getBody(), VD)) in checkPostStmt()
/llvm-project-15.0.7/clang/lib/Sema/
H A DSemaCUDA.cpp560 bool IsDependentVar(VarDecl *VD) { in IsDependentVar() argument
579 assert(!VD->isInvalidDecl() && VD->hasGlobalStorage()); in HasAllowedCUDADeviceStaticInitializer()
612 if (VD->isInvalidDecl() || !VD->hasInit() || !VD->hasGlobalStorage() || in checkAllowedCUDAInitializer()
613 IsDependentVar(VD)) in checkAllowedCUDAInitializer()
619 (VD->hasAttr<CUDADeviceAttr>() || VD->hasAttr<CUDAConstantAttr>()); in checkAllowedCUDAInitializer()
624 Diag(VD->getLocation(), in checkAllowedCUDAInitializer()
627 VD->setInvalidDecl(); in checkAllowedCUDAInitializer()
643 VD->setInvalidDecl(); in checkAllowedCUDAInitializer()
718 (VD->isFileVarDecl() || VD->isStaticDataMember()) && in MaybeAddCUDAConstantAttr()
719 !IsDependentVar(VD) && in MaybeAddCUDAConstantAttr()
[all …]
H A DSema.cpp752 if (VD->isReferenced() && in ShouldRemoveFromUnused()
772 if (DeclToCheck != VD) in ShouldRemoveFromUnused()
873 S.Diag(VD->getLocation(), isExternallyVisible(VD->getType()->getLinkage()) in checkUndefinedButUsed()
876 << isa<VarDecl>(VD) << VD; in checkUndefinedButUsed()
895 << isa<VarDecl>(VD) << VD; in checkUndefinedButUsed()
901 S.Diag(VD->getLocation(), diag::warn_undefined_inline) << VD; in checkUndefinedButUsed()
905 S.Diag(VD->getLocation(), diag::err_undefined_inline_var) << VD; in checkUndefinedButUsed()
1277 if (!VD || VD->isInvalidDecl() || !Seen.insert(VD).second) in ActOnEndOfTranslationUnit()
1287 VD->setType(T); in ActOnEndOfTranslationUnit()
1288 } else if (RequireCompleteType(VD->getLocation(), VD->getType(), in ActOnEndOfTranslationUnit()
[all …]
/llvm-project-15.0.7/clang-tools-extra/clang-tidy/llvm/
H A DTwineLocalCheck.cpp29 const auto *VD = Result.Nodes.getNodeAs<VarDecl>("variable"); in check() local
30 auto Diag = diag(VD->getLocation(), in check()
34 if (VD->hasInit()) { in check()
37 const Expr *C = VD->getInit()->IgnoreImplicit(); in check()
46 VD->getTypeSourceInfo()->getTypeLoc().getSourceRange(); in check()
49 if (VD->getType()->getCanonicalTypeUnqualified() == in check()
52 VD->getInit()->getEndLoc(), 0, *Result.SourceManager, getLangOpts()); in check()
54 << FixItHint::CreateInsertion(VD->getInit()->getBeginLoc(), "(") in check()
/llvm-project-15.0.7/clang-tools-extra/unittests/clang-tidy/
H A DOverlappingReplacementsTest.cpp34 auto *VD = Result.Nodes.getNodeAs<VarDecl>(BoundDecl); in check() local
36 CharSourceRange::getTokenRange(VD->getBeginLoc(), VD->getBeginLoc()), in check()
76 auto *VD = Result.Nodes.getNodeAs<VarDecl>(BoundDecl); in check() local
77 std::string NewName = newName(VD->getName()); in check()
79 auto Diag = diag(VD->getLocation(), "refactor %0 into %1") in check()
80 << VD->getName() << NewName in check()
88 UsageVisitor(const ValueDecl *VD, StringRef NewName, in check() argument
90 : VD(VD), NewName(NewName), Diag(Diag) {} in check()
93 if (VD->getCanonicalDecl() == D->getCanonicalDecl()) { in check()
102 const ValueDecl *VD; in check() member in clang::tidy::test::__anonc052bcba0111::RefactorCheck::check::UsageVisitor
[all …]
/llvm-project-15.0.7/clang/lib/Analysis/
H A DUninitializedValues.cpp255 if (isTrackedVar(VD, DC)) in findVar()
280 return ::isTrackedVar(VD, DC); in isTrackedVar()
304 if (!VD || !isTrackedVar(VD)) in get()
374 if (VD && isTrackedVar(VD)) in VisitDeclStmt()
693 if (isTrackedVar(VD)) in VisitObjCForCollectionStmt()
694 vals[VD] = Initialized; in VisitObjCForCollectionStmt()
768 vals[VD] = Initialized; in VisitBinaryOperator()
775 if (VD && isTrackedVar(VD)) { in VisitDeclStmt()
776 if (getSelfInitExpr(VD)) { in VisitDeclStmt()
787 vals[VD] = Uninitialized; in VisitDeclStmt()
[all …]
H A DThreadSafetyCommon.cpp318 VD = isa<FunctionDecl>(D) in translateDeclRefExpr()
350 if (VD && VD->getType()->isAnyPointerType()) in hasAnyPointerType()
378 D = getFirstVirtualDecl(VD); in translateMemberExpr()
527 VD = DRE->getDecl(); in translateBinAssign()
528 CV = lookupVarDecl(VD); in translateBinAssign()
536 if (VD && CV) in translateBinAssign()
642 Expr *E = VD->getInit(); in translateDeclStmt()
665 if (VD) in addStatement()
689 V->setClangDecl(VD); in maybeUpdateVD()
695 maybeUpdateVD(E, VD); in addVarDecl()
[all …]
H A DLiveVariables.cpp328 return VD && !VD->getType()->isReferenceType() && in writeShouldKill()
329 !isAlwaysAlive(VD); in writeShouldKill()
358 Killed = writeShouldKill(VD); in VisitBinaryOperator()
371 for (const VarDecl *VD : in VisitBlockExpr() local
373 if (isAlwaysAlive(VD)) in VisitBlockExpr()
390 if (!InAssignment && !isAlwaysAlive(VD)) in VisitDeclRefExpr()
409 if (!isAlwaysAlive(VD)) in VisitDeclStmt()
418 const VarDecl *VD = nullptr; in VisitObjCForCollectionStmt() local
422 VD = cast<VarDecl>(DS->getSingleDecl()); in VisitObjCForCollectionStmt()
425 VD = cast<VarDecl>(DR->getDecl()); in VisitObjCForCollectionStmt()
[all …]
/llvm-project-15.0.7/clang/lib/AST/
H A DStmtIterator.cpp48 if (VarDecl* VD = dyn_cast<VarDecl>(*DGI)) in NextVA() local
49 if (VD->hasInit()) in NextVA()
75 if (VarDecl* VD = dyn_cast<VarDecl>(D)) { in HandleDecl() local
76 if (const VariableArrayType* VAPtr = FindVA(VD->getType().getTypePtr())) { in HandleDecl()
81 if (VD->getInit()) in HandleDecl()
116 VarDecl* VD = cast<VarDecl>(*DGI); in GetDeclExpr() local
117 return *VD->getInitAddress(); in GetDeclExpr()
H A DAttrImpl.cpp152 OMPDeclareTargetDeclAttr::getActiveAttr(const ValueDecl *VD) { in getActiveAttr() argument
153 if (!VD->hasAttrs()) in getActiveAttr()
157 for (auto *Attr : VD->specific_attrs<OMPDeclareTargetDeclAttr>()) { in getActiveAttr()
169 OMPDeclareTargetDeclAttr::isDeclareTargetDeclaration(const ValueDecl *VD) { in isDeclareTargetDeclaration() argument
170 llvm::Optional<OMPDeclareTargetDeclAttr *> ActiveAttr = getActiveAttr(VD); in isDeclareTargetDeclaration()
177 OMPDeclareTargetDeclAttr::getDeviceType(const ValueDecl *VD) { in getDeviceType() argument
178 llvm::Optional<OMPDeclareTargetDeclAttr *> ActiveAttr = getActiveAttr(VD); in getDeviceType()
185 OMPDeclareTargetDeclAttr::getLocation(const ValueDecl *VD) { in getLocation() argument
186 llvm::Optional<OMPDeclareTargetDeclAttr *> ActiveAttr = getActiveAttr(VD); in getLocation()
/llvm-project-15.0.7/clang/test/CodeGenCXX/
H A Dbuiltins-systemz-zvector.cpp33 void testFloats(vector double VD) { in testFloats() argument
36 gb = (VD == CI1)[0]; in testFloats()
41 gb = (VD == CI2)[0]; in testFloats()
45 gb = (VD == CF1)[0]; in testFloats()
49 gb = (VD == CF2)[0]; in testFloats()
/llvm-project-15.0.7/clang-tools-extra/clang-tidy/objc/
H A DNSInvocationArgumentLifetimeCheck.cpp69 fixItHintForVarDecl(const VarDecl *VD, const SourceManager &SM, in fixItHintForVarDecl() argument
71 assert(VD && "VarDecl parameter must not be null"); in fixItHintForVarDecl()
73 if (isa<ParmVarDecl>(VD)) in fixItHintForVarDecl()
80 CharSourceRange::getTokenRange(VD->getSourceRange()), SM, LangOpts); in fixItHintForVarDecl()
137 const auto *VD = Result.Nodes.getNodeAs<VarDecl>("var"); in check() local
138 if (!VD) in check()
141 if (auto Hint = fixItHintForVarDecl(VD, *Result.SourceManager, in check()
/llvm-project-15.0.7/clang/lib/Frontend/
H A DInterfaceStubFunctionsConsumer.cpp56 if (const VarDecl *VD = dyn_cast<VarDecl>(ND)) { in WriteNamedDecl() local
57 if (const auto *Parent = VD->getParentFunctionOrMethod()) in WriteNamedDecl()
61 if ((VD->getStorageClass() == StorageClass::SC_Extern) || in WriteNamedDecl()
62 (VD->getStorageClass() == StorageClass::SC_Static && in WriteNamedDecl()
63 VD->getParentFunctionOrMethod() == nullptr)) in WriteNamedDecl()
85 if (const VarDecl *VD = dyn_cast<VarDecl>(ND)) in WriteNamedDecl() local
213 const auto *VD = cast<VarDecl>(ND); in HandleNamedDecl() local
215 if (VD->isTemplated() || VD->getType()->isDependentType()) in HandleNamedDecl()
252 if (const auto *VD = dyn_cast<ValueDecl>(ND)) { in HandleTranslationUnit() local
253 ValueDecls.insert(VD); in HandleTranslationUnit()
[all …]
/llvm-project-15.0.7/clang/test/SemaCXX/
H A Ddestructor.cpp241 struct VD: VB {}; struct
264 VD vd; use(vd); in nowarnstack()
294 VD* vd = new VD[4]; in nowarnarray()
321 VB* vb = new VD(); in nowarn0()
325 VD* vd = new VD(); in nowarn0()
334 void nowarn0_explicit_dtor(F* f, VB* vb, VD* vd, VF* vf) { in nowarn0_explicit_dtor()
338 vd->~VD(); in nowarn0_explicit_dtor()
396 simple_ptr<VB> vb(new VD()); in nowarn1()
400 simple_ptr<VD> vd(new VD()); in nowarn1()
/llvm-project-15.0.7/clang-tools-extra/clang-tidy/performance/
H A DImplicitConversionInLoopCheck.cpp68 const auto *VD = Result.Nodes.getNodeAs<VarDecl>("faulty-var"); in check() local
85 reportAndFix(Result.Context, VD, OperatorCall); in check()
89 const VarDecl *VD, in reportAndFix() argument
101 diag(VD->getBeginLoc(), Message) << VD << ConstRefType; in reportAndFix()
/llvm-project-15.0.7/clang/lib/CodeGen/
H A DCGOpenMPRuntimeGPU.cpp236 VD = cast<ValueDecl>(VD->getCanonicalDecl()); in markAsEscaped()
238 if (VD->hasAttrs() && VD->hasAttr<OMPAllocateDeclAttr>()) in markAsEscaped()
279 markAsEscaped(VD); in VisitValueDecl()
417 if (isa<OMPCapturedExprDecl>(VD) || VD->isInitCapture()) in VisitBlockExpr()
444 markAsEscaped(VD); in VisitDeclRefExpr()
446 VisitValueDecl(VD); in VisitDeclRefExpr()
1407 CGF.MakeAddrLValue(CGF.GetAddrOfLocalVar(VD), VD->getType()); in emitGenericVarsProlog()
3688 if (VD && VD->hasAttr<OMPAllocateDeclAttr>()) { in getAddressOfLocalVariable()
3718 VD->getName(), in getAddressOfLocalVariable()
3733 VD = VD->getCanonicalDecl(); in getAddressOfLocalVariable()
[all …]
/llvm-project-15.0.7/clang/unittests/AST/
H A DEvaluateAsRValueTest.cpp41 bool VisitVarDecl(const clang::VarDecl *VD) { in VisitVarDecl() argument
42 if (const clang::Expr *Init = VD->getInit()) { in VisitVarDecl()
44 bool WasEvaluated = Init->EvaluateAsRValue(Result, VD->getASTContext()); in VisitVarDecl()
45 VarInfo[VD->getNameAsString()] = WasEvaluated; in VisitVarDecl()
46 EXPECT_EQ(WasEvaluated, Init->isConstantInitializer(VD->getASTContext(), in VisitVarDecl()
/llvm-project-15.0.7/clang-tools-extra/clang-tidy/darwin/
H A DDispatchOnceNonstaticCheck.cpp39 if (const auto *VD = Result.Nodes.getNodeAs<VarDecl>("non-static-var")) { in check() local
40 if (const auto *PD = dyn_cast<ParmVarDecl>(VD)) { in check()
47 diag(VD->getTypeSpecStartLoc(), "dispatch_once_t variables must have " in check()
49 << FixItHint::CreateInsertion(VD->getTypeSpecStartLoc(), "static "); in check()
/llvm-project-15.0.7/clang/lib/StaticAnalyzer/Core/
H A DCheckerHelpers.cpp56 if (const VarDecl *VD = dyn_cast<VarDecl>(DR->getDecl())) in containsStaticLocal() local
57 if (VD->isStaticLocal()) in containsStaticLocal()
82 const VarDecl *VD = nullptr; in parseAssignment() local
90 VD = dyn_cast_or_null<VarDecl>(DE->getDecl()); in parseAssignment()
95 VD = cast<VarDecl>(PD->getSingleDecl()); in parseAssignment()
96 RHS = VD->getAnyInitializer(); in parseAssignment()
99 return std::make_pair(VD, RHS); in parseAssignment()

12345678910