/external/clang/lib/Analysis/ |
D | PseudoConstantAnalysis.cpp | 39 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 …]
|
D | UninitializedValues.cpp | 296 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 …]
|
D | ThreadSafetyCommon.cpp | 268 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 …]
|
D | LiveVariables.cpp | 291 if (const VarDecl *VD = dyn_cast<VarDecl>(DS->getSingleDecl())) { in Visit() local 292 for (const VariableArrayType* VA = FindVA(VD->getType()); in Visit() 341 if (const VarDecl *VD = dyn_cast<VarDecl>(DR->getDecl())) { in VisitBinaryOperator() local 343 if (VD->getType()->isReferenceType()) in VisitBinaryOperator() 346 if (!isAlwaysAlive(VD)) { in VisitBinaryOperator() 348 val.liveDecls = LV.DSetFact.remove(val.liveDecls, VD); in VisitBinaryOperator() 358 for (const VarDecl *VD : in VisitBlockExpr() local 360 if (isAlwaysAlive(VD)) in VisitBlockExpr() 362 val.liveDecls = LV.DSetFact.add(val.liveDecls, VD); in VisitBlockExpr() 374 if (const auto *VD = dyn_cast<VarDecl>(DI)) { in VisitDeclStmt() local [all …]
|
D | AnalysisDeclContext.cpp | 145 static bool isSelfDecl(const VarDecl *VD) { in isSelfDecl() argument 146 return isa<ImplicitParamDecl>(VD) && VD->getName() == "self"; in isSelfDecl() 155 const VarDecl *VD = I.getVariable(); in getSelfDecl() local 156 if (isSelfDecl(VD)) in getSelfDecl() 157 return dyn_cast<ImplicitParamDecl>(VD); in getSelfDecl() 173 VarDecl *VD = LC.getCapturedVar(); in getSelfDecl() local 174 if (isSelfDecl(VD)) in getSelfDecl() 175 return dyn_cast<ImplicitParamDecl>(VD); in getSelfDecl() 524 if (const VarDecl *VD = dyn_cast<VarDecl>(DR->getDecl())) { in VisitDeclRefExpr() local 525 if (!VD->hasLocalStorage()) { in VisitDeclRefExpr() [all …]
|
D | ThreadSafety.cpp | 568 if (const auto *VD = dyn_cast_or_null<VarDecl>(D)) { in VisitDeclStmt() local 569 const Expr *E = VD->getInit(); in VisitDeclStmt() 572 QualType T = VD->getType(); in VisitDeclStmt() 573 if (T.isTrivialType(VD->getASTContext())) { in VisitDeclStmt() 574 Ctx = VMap->addDefinition(VD, E, Ctx); in VisitDeclStmt() 1141 static StringRef ClassifyDiagnostic(const ValueDecl *VD) { in ClassifyDiagnostic() argument 1142 assert(VD && "No ValueDecl passed"); in ClassifyDiagnostic() 1145 return ClassifyDiagnostic(VD->getType()); in ClassifyDiagnostic() 1152 if (const ValueDecl *VD = getValueDecl(A->getArg())) in ClassifyDiagnostic() local 1153 return ClassifyDiagnostic(VD); in ClassifyDiagnostic() [all …]
|
/external/clang/lib/StaticAnalyzer/Checkers/ |
D | DeadStoresChecker.cpp | 208 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 …]
|
D | UndefCapturedBlockVarChecker.cpp | 38 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()
|
D | LLVMConventionsChecker.cpp | 134 void VisitVarDecl(VarDecl *VD); 148 if (VarDecl *VD = dyn_cast<VarDecl>(I)) in VisitDeclStmt() local 149 VisitVarDecl(VD); in VisitDeclStmt() 152 void StringRefCheckerVisitor::VisitVarDecl(VarDecl *VD) { in VisitVarDecl() argument 153 Expr *Init = VD->getInit(); in VisitVarDecl() 159 if (!IsLLVMStringRef(VD->getType())) in VisitVarDecl() 184 PathDiagnosticLocation::createBegin(VD, BR.getSourceManager()); in VisitVarDecl()
|
/external/clang/test/SemaCXX/ |
D | destructor.cpp | 211 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/clang/lib/StaticAnalyzer/Core/ |
D | CheckerHelpers.cpp | 52 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/ |
D | StmtIterator.cpp | 44 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()
|
D | ItaniumCXXABI.cpp | 42 static const IdentifierInfo *findAnonymousUnionVarDeclName(const VarDecl& VD) { in findAnonymousUnionVarDeclName() argument 43 const RecordType *RT = VD.getType()->getAs<RecordType>(); in findAnonymousUnionVarDeclName() 78 unsigned getStaticLocalNumber(const VarDecl *VD) override { in getStaticLocalNumber() argument 83 unsigned getManglingNumber(const VarDecl *VD, unsigned) override { in getManglingNumber() argument 84 const IdentifierInfo *Identifier = VD->getIdentifier(); in getManglingNumber() 87 Identifier = findAnonymousUnionVarDeclName(*VD); in getManglingNumber()
|
/external/clang/test/CodeGenCXX/ |
D | builtins-systemz-zvector.cpp | 33 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/clang/lib/Sema/ |
D | SemaOpenMP.cpp | 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() [all …]
|
D | Sema.cpp | 446 if (const VarDecl *VD = dyn_cast<VarDecl>(D)) { in ShouldRemoveFromUnused() local 452 if (VD->isReferenced() && in ShouldRemoveFromUnused() 453 VD->isUsableInConstantExpressions(SemaRef->Context)) in ShouldRemoveFromUnused() 458 const VarDecl *DeclToCheck = VD->getDefinition(); in ShouldRemoveFromUnused() 464 DeclToCheck = VD->getMostRecentDecl(); in ShouldRemoveFromUnused() 465 if (DeclToCheck != VD) in ShouldRemoveFromUnused() 492 auto *VD = cast<VarDecl>(ND); in getUndefinedButUsed() local 493 if (VD->hasDefinition() != VarDecl::DeclarationOnly) in getUndefinedButUsed() 495 if (VD->isExternallyVisible() && !VD->getMostRecentDecl()->isInline()) in getUndefinedButUsed() 794 VarDecl *VD = (*T)->getActingDefinition(); in ActOnEndOfTranslationUnit() local [all …]
|
/external/clang/unittests/AST/ |
D | EvaluateAsRValueTest.cpp | 43 bool VisitVarDecl(const clang::VarDecl *VD) { in VisitVarDecl() argument 44 if (const clang::Expr *Init = VD->getInit()) { in VisitVarDecl() 46 bool WasEvaluated = Init->EvaluateAsRValue(Result, VD->getASTContext()); in VisitVarDecl() 47 VarInfo[VD->getNameAsString()] = WasEvaluated; in VisitVarDecl() 48 EXPECT_EQ(WasEvaluated, Init->isConstantInitializer(VD->getASTContext(), in VisitVarDecl()
|
/external/llvm/unittests/ProfileData/ |
D | InstrProfTest.cpp | 248 std::unique_ptr<InstrProfValueData[]> VD = in TEST_P() local 251 ASSERT_EQ(3U, VD[0].Count); in TEST_P() 252 ASSERT_EQ(2U, VD[1].Count); in TEST_P() 253 ASSERT_EQ(1U, VD[2].Count); in TEST_P() 256 ASSERT_EQ(StringRef((const char *)VD[0].Value, 7), StringRef("callee3")); in TEST_P() 257 ASSERT_EQ(StringRef((const char *)VD[1].Value, 7), StringRef("callee2")); in TEST_P() 258 ASSERT_EQ(StringRef((const char *)VD[2].Value, 7), StringRef("callee1")); in TEST_P() 391 std::unique_ptr<InstrProfValueData[]> VD = in TEST_P() local 393 ASSERT_EQ(30U, VD[0].Count); in TEST_P() 394 ASSERT_EQ(20U, VD[1].Count); in TEST_P() [all …]
|
/external/clang/unittests/Tooling/ |
D | QualTypeNamesTest.cpp | 25 bool VisitValueDecl(const ValueDecl *VD) { in VisitValueDecl() 27 ExpectedQualTypeNames.lookup(VD->getNameAsString()); in VisitValueDecl() 30 TypeName::getFullyQualifiedName(VD->getType(), *Context, in VisitValueDecl() 36 << VD->getQualifiedNameAsString() << std::endl in VisitValueDecl()
|
/external/clang/lib/CodeGen/ |
D | CGDebugInfo.cpp | 1418 if (const auto *VD = dyn_cast<VarDecl>(D)) in CollectTemplateParams() local 1419 V = CGM.GetAddrOfGlobalVar(VD); in CollectTemplateParams() 2639 void CGDebugInfo::collectVarDeclProps(const VarDecl *VD, llvm::DIFile *&Unit, in collectVarDeclProps() argument 2643 Unit = getOrCreateFile(VD->getLocation()); in collectVarDeclProps() 2644 LineNo = getLineNumber(VD->getLocation()); in collectVarDeclProps() 2646 setLocation(VD->getLocation()); in collectVarDeclProps() 2648 T = VD->getType(); in collectVarDeclProps() 2658 Name = VD->getName(); in collectVarDeclProps() 2659 if (VD->getDeclContext() && !isa<FunctionDecl>(VD->getDeclContext()) && in collectVarDeclProps() 2660 !isa<ObjCMethodDecl>(VD->getDeclContext())) in collectVarDeclProps() [all …]
|
D | ModuleBuilder.cpp | 133 void HandleCXXStaticMemberVarInstantiation(VarDecl *VD) override { in HandleCXXStaticMemberVarInstantiation() argument 137 Builder->HandleCXXStaticMemberVarInstantiation(VD); in HandleCXXStaticMemberVarInstantiation() 218 if (VarDecl *VD = dyn_cast<VarDecl>(Member)) { in HandleTagDeclDefinition() local 219 if (Ctx->isMSStaticDataMemberInlineDefinition(VD) && in HandleTagDeclDefinition() 220 Ctx->DeclMustBeEmitted(VD)) { in HandleTagDeclDefinition() 221 Builder->EmitGlobal(VD); in HandleTagDeclDefinition()
|
/external/clang/include/clang/StaticAnalyzer/Checkers/ |
D | SValExplainer.h | 175 const VarDecl *VD = R->getDecl(); in VisitVarRegion() local 176 std::string Name = VD->getQualifiedNameAsString(); in VisitVarRegion() 177 if (isa<ParmVarDecl>(VD)) in VisitVarRegion() 179 else if (VD->hasLocalStorage()) in VisitVarRegion() 181 else if (VD->isStaticLocal()) in VisitVarRegion() 183 else if (VD->hasGlobalStorage()) in VisitVarRegion()
|
/external/clang/lib/ARCMigrate/ |
D | TransAutoreleasePool.cpp | 172 if (VarDecl *VD = dyn_cast<VarDecl>(DclS->getSingleDecl())) { in VisitCompoundStmt() local 173 if (isNSAutoreleasePool(VD->getType())) { in VisitCompoundStmt() 174 PoolVarInfo &info = PoolVars[VD]; in VisitCompoundStmt() 176 collectRefs(VD, S, info.Refs); in VisitCompoundStmt() 179 if (isPoolCreation(VD->getInit())) { in VisitCompoundStmt() 181 Scopes.back().PoolVar = VD; in VisitCompoundStmt() 190 if (VarDecl *VD = dyn_cast<VarDecl>(dref->getDecl())) { in VisitCompoundStmt() local 193 if (isNSAutoreleasePool(VD->getType()) && in VisitCompoundStmt() 196 Scopes.back().PoolVar = VD; in VisitCompoundStmt()
|
/external/clang/lib/Frontend/Rewrite/ |
D | RewriteObjC.cpp | 277 ValueDecl *VD, bool def=false); 286 void RewriteBlockPointerTypeVariable(std::string& Str, ValueDecl *VD); 289 void RewriteTypeOfDecl(VarDecl *VD); 316 void RewriteBlockPointerDecl(NamedDecl *VD); 317 void RewriteByRefVar(VarDecl *VD); 318 Stmt *RewriteBlockDeclRefExpr(DeclRefExpr *VD); 375 std::string SynthesizeByrefCopyDestroyHelper(VarDecl *VD, int flag); 1504 ValueDecl *VD = cast<ValueDecl>(DR->getDecl()); in RewriteObjCForCollectionStmt() local 1505 if (VD->getType()->isObjCQualifiedIdType() || in RewriteObjCForCollectionStmt() 1506 VD->getType()->isObjCQualifiedInterfaceType()) in RewriteObjCForCollectionStmt() [all …]
|
/external/clang/include/clang/Analysis/Analyses/ |
D | ThreadSafetyCommon.h | 105 void handleDestructorCall(const VarDecl *VD, const CXXDestructorDecl *DD) {} in handleDestructorCall() argument 197 VarDecl *VD = const_cast<VarDecl*>(AD.getVarDecl()); in walk() local 198 V.handleDestructorCall(VD, DD); in walk() 449 void handleDestructorCall(const VarDecl *VD, const CXXDestructorDecl *DD); 460 til::SExpr *getCurrentLVarDefinition(const ValueDecl *VD); 463 const ValueDecl *VD = nullptr); 464 til::SExpr *lookupVarDecl(const ValueDecl *VD); 465 til::SExpr *addVarDecl(const ValueDecl *VD, til::SExpr *E); 466 til::SExpr *updateVarDecl(const ValueDecl *VD, til::SExpr *E);
|