/external/clang/lib/Analysis/ |
D | PseudoConstantAnalysis.cpp | 41 bool PseudoConstantAnalysis::isPseudoConstant(const VarDecl *VD) { in isPseudoConstant() argument 43 if (!VD->hasLocalStorage() && !VD->isStaticLocal()) in isPseudoConstant() 53 return !NonConstants->count(VD); in isPseudoConstant() 57 bool PseudoConstantAnalysis::wasReferenced(const VarDecl *VD) { in wasReferenced() argument 65 return UsedVars->count(VD); in wasReferenced() 124 const VarDecl *VD = dyn_cast<VarDecl>(LHSDecl); in RunAnalysis() local 126 if (VD) in RunAnalysis() 127 NonConstants->insert(VD); in RunAnalysis() 158 const VarDecl *VD = dyn_cast<VarDecl>(D); in RunAnalysis() local 159 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 (Expr *Init = VD->getInit()) { in getSelfInitExpr() 353 = dyn_cast<DeclRefExpr>(stripCasts(VD->getASTContext(), Init)); in getSelfInitExpr() [all …]
|
D | LiveVariables.cpp | 307 if (const VarDecl *VD = dyn_cast<VarDecl>(DS->getSingleDecl())) { in Visit() local 308 for (const VariableArrayType* VA = FindVA(VD->getType()); in Visit() 358 if (const VarDecl *VD = dyn_cast<VarDecl>(DR->getDecl())) { in VisitBinaryOperator() local 360 if (VD->getType()->isReferenceType()) in VisitBinaryOperator() 363 if (!isAlwaysAlive(VD)) { in VisitBinaryOperator() 365 val.liveDecls = LV.DSetFact.remove(val.liveDecls, VD); in VisitBinaryOperator() 379 const VarDecl *VD = *I; in VisitBlockExpr() local 380 if (isAlwaysAlive(VD)) in VisitBlockExpr() 382 val.liveDecls = LV.DSetFact.add(val.liveDecls, VD); in VisitBlockExpr() 395 if (VarDecl *VD = dyn_cast<VarDecl>(*DI)) { in VisitDeclStmt() local [all …]
|
D | AnalysisDeclContext.cpp | 128 const VarDecl *VD = it->getVariable(); in getSelfDecl() local 129 if (VD->getName() == "self") in getSelfDecl() 130 return dyn_cast<ImplicitParamDecl>(VD); in getSelfDecl() 402 bool IsTrackedDecl(const VarDecl *VD) { in IsTrackedDecl() argument 403 const DeclContext *DC = VD->getDeclContext(); in IsTrackedDecl() 415 if (const VarDecl *VD = dyn_cast<VarDecl>(DR->getDecl())) { in VisitDeclRefExpr() local 416 if (!VD->hasLocalStorage()) { in VisitDeclRefExpr() 417 if (Visited.insert(VD)) in VisitDeclRefExpr() 418 BEVals.push_back(VD, BC); in VisitDeclRefExpr()
|
D | CFG.cpp | 35 if (VarDecl *VD = dyn_cast<VarDecl>(D)) in GetEndLoc() local 36 if (Expr *Ex = VD->getInit()) in GetEndLoc() 184 void addVar(VarDecl *VD) { in addVar() argument 185 Vars.push_back(VD, ctx); in addVar() 444 LocalScope* addLocalScopeForVarDecl(VarDecl *VD, LocalScope* Scope = NULL); 469 void appendAutomaticObjDtor(CFGBlock *B, VarDecl *VD, Stmt *S) { in appendAutomaticObjDtor() argument 470 B->appendAutomaticObjDtor(VD, S, cfg->getBumpVectorContext()); in appendAutomaticObjDtor() 951 if (VarDecl *VD = dyn_cast<VarDecl>(*DI)) in addLocalScopeForDeclStmt() local 952 Scope = addLocalScopeForVarDecl(VD, Scope); in addLocalScopeForDeclStmt() 960 LocalScope* CFGBuilder::addLocalScopeForVarDecl(VarDecl *VD, in addLocalScopeForVarDecl() argument [all …]
|
/external/clang/lib/AST/ |
D | StmtIterator.cpp | 44 if (VarDecl* VD = dyn_cast<VarDecl>(decl)) in NextVA() local 45 if (VD->Init) in NextVA() 51 if (VarDecl* VD = dyn_cast<VarDecl>(*DGI)) in NextVA() local 52 if (VD->Init) in NextVA() 92 if (VarDecl* VD = dyn_cast<VarDecl>(D)) { in HandleDecl() local 93 if (const VariableArrayType* VAPtr = FindVA(VD->getType().getTypePtr())) { in HandleDecl() 98 if (VD->getInit()) in HandleDecl() 142 VarDecl* VD = cast<VarDecl>(*DGI); in GetDeclExpr() local 143 return *VD->getInitAddress(); in GetDeclExpr() 148 if (VarDecl* VD = dyn_cast<VarDecl>(decl)) { in GetDeclExpr() local [all …]
|
D | APValue.cpp | 369 if (const ValueDecl *VD = Base.dyn_cast<const ValueDecl*>()) in printPretty() local 370 Out << *VD; in printPretty() 388 if (const ValueDecl *VD = Base.dyn_cast<const ValueDecl*>()) { in printPretty() local 389 Out << *VD; in printPretty() 390 ElemTy = VD->getType(); in printPretty() 409 const ValueDecl *VD = cast<ValueDecl>(BaseOrMember); in printPretty() local 413 Out << *VD; in printPretty() 414 ElemTy = VD->getType(); in printPretty() 490 if (const ValueDecl *VD = getMemberPointerDecl()) { in printPretty() local 491 Out << '&' << *cast<CXXRecordDecl>(VD->getDeclContext()) << "::" << *VD; in printPretty()
|
/external/clang/lib/StaticAnalyzer/Checkers/ |
D | DeadStoresChecker.cpp | 202 void CheckVarDecl(const VarDecl *VD, const Expr *Ex, const Expr *Val, in CheckVarDecl() argument 206 if (!VD->hasLocalStorage()) in CheckVarDecl() 210 if (VD->getType()->getAs<ReferenceType>()) in CheckVarDecl() 213 if (!isLive(Live, VD) && in CheckVarDecl() 214 !(VD->getAttr<UnusedAttr>() || VD->getAttr<BlocksAttr>())) { in CheckVarDecl() 218 Report(VD, dsk, ExLoc, Val->getSourceRange()); in CheckVarDecl() 224 if (const VarDecl *VD = dyn_cast<VarDecl>(DR->getDecl())) in CheckDeclRef() local 225 CheckVarDecl(VD, DR, Val, dsk, Live); in CheckDeclRef() 228 bool isIncrement(VarDecl *VD, const BinaryOperator* B) { in isIncrement() argument 241 if (DR->getDecl() == VD) in isIncrement() [all …]
|
D | UndefCapturedBlockVarChecker.cpp | 38 const VarDecl *VD) { in FindBlockDeclRefExpr() argument 40 if (BR->getDecl() == VD) in FindBlockDeclRefExpr() 46 const DeclRefExpr *BR = FindBlockDeclRefExpr(child, VD); in FindBlockDeclRefExpr() 72 const VarDecl *VD = VR->getDecl(); in checkPostStmt() local 74 if (VD->getAttr<BlocksAttr>() || !VD->hasLocalStorage()) in checkPostStmt() 88 os << "Variable '" << VD->getName() in checkPostStmt() 92 if (const Expr *Ex = FindBlockDeclRefExpr(BE->getBody(), VD)) in checkPostStmt()
|
D | IdempotentOperationChecker.cpp | 478 const VarDecl *VD = dyn_cast<VarDecl>(LHS_DR->getDecl()); in isSelfAssign() local 479 if (!VD) in isSelfAssign() 486 if (VD != RHS_DR->getDecl()) in isSelfAssign() 503 const VarDecl *VD = dyn_cast<VarDecl>(DR->getDecl()); in isUnused() local 504 if (!VD) in isUnused() 507 if (AC->getPseudoConstantAnalysis()->wasReferenced(VD)) in isUnused() 522 const VarDecl *VD = dyn_cast<VarDecl>(LHS_DR->getDecl()); in isTruncationExtensionAssignment() local 523 if (!VD) in isTruncationExtensionAssignment() 530 if (VD != RHS_DR->getDecl()) in isTruncationExtensionAssignment() 712 const VarDecl *VD = dyn_cast<VarDecl>(DR->getDecl()); in isConstantOrPseudoConstant() local [all …]
|
D | LLVMConventionsChecker.cpp | 132 void VisitVarDecl(VarDecl *VD); 145 if (VarDecl *VD = dyn_cast<VarDecl>(*I)) in VisitDeclStmt() local 146 VisitVarDecl(VD); in VisitDeclStmt() 149 void StringRefCheckerVisitor::VisitVarDecl(VarDecl *VD) { in VisitVarDecl() argument 150 Expr *Init = VD->getInit(); in VisitVarDecl() 156 if (!IsLLVMStringRef(VD->getType())) in VisitVarDecl() 181 PathDiagnosticLocation::createBegin(VD, BR.getSourceManager()); in VisitVarDecl()
|
D | VLASizeChecker.cpp | 82 const VarDecl *VD = dyn_cast<VarDecl>(DS->getSingleDecl()); in checkPreStmt() local 83 if (!VD) in checkPreStmt() 87 const VariableArrayType *VLA = Ctx.getAsVariableArrayType(VD->getType()); in checkPreStmt() 147 state->getRegion(VD, LC)->getExtent(svalBuilder); in checkPreStmt()
|
D | UndefinedAssignmentChecker.cpp | 71 const VarDecl *VD = dyn_cast<VarDecl>(DS->getSingleDecl()); in checkBind() local 72 ex = VD->getInit(); in checkBind()
|
/external/clang/test/SemaCXX/ |
D | destructor.cpp | 192 struct VD: VB {}; struct 226 VD vd; use(vd); in nowarnstack() 255 VD* vd = new VD[4]; in nowarnarray() 282 VB* vb = new VD(); in nowarn0() 286 VD* vd = new VD(); in nowarn0() 320 simple_ptr<VB> vb(new VD()); in nowarn1() 324 simple_ptr<VD> vd(new VD()); in nowarn1()
|
/external/qemu/ |
D | ppc-dis.c | 829 #define VD VC + 1 macro 830 #define VS VD 834 #define SIMM VD + 1 2140 { "mfvscr", VX(4, 1540), VX_MASK, PPCVEC, { VD } }, 2177 { "vaddcuw", VX(4, 384), VX_MASK, PPCVEC, { VD, VA, VB } }, 2178 { "vaddfp", VX(4, 10), VX_MASK, PPCVEC, { VD, VA, VB } }, 2179 { "vaddsbs", VX(4, 768), VX_MASK, PPCVEC, { VD, VA, VB } }, 2180 { "vaddshs", VX(4, 832), VX_MASK, PPCVEC, { VD, VA, VB } }, 2181 { "vaddsws", VX(4, 896), VX_MASK, PPCVEC, { VD, VA, VB } }, 2182 { "vaddubm", VX(4, 0), VX_MASK, PPCVEC, { VD, VA, VB } }, [all …]
|
/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/Sema/ |
D | Sema.cpp | 352 if (const VarDecl *VD = dyn_cast<VarDecl>(D)) { in ShouldRemoveFromUnused() local 355 const VarDecl *DeclToCheck = VD->getDefinition(); in ShouldRemoveFromUnused() 361 DeclToCheck = VD->getMostRecentDecl(); in ShouldRemoveFromUnused() 362 if (DeclToCheck != VD) in ShouldRemoveFromUnused() 674 VarDecl *VD = (*T)->getActingDefinition(); in ActOnEndOfTranslationUnit() local 679 if (VD == 0 || VD->isInvalidDecl() || !Seen.insert(VD)) in ActOnEndOfTranslationUnit() 683 = Context.getAsIncompleteArrayType(VD->getType())) { in ActOnEndOfTranslationUnit() 684 if (RequireCompleteType(VD->getLocation(), in ActOnEndOfTranslationUnit() 687 VD->setInvalidDecl(); in ActOnEndOfTranslationUnit() 692 Diag(VD->getLocation(), diag::warn_tentative_incomplete_array); in ActOnEndOfTranslationUnit() [all …]
|
D | AnalysisBasedWarnings.cpp | 433 static bool SuggestInitializationFixit(Sema &S, const VarDecl *VD) { in SuggestInitializationFixit() argument 434 QualType VariableTy = VD->getType().getCanonicalType(); in SuggestInitializationFixit() 436 !VD->hasAttr<BlocksAttr>()) { in SuggestInitializationFixit() 437 S.Diag(VD->getLocation(), diag::note_block_var_fixit_add_initialization) << VD->getDeclName() in SuggestInitializationFixit() 438 << FixItHint::CreateInsertion(VD->getLocation(), "__block "); in SuggestInitializationFixit() 443 if (VD->getInit()) in SuggestInitializationFixit() 452 if (VD->getLocEnd().isMacroID()) in SuggestInitializationFixit() 455 SourceLocation Loc = S.PP.getLocForEndOfToken(VD->getLocEnd()); in SuggestInitializationFixit() 457 S.Diag(Loc, diag::note_var_fixit_add_initialization) << VD->getDeclName() in SuggestInitializationFixit() 491 static void DiagUninitUse(Sema &S, const VarDecl *VD, const UninitUse &Use, in DiagUninitUse() argument [all …]
|
D | JumpDiagnostics.cpp | 125 if (const VarDecl *VD = dyn_cast<VarDecl>(D)) { in GetDiagForGotoScopeDecl() local 127 if (VD->getType()->isVariablyModifiedType()) in GetDiagForGotoScopeDecl() 130 if (VD->hasAttr<BlocksAttr>()) in GetDiagForGotoScopeDecl() 134 if (VD->hasAttr<CleanupAttr>()) in GetDiagForGotoScopeDecl() 138 if (Context.getLangOpts().ObjCAutoRefCount && VD->hasLocalStorage()) { in GetDiagForGotoScopeDecl() 139 switch (VD->getType().getObjCLifetime()) { in GetDiagForGotoScopeDecl() 152 if (Context.getLangOpts().CPlusPlus && VD->hasLocalStorage()) { in GetDiagForGotoScopeDecl() 167 const Expr *Init = VD->getInit(); in GetDiagForGotoScopeDecl() 241 if (VarDecl *VD = dyn_cast<VarDecl>(D)) in BuildScopeInformation() local 242 if (Expr *Init = VD->getInit()) in BuildScopeInformation()
|
/external/clang/include/clang/Analysis/Analyses/ |
D | PseudoConstantAnalysis.h | 28 bool isPseudoConstant(const VarDecl *VD); 29 bool wasReferenced(const VarDecl *VD);
|
/external/clang/lib/Rewrite/Frontend/ |
D | RewriteObjC.cpp | 284 ValueDecl *VD, bool def=false); 293 void RewriteBlockPointerTypeVariable(std::string& Str, ValueDecl *VD); 296 void RewriteTypeOfDecl(VarDecl *VD); 323 void RewriteBlockPointerDecl(NamedDecl *VD); 324 void RewriteByRefVar(VarDecl *VD); 325 Stmt *RewriteBlockDeclRefExpr(DeclRefExpr *VD); 382 std::string SynthesizeByrefCopyDestroyHelper(VarDecl *VD, int flag); 1534 ValueDecl *VD = cast<ValueDecl>(DR->getDecl()); in RewriteObjCForCollectionStmt() local 1535 if (VD->getType()->isObjCQualifiedIdType() || in RewriteObjCForCollectionStmt() 1536 VD->getType()->isObjCQualifiedInterfaceType()) in RewriteObjCForCollectionStmt() [all …]
|
/external/clang/test/CodeGenCXX/ |
D | mangle-alias-template.cpp | 24 Vec<double> VD; in z() local 25 g(VD); in z()
|
/external/clang/lib/CodeGen/ |
D | CGExpr.cpp | 177 if (const VarDecl *VD = dyn_cast_or_null<VarDecl>(InitializedDecl)) { in CreateReferenceTemporary() local 178 if (VD->hasGlobalStorage()) { in CreateReferenceTemporary() 181 CGF.CGM.getCXXABI().getMangleContext().mangleReferenceTemporary(VD, Out); in CreateReferenceTemporary() 417 const VarDecl *VD = dyn_cast_or_null<VarDecl>(InitializedDecl); in EmitReferenceBindingToExpr() local 418 if (VD && VD->hasGlobalStorage()) { in EmitReferenceBindingToExpr() 459 bool precise = VD && VD->hasAttr<ObjCPreciseLifetimeAttr>(); in EmitReferenceBindingToExpr() 1645 if (const VarDecl *VD = dyn_cast<VarDecl>(Exp->getDecl())) { in setObjCGCLValueClass() local 1646 if (VD->hasGlobalStorage()) { in setObjCGCLValueClass() 1648 LV.setThreadLocalRef(VD->isThreadSpecified()); in setObjCGCLValueClass() 1725 const Expr *E, const VarDecl *VD) { in EmitGlobalVarDeclLValue() argument [all …]
|
D | CGDebugInfo.cpp | 2376 llvm::DIType CGDebugInfo::EmitTypeForVarWithBlocksAttr(const VarDecl *VD, in EmitTypeForVarWithBlocksAttr() argument 2384 llvm::DIFile Unit = getOrCreateFile(VD->getLocation()); in EmitTypeForVarWithBlocksAttr() 2385 QualType Type = VD->getType(); in EmitTypeForVarWithBlocksAttr() 2395 bool HasCopyAndDispose = CGM.getContext().BlockRequiresCopying(Type, VD); in EmitTypeForVarWithBlocksAttr() 2412 CharUnits Align = CGM.getContext().getDeclAlign(VD); in EmitTypeForVarWithBlocksAttr() 2436 FieldTy = DBuilder.createMemberType(Unit, VD->getName(), Unit, in EmitTypeForVarWithBlocksAttr() 2451 void CGDebugInfo::EmitDeclare(const VarDecl *VD, unsigned Tag, in EmitDeclare() argument 2457 llvm::DIFile Unit = getOrCreateFile(VD->getLocation()); in EmitDeclare() 2460 if (VD->hasAttr<BlocksAttr>()) in EmitDeclare() 2461 Ty = EmitTypeForVarWithBlocksAttr(VD, &XOffset); in EmitDeclare() [all …]
|
/external/clang/lib/StaticAnalyzer/Core/ |
D | CheckerHelpers.cpp | 55 if (const VarDecl *VD = dyn_cast<VarDecl>(DR->getDecl())) in containsStaticLocal() local 56 if (VD->isStaticLocal()) in containsStaticLocal()
|