Home
last modified time | relevance | path

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

12345678910>>...18

/external/clang/lib/Analysis/
DPseudoConstantAnalysis.cpp39 bool PseudoConstantAnalysis::isPseudoConstant(const VarDecl *VD) { in isPseudoConstant() argument
41 if (!VD->hasLocalStorage() && !VD->isStaticLocal()) in isPseudoConstant()
51 return !NonConstants->count(VD); in isPseudoConstant()
55 bool PseudoConstantAnalysis::wasReferenced(const VarDecl *VD) { in wasReferenced() argument
63 return UsedVars->count(VD); in wasReferenced()
122 const VarDecl *VD = dyn_cast<VarDecl>(LHSDecl); in RunAnalysis() local
124 if (VD) in RunAnalysis()
125 NonConstants->insert(VD); in RunAnalysis()
156 const VarDecl *VD = dyn_cast<VarDecl>(D); in RunAnalysis() local
157 if (VD) in RunAnalysis()
[all …]
DUninitializedValues.cpp296 if (const VarDecl *VD = dyn_cast<VarDecl>(DRE->getDecl())) in findVar() local
297 if (isTrackedVar(VD, DC)) in findVar()
298 return FindVarResult(VD, DRE); in findVar()
318 bool isTrackedVar(const VarDecl *VD) const { in isTrackedVar()
319 return ::isTrackedVar(VD, DC); in isTrackedVar()
341 const VarDecl *VD = dyn_cast<VarDecl>(DRE->getDecl()); in get() local
342 if (!VD || !isTrackedVar(VD)) in get()
350 static const DeclRefExpr *getSelfInitExpr(VarDecl *VD) { in getSelfInitExpr() argument
351 if (VD->getType()->isRecordType()) return nullptr; in getSelfInitExpr()
352 if (Expr *Init = VD->getInit()) { in getSelfInitExpr()
[all …]
DThreadSafetyCommon.cpp268 const ValueDecl *VD = cast<ValueDecl>(DRE->getDecl()->getCanonicalDecl()); in translateDeclRefExpr() local
271 if (const ParmVarDecl *PV = dyn_cast_or_null<ParmVarDecl>(VD)) { in translateDeclRefExpr()
283 VD = FD->getParamDecl(I); in translateDeclRefExpr()
287 return new (Arena) til::LiteralPtr(VD); in translateDeclRefExpr()
312 auto *VD = getValueDeclFromSExpr(E); in hasCppPointerType() local
313 if (VD && VD->getType()->isPointerType()) in hasCppPointerType()
341 if (auto *VD = dyn_cast<CXXMethodDecl>(D)) in translateMemberExpr() local
342 D = getFirstVirtualDecl(VD); in translateMemberExpr()
474 const ValueDecl *VD = nullptr; in translateBinAssign() local
477 VD = DRE->getDecl(); in translateBinAssign()
[all …]
/external/llvm-project/clang/lib/AST/Interp/
DByteCodeExprGen.cpp31 DeclScope(ByteCodeExprGen<Emitter> *Ctx, const VarDecl *VD) in DeclScope() argument
32 : LocalScope<Emitter>(Ctx), Scope(Ctx->P, VD) {} in DeclScope()
267 if (auto *VD = dyn_cast<VarDecl>(DE->getDecl())) in dereference() local
268 return dereferenceVar(LV, *T, VD, AK, Direct, Indirect); in dereference()
325 const Expr *LV, PrimType T, const VarDecl *VD, DerefKind AK, in dereferenceVar() argument
328 auto It = Locals.find(VD); in dereferenceVar()
353 } else if (auto Idx = getGlobalIdx(VD)) { in dereferenceVar()
382 if (VD->hasLocalStorage() && VD->hasInit() && !VD->isConstexpr()) { in dereferenceVar()
383 QualType VT = VD->getType(); in dereferenceVar()
385 return this->Visit(VD->getInit()); in dereferenceVar()
[all …]
DByteCodeStmtGen.cpp147 if (auto *VD = dyn_cast<VarDecl>(D)) { in visitDeclStmt() local
148 if (!visitVarDecl(VD)) in visitDeclStmt()
228 bool ByteCodeStmtGen<Emitter>::visitVarDecl(const VarDecl *VD) { in visitVarDecl() argument
229 auto DT = VD->getType(); in visitVarDecl()
231 if (!VD->hasLocalStorage()) { in visitVarDecl()
238 auto Off = this->allocateLocalPrimitive(VD, *T, DT.isConstQualified()); in visitVarDecl()
242 if (!this->visit(VD->getInit())) in visitVarDecl()
246 return this->emitSetLocal(*T, Off, VD); in visitVarDecl()
249 if (auto Off = this->allocateLocal(VD)) { in visitVarDecl()
250 return this->visitLocalInitializer(VD->getInit(), *Off); in visitVarDecl()
[all …]
/external/clang/lib/StaticAnalyzer/Checkers/
DDeadStoresChecker.cpp208 void CheckVarDecl(const VarDecl *VD, const Expr *Ex, const Expr *Val, in CheckVarDecl() argument
212 if (!VD->hasLocalStorage()) in CheckVarDecl()
216 if (VD->getType()->getAs<ReferenceType>()) in CheckVarDecl()
219 if (!isLive(Live, VD) && in CheckVarDecl()
220 !(VD->hasAttr<UnusedAttr>() || VD->hasAttr<BlocksAttr>() || in CheckVarDecl()
221 VD->hasAttr<ObjCPreciseLifetimeAttr>())) { in CheckVarDecl()
225 Report(VD, dsk, ExLoc, Val->getSourceRange()); in CheckVarDecl()
231 if (const VarDecl *VD = dyn_cast<VarDecl>(DR->getDecl())) in CheckDeclRef() local
232 CheckVarDecl(VD, DR, Val, dsk, Live); in CheckDeclRef()
235 bool isIncrement(VarDecl *VD, const BinaryOperator* B) { in isIncrement() argument
[all …]
DUndefCapturedBlockVarChecker.cpp38 const VarDecl *VD) { in FindBlockDeclRefExpr() argument
40 if (BR->getDecl() == VD) in FindBlockDeclRefExpr()
45 if (const DeclRefExpr *BR = FindBlockDeclRefExpr(Child, VD)) in FindBlockDeclRefExpr()
69 const VarDecl *VD = VR->getDecl(); in checkPostStmt() local
71 if (VD->hasAttr<BlocksAttr>() || !VD->hasLocalStorage()) in checkPostStmt()
86 os << "Variable '" << VD->getName() in checkPostStmt()
90 if (const Expr *Ex = FindBlockDeclRefExpr(BE->getBody(), VD)) in checkPostStmt()
/external/swiftshader/third_party/llvm-10.0/llvm/lib/Transforms/Utils/
DPredicateInfo.cpp163 getBlockEdge(const ValueDFS &VD) const { in getBlockEdge()
164 if (!VD.Def && VD.U) { in getBlockEdge()
165 auto *PHI = cast<PHINode>(VD.U->getUser()); in getBlockEdge()
166 return std::make_pair(PHI->getIncomingBlock(*VD.U), PHI->getParent()); in getBlockEdge()
169 return ::getBlockEdge(VD.PInfo); in getBlockEdge()
206 Value *getMiddleDef(const ValueDFS &VD) const { in getMiddleDef()
207 if (VD.Def) in getMiddleDef()
208 return VD.Def; in getMiddleDef()
215 if (!VD.U) { in getMiddleDef()
216 assert(VD.PInfo && in getMiddleDef()
[all …]
/external/llvm-project/clang/lib/StaticAnalyzer/Checkers/
DDeadStoresChecker.cpp267 void CheckVarDecl(const VarDecl *VD, const Expr *Ex, const Expr *Val, in CheckVarDecl() argument
271 if (!VD->hasLocalStorage()) in CheckVarDecl()
275 if (VD->getType()->getAs<ReferenceType>()) in CheckVarDecl()
278 if (!isLive(Live, VD) && in CheckVarDecl()
279 !(VD->hasAttr<UnusedAttr>() || VD->hasAttr<BlocksAttr>() || in CheckVarDecl()
280 VD->hasAttr<ObjCPreciseLifetimeAttr>())) { in CheckVarDecl()
284 Report(VD, dsk, ExLoc, Val->getSourceRange()); in CheckVarDecl()
290 if (const VarDecl *VD = dyn_cast<VarDecl>(DR->getDecl())) in CheckDeclRef() local
291 CheckVarDecl(VD, DR, Val, dsk, Live); in CheckDeclRef()
294 bool isIncrement(VarDecl *VD, const BinaryOperator* B) { in isIncrement() argument
[all …]
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()
/external/llvm-project/llvm/lib/Transforms/Utils/
DPredicateInfo.cpp158 getBlockEdge(const ValueDFS &VD) const { in getBlockEdge()
159 if (!VD.Def && VD.U) { in getBlockEdge()
160 auto *PHI = cast<PHINode>(VD.U->getUser()); in getBlockEdge()
161 return std::make_pair(PHI->getIncomingBlock(*VD.U), PHI->getParent()); in getBlockEdge()
164 return ::getBlockEdge(VD.PInfo); in getBlockEdge()
201 Value *getMiddleDef(const ValueDFS &VD) const { in getMiddleDef()
202 if (VD.Def) in getMiddleDef()
203 return VD.Def; in getMiddleDef()
210 if (!VD.U) { in getMiddleDef()
211 assert(VD.PInfo && in getMiddleDef()
[all …]
/external/llvm-project/clang-tools-extra/clang-tidy/llvm/
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()
/external/llvm-project/clang-tools-extra/clang-tidy/misc/
DDefinitionsInHeadersCheck.cpp133 } else if (const auto *VD = dyn_cast<VarDecl>(ND)) { in check() local
135 if (VD->getDescribedVarTemplate()) in check()
138 if (VD->getDeclContext()->isDependentContext() && VD->isStaticDataMember()) in check()
141 if (isTemplateInstantiation(VD->getTemplateSpecializationKind())) in check()
144 if (VD->hasLocalStorage() || VD->isStaticLocal()) in check()
147 if (VD->isInline()) in check()
150 diag(VD->getLocation(), in check()
153 << VD; in check()
/external/llvm-project/clang-tools-extra/unittests/clang-tidy/
DOverlappingReplacementsTest.cpp34 auto *VD = Result.Nodes.getNodeAs<VarDecl>(BoundDecl); in check() local
35 diag(VD->getBeginLoc(), "use char") << FixItHint::CreateReplacement( in check()
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()
82 CharSourceRange::getTokenRange(VD->getLocation(), in check()
83 VD->getLocation()), in check()
88 UsageVisitor(const ValueDecl *VD, StringRef NewName, in check() argument
[all …]
/external/llvm-project/clang/lib/Analysis/
DUninitializedValues.cpp254 if (const auto *VD = dyn_cast<VarDecl>(DRE->getDecl())) in findVar() local
255 if (isTrackedVar(VD, DC)) in findVar()
256 return FindVarResult(VD, DRE); in findVar()
279 bool isTrackedVar(const VarDecl *VD) const { in isTrackedVar()
280 return ::isTrackedVar(VD, DC); in isTrackedVar()
303 const auto *VD = dyn_cast<VarDecl>(DRE->getDecl()); in get() local
304 if (!VD || !isTrackedVar(VD)) in get()
313 static const DeclRefExpr *getSelfInitExpr(VarDecl *VD) { in getSelfInitExpr() argument
314 if (VD->getType()->isRecordType()) in getSelfInitExpr()
316 if (Expr *Init = VD->getInit()) { in getSelfInitExpr()
[all …]
DThreadSafetyCommon.cpp274 const auto *VD = cast<ValueDecl>(DRE->getDecl()->getCanonicalDecl()); in translateDeclRefExpr() local
277 if (const auto *PV = dyn_cast<ParmVarDecl>(VD)) { in translateDeclRefExpr()
292 VD = isa<FunctionDecl>(D) in translateDeclRefExpr()
298 return new (Arena) til::LiteralPtr(VD); in translateDeclRefExpr()
323 auto *VD = getValueDeclFromSExpr(E); in hasAnyPointerType() local
324 if (VD && VD->getType()->isAnyPointerType()) in hasAnyPointerType()
351 if (const auto *VD = dyn_cast<CXXMethodDecl>(D)) in translateMemberExpr() local
352 D = getFirstVirtualDecl(VD); in translateMemberExpr()
498 const ValueDecl *VD = nullptr; in translateBinAssign() local
501 VD = DRE->getDecl(); in translateBinAssign()
[all …]
/external/clang/test/SemaCXX/
Ddestructor.cpp211 struct VD: VB {}; struct
245 VD vd; use(vd); in nowarnstack()
275 VD* vd = new VD[4]; in nowarnarray()
302 VB* vb = new VD(); in nowarn0()
306 VD* vd = new VD(); in nowarn0()
315 void nowarn0_explicit_dtor(F* f, VB* vb, VD* vd, VF* vf) { in nowarn0_explicit_dtor()
319 vd->~VD(); in nowarn0_explicit_dtor()
359 simple_ptr<VB> vb(new VD()); in nowarn1()
363 simple_ptr<VD> vd(new VD()); in nowarn1()
/external/llvm-project/clang/lib/Sema/
DSemaCUDA.cpp514 void Sema::checkAllowedCUDAInitializer(VarDecl *VD) { in checkAllowedCUDAInitializer() argument
515 if (VD->isInvalidDecl() || !VD->hasInit() || !VD->hasGlobalStorage()) in checkAllowedCUDAInitializer()
517 const Expr *Init = VD->getInit(); in checkAllowedCUDAInitializer()
518 if (VD->hasAttr<CUDADeviceAttr>() || VD->hasAttr<CUDAConstantAttr>() || in checkAllowedCUDAInitializer()
519 VD->hasAttr<CUDASharedAttr>()) { in checkAllowedCUDAInitializer()
525 isEmptyCudaConstructor(VD->getLocation(), CE->getConstructor()); in checkAllowedCUDAInitializer()
530 (VD->hasAttr<CUDADeviceAttr>() || VD->hasAttr<CUDAConstantAttr>())) { in checkAllowedCUDAInitializer()
531 auto *Init = VD->getInit(); in checkAllowedCUDAInitializer()
533 ((VD->getType()->isDependentType() || Init->isValueDependent()) && in checkAllowedCUDAInitializer()
534 VD->isConstexpr()) || in checkAllowedCUDAInitializer()
[all …]
/external/clang/lib/StaticAnalyzer/Core/
DCheckerHelpers.cpp52 if (const VarDecl *VD = dyn_cast<VarDecl>(DR->getDecl())) in containsStaticLocal() local
53 if (VD->isStaticLocal()) in containsStaticLocal()
78 const VarDecl *VD = nullptr; in parseAssignment() local
86 VD = dyn_cast_or_null<VarDecl>(DE->getDecl()); in parseAssignment()
91 VD = dyn_cast_or_null<VarDecl>(PD->getSingleDecl()); in parseAssignment()
92 RHS = VD->getAnyInitializer(); in parseAssignment()
95 return std::make_pair(VD, RHS); in parseAssignment()
/external/clang/lib/AST/
DStmtIterator.cpp44 if (VarDecl* VD = dyn_cast<VarDecl>(*DGI)) in NextVA() local
45 if (VD->hasInit()) in NextVA()
71 if (VarDecl* VD = dyn_cast<VarDecl>(D)) { in HandleDecl() local
72 if (const VariableArrayType* VAPtr = FindVA(VD->getType().getTypePtr())) { in HandleDecl()
77 if (VD->getInit()) in HandleDecl()
112 VarDecl* VD = cast<VarDecl>(*DGI); in GetDeclExpr() local
113 return *VD->getInitAddress(); in GetDeclExpr()
/external/llvm-project/clang/lib/AST/
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()
DAttrImpl.cpp136 OMPDeclareTargetDeclAttr::isDeclareTargetDeclaration(const ValueDecl *VD) { in isDeclareTargetDeclaration() argument
137 if (!VD->hasAttrs()) in isDeclareTargetDeclaration()
141 for (const auto *Attr : VD->specific_attrs<OMPDeclareTargetDeclAttr>()) { in isDeclareTargetDeclaration()
154 OMPDeclareTargetDeclAttr::getDeviceType(const ValueDecl *VD) { in getDeviceType() argument
155 if (!VD->hasAttrs()) in getDeviceType()
159 for (const auto *Attr : VD->specific_attrs<OMPDeclareTargetDeclAttr>()) { in getDeviceType()
172 OMPDeclareTargetDeclAttr::getLocation(const ValueDecl *VD) { in getLocation() argument
173 if (!VD->hasAttrs()) in getLocation()
177 for (const auto *Attr : VD->specific_attrs<OMPDeclareTargetDeclAttr>()) { in getLocation()
/external/clang/test/CodeGenCXX/
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()
/external/llvm-project/clang/test/CodeGenCXX/
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()
/external/llvm-project/clang-tools-extra/clang-tidy/objc/
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()

12345678910>>...18