Home
last modified time | relevance | path

Searched refs:DeclRef (Results 1 – 25 of 26) sorted by relevance

12

/llvm-project/clang-tools-extra/clang-tidy/google/
H A DExplicitMakePairCheck.cpp41 const auto *DeclRef = Result.Nodes.getNodeAs<DeclRefExpr>("declref"); in check() local
57 SourceRange(DeclRef->getBeginLoc(), DeclRef->getLAngleLoc()), in check()
63 SourceRange(DeclRef->getLAngleLoc(), DeclRef->getRAngleLoc())); in check()
/llvm-project/clang-tools-extra/clang-tidy/bugprone/
H A DUseAfterMoveCheck.cpp36 const DeclRefExpr *DeclRef; member
133 BlockMap->blockContainingStmt(TheUseAfterMove->DeclRef)) { in find()
192 TheUseAfterMove.DeclRef = Use; in findInternal()
234 for (const DeclRefExpr *DeclRef : DeclRefs) { in getUsesAndReinits()
235 if (!ReinitDeclRefs.count(DeclRef)) in getUsesAndReinits()
236 Uses->push_back(DeclRef); in getUsesAndReinits()
277 const auto *DeclRef = Match.getNodeAs<DeclRefExpr>("declref"); in getDeclRefs()
279 if (DeclRef && BlockMap->blockContainingStmt(DeclRef) == Block) { in getDeclRefs()
282 if (Operator || !isStandardSmartPointer(DeclRef in getDeclRefs()
231 for (const DeclRefExpr *DeclRef : DeclRefs) { getUsesAndReinits() local
274 const auto *DeclRef = Match.getNodeAs<DeclRefExpr>("declref"); getDeclRefs() local
[all...]
H A DSuspiciousReallocUsageCheck.cpp71 if (const auto *DeclRef = dyn_cast<DeclRefExpr>(E->IgnoreParenCasts())) in isAccessForVar() local
72 return DeclRef->getDecl() && in isAccessForVar()
73 DeclRef->getDecl()->getCanonicalDecl() == Var && in isAccessForVar()
142 if (const auto *DeclRef = in check() local
144 if (const auto *Var = dyn_cast<VarDecl>(DeclRef->getDecl())) in check()
147 if (FindAssignToVarBefore{Var, DeclRef, SM}.Visit(Func->getBody())) in check()
H A DUnsafeFunctionsCheck.cpp263 const auto *DeclRef = Result.Nodes.getNodeAs<DeclRefExpr>(DeclRefId);
264 const auto *FuncDecl = cast<FunctionDecl>(DeclRef->getDecl());
265 assert(DeclRef && FuncDecl && "No valid matched node in check()");
289 diag(DeclRef->getExprLoc(), "function %0 %1; it should not be used")
291 << DeclRef->getSourceRange();
293 diag(DeclRef->getExprLoc(),
296 << DeclRef->getSourceRange();
326 diag(DeclRef->getExprLoc(), "function %0 %1; '%2' should be used instead")
328 << ReplacementFunctionName.value() << DeclRef->getSourceRange();
185 const auto *DeclRef = Result.Nodes.getNodeAs<DeclRefExpr>(DeclRefId); check() local
/llvm-project/clang/include/clang/AST/
H A DPropertiesBase.td87 def DeclRef : RefPropertyType<"Decl"> { let ConstWhenWriting = 1; }
89 SubclassPropertyType<"CXXRecordDecl", DeclRef>;
91 SubclassPropertyType<"FunctionDecl", DeclRef>;
93 SubclassPropertyType<"NamedDecl", DeclRef>;
95 SubclassPropertyType<"NamespaceDecl", DeclRef>;
97 SubclassPropertyType<"NamespaceAliasDecl", DeclRef>;
99 SubclassPropertyType<"ObjCProtocolDecl", DeclRef>;
101 SubclassPropertyType<"ObjCTypeParamDecl", DeclRef>;
103 SubclassPropertyType<"TagDecl", DeclRef>;
105 SubclassPropertyType<"TemplateDecl", DeclRef>;
[all...]
H A DTypeProperties.td393 def : Property<"declaration", DeclRef> {
416 def : Property<"declaration", DeclRef> {
557 def : Property<"declaration", DeclRef> {
611 def : Property<"declaration", DeclRef> {
818 def : Property<"associatedDecl", DeclRef> {
853 def : Property<"associatedDecl", DeclRef> {
972 def : Property<"declaration", DeclRef> {
/llvm-project/clang-tools-extra/clang-tidy/readability/
H A DElseAfterReturnCheck.cpp52 if (const auto *DeclRef = dyn_cast<DeclRefExpr>(Node)) { in findUsage() local
53 if (DeclRef->getDecl()->getID() == DeclIdentifier) in findUsage()
54 return DeclRef; in findUsage()
69 if (const auto *DeclRef = dyn_cast<DeclRefExpr>(Node)) { in findUsageRange() local
70 if (llvm::is_contained(DeclIdentifiers, DeclRef->getDecl()->getID())) in findUsageRange()
71 return DeclRef; in findUsageRange()
H A DUseAnyOfAllOfCheck.cpp81 return llvm::none_of(Matches, [&Mutations](auto &DeclRef) { in isViableLoop() argument
84 DeclRef.template getNodeAs<DeclRefExpr>("decl_ref")->getDecl()); in isViableLoop()
/llvm-project/clang-tools-extra/clang-tidy/utils/
H A DDeclRefExprUtils.h56 bool isCopyConstructorArgument(const DeclRefExpr &DeclRef, const Decl &Decl,
61 bool isCopyAssignmentArgument(const DeclRefExpr &DeclRef, const Decl &Decl,
H A DDeclRefExprUtils.cpp395 bool isCopyConstructorArgument(const DeclRefExpr &DeclRef, const Decl &Decl, in isCopyConstructorArgument() argument
398 declRefExpr(equalsNode(&DeclRef)), in isCopyConstructorArgument()
409 bool isCopyAssignmentArgument(const DeclRefExpr &DeclRef, const Decl &Decl, in isCopyAssignmentArgument() argument
412 declRefExpr(equalsNode(&DeclRef)), in isCopyAssignmentArgument()
H A DRenamerClangTidyCheck.cpp277 bool VisitDeclRefExpr(DeclRefExpr *DeclRef) { in VisitDeclRefExpr() argument
278 SourceRange Range = DeclRef->getNameInfo().getSourceRange(); in VisitDeclRefExpr()
279 Check->addUsage(DeclRef->getDecl(), Range, SM); in VisitDeclRefExpr()
/llvm-project/clang-tools-extra/clang-tidy/misc/
H A DThrowByValueCatchByReferenceCheck.cpp80 auto *DeclRef = dyn_cast<DeclRefExpr>(Inner); in diagnoseThrowLocations() local
81 if (DeclRef && isCatchVariable(DeclRef)) { in diagnoseThrowLocations()
H A DUnusedParametersCheck.cpp105 bool WalkUpFromDeclRefExpr(DeclRefExpr *DeclRef) { in WalkUpFromCallExpr()
106 if (const auto *Fn = dyn_cast<FunctionDecl>(DeclRef->getDecl())) { in WalkUpFromCallExpr()
108 Index[Fn].OtherRefs.insert(DeclRef); in WalkUpFromCallExpr()
91 WalkUpFromDeclRefExpr(DeclRefExpr * DeclRef) WalkUpFromDeclRefExpr() argument
/llvm-project/clang-tools-extra/clangd/refactor/tweaks/
H A DExtractVariable.cpp80 bool VisitDeclRefExpr(DeclRefExpr *DeclRef) { // NOLINT in computeReferencedDecls()
84 llvm::dyn_cast<CXXMethodDecl>(DeclRef->getDecl()); in computeReferencedDecls()
88 ReferencedDecls.push_back(DeclRef->getDecl()); in computeReferencedDecls()
409 // Find the CallExpr whose callee is the (possibly wrapped) DeclRef in getCallExpr()
410 const SelectionTree::Node *getCallExpr(const SelectionTree::Node *DeclRef) { in getCallExpr()
411 const SelectionTree::Node &MaybeCallee = DeclRef->outerImplicit(); in getCallExpr()
79 VisitDeclRefExpr(DeclRefExpr * DeclRef) computeReferencedDecls() argument
406 getCallExpr(const SelectionTree::Node * DeclRef) getCallExpr() argument
/llvm-project/clang-tools-extra/clang-tidy/performance/
H A DUnnecessaryValueParamCheck.cpp41 bool hasLoopStmtAncestor(const DeclRefExpr &DeclRef, const Decl &Decl, in hasLoopStmtAncestor() argument
46 equalsNode(&DeclRef), in hasLoopStmtAncestor()
/llvm-project/clang-tools-extra/clang-tidy/modernize/
H A DLoopConvertUtils.cpp74 bool DependencyFinderASTVisitor::VisitDeclRefExpr(DeclRefExpr *DeclRef) { in VisitDeclRefExpr() argument
75 if (auto *V = dyn_cast_or_null<VarDecl>(DeclRef->getDecl())) in VisitDeclRefExpr()
127 bool DeclFinderASTVisitor::VisitDeclRefExpr(DeclRefExpr *DeclRef) { in VisitDeclRefExpr() argument
128 if (auto *D = dyn_cast<NamedDecl>(DeclRef->getDecl())) in VisitDeclRefExpr()
H A DAvoidBindCheck.cpp185 if (const auto *DeclRef = dyn_cast<DeclRefExpr>(Statement)) { in anyDescendantIsLocal() local
186 const ValueDecl *Decl = DeclRef->getDecl(); in anyDescendantIsLocal()
/llvm-project/clang/lib/Analysis/
H A DConsumed.cpp503 void VisitDeclRefExpr(const DeclRefExpr *DeclRef);
828 void ConsumedStmtVisitor::VisitDeclRefExpr(const DeclRefExpr *DeclRef) { in VisitCXXOperatorCallExpr()
829 if (const auto *Var = dyn_cast_or_null<VarDecl>(DeclRef->getDecl())) in VisitCXXOperatorCallExpr()
831 PropagationMap.insert(PairType(DeclRef, PropagationInfo(Var)));
832 VisitDeclRefExpr(const DeclRefExpr * DeclRef) VisitDeclRefExpr() argument
/llvm-project/clang-tools-extra/include-cleaner/unittests/
H A DWalkASTTest.cpp113 TEST(WalkAST, DeclRef) { in TEST() argument
/llvm-project/clang/lib/Sema/
H A DSemaCoroutine.cpp1261 if (auto *DeclRef = dyn_cast_or_null<DeclRefExpr>(E)) { in makeReturnOnAllocFailure()
1262 auto *Decl = DeclRef->getDecl(); in makeReturnOnAllocFailure()
1218 if (auto *DeclRef = dyn_cast_or_null<DeclRefExpr>(E)) { diagReturnOnAllocFailure() local
H A DSemaStmt.cpp1468 if (DeclRefExpr *DeclRef = dyn_cast<DeclRefExpr>(PrevCase)) { in ActOnFinishSwitchStmt()
1469 PrevString = DeclRef->getDecl()->getName(); in ActOnFinishSwitchStmt()
1471 if (DeclRefExpr *DeclRef = dyn_cast<DeclRefExpr>(CurrCase)) { in ActOnFinishSwitchStmt()
1472 CurrString = DeclRef->getDecl()->getName(); in ActOnFinishSwitchStmt()
1395 if (DeclRefExpr *DeclRef = dyn_cast<DeclRefExpr>(PrevCase)) { ActOnFinishSwitchStmt() local
1398 if (DeclRefExpr *DeclRef = dyn_cast<DeclRefExpr>(CurrCase)) { ActOnFinishSwitchStmt() local
H A DSema.cpp2557 if (const auto *DeclRef = dyn_cast<DeclRefExpr>(E.IgnoreParens())) { in tryExprAsCall()
2558 if (const auto *Fun = dyn_cast<FunctionDecl>(DeclRef->getDecl())) { in tryExprAsCall()
2537 if (const auto *DeclRef = dyn_cast<DeclRefExpr>(E.IgnoreParens())) { tryExprAsCall() local
H A DSemaExpr.cpp4321 if (const auto *DeclRef = dyn_cast<DeclRefExpr>(E->IgnoreParens())) { in CheckAlignOfExpr()
4322 if (const auto *PVD = dyn_cast<ParmVarDecl>(DeclRef->getFoundDecl())) { in CheckAlignOfExpr()
6706 ExprResult DeclRef = in BuildResolvedCallExpr()
6708 assert(DeclRef.isUsable() && "Builtin reference cannot fail"); in BuildResolvedCallExpr()
6711 BuildCallExpr(/*Scope=*/nullptr, DeclRef.get(), Loc, CallArgs, Loc); in BuildResolvedCallExpr()
17485 const DeclRefExpr *DeclRef = CheckPossibleDeref(*this, E); in HandleImmediateInvocations()
17486 if (DeclRef) { in HandleImmediateInvocations()
17487 const ValueDecl *Decl = DeclRef->getDecl(); in HandleImmediateInvocations()
17521 if (auto *DeclRef = in PopExpressionEvaluationContext()
17523 DeclRef in PopExpressionEvaluationContext()
4258 if (const auto *DeclRef = dyn_cast<DeclRefExpr>(E->IgnoreParens())) { CheckUnaryExprOrTypeTraitOperand() local
6580 ExprResult DeclRef = BuildBuiltinCallExpr() local
17167 const DeclRefExpr *DeclRef = CheckPossibleDeref(*this, E); WarnOnPendingNoDerefs() local
17203 if (auto *DeclRef = MarkExpressionAsImmediateEscalating() local
17208 } else if (auto *DeclRef = dyn_cast<DeclRefExpr>(E->IgnoreImplicit())) { MarkExpressionAsImmediateEscalating() local
17229 if (auto *DeclRef = CheckForImmediateInvocation() local
[all...]
/llvm-project/clang/unittests/ASTMatchers/
H A DASTMatchersTraversalTest.cpp996 auto DeclRef = declRefExpr(to(varDecl().bind("declOfArg"))).bind("arg"); in TEST_P()
999 callExpr(forEachArgumentWithParam(DeclRef, SelfParam)); in TEST_P()
1211 auto DeclRef = declRefExpr(to(varDecl().bind("declOfArg"))).bind("arg"); in TEST_P()
1214 callExpr(forEachArgumentWithParamType(DeclRef, SelfTy)); in TEST_P()
988 auto DeclRef = declRefExpr(to(varDecl().bind("declOfArg"))).bind("arg"); TEST_P() local
1203 auto DeclRef = declRefExpr(to(varDecl().bind("declOfArg"))).bind("arg"); TEST_P() local
/llvm-project/clang/lib/AST/
H A DExpr.cpp4153 if (DeclRefExpr *DeclRef = dyn_cast<DeclRefExpr>(E)) { in getEnumConstantDecl()
4154 if (FieldDecl *Field = dyn_cast<FieldDecl>(DeclRef->getDecl())) in getEnumConstantDecl()
4158 if (BindingDecl *BD = dyn_cast<BindingDecl>(DeclRef->getDecl())) in refersToVectorElement()
4124 if (DeclRefExpr *DeclRef = dyn_cast<DeclRefExpr>(E)) { getSourceBitField() local

12