Lines Matching defs:DRE
55 // Returns a string of ancestor `Stmt`s of the given `DRE` in such a form:
56 // "DRE ==> parent-of-DRE ==> grandparent-of-DRE ==> ...".
57 static std::string getDREAncestorString(const DeclRefExpr *DRE,
60 const Stmt *St = DRE;
349 // 1. `std::span<T>{new T[n], n}`, where `n` is a literal or a DRE
590 if (const auto *DRE =
592 Uses.push_back(DRE);
629 if (const auto *DRE =
631 return {DRE};
675 if (const auto *DRE =
677 return {DRE};
728 if (const auto *DRE = dyn_cast<DeclRefExpr>(Ptr->IgnoreParenImpCasts())) {
729 return {DRE};
773 if (auto *DRE = dyn_cast<DeclRefExpr>(Ctor->getArg(0))) {
774 if (isa<VarDecl>(DRE->getDecl()))
775 return {DRE};
1028 // Represents expressions of the form `DRE[*]` in the Unspecified Lvalue
1063 if (const auto *DRE =
1065 return {DRE};
1071 // Fixable gadget to handle stand alone pointers of the form `UPC(DRE)` in the
1073 // fixit of the form `UPC(DRE.data())`.
1143 // Represents expressions of the form `&DRE[any]` in the Unspecified Pointer
1150 const UnaryOperator *Node; // the `&DRE[any]` node
1179 const auto *DRE =
1181 return {DRE};
1205 // Start tracking a freshly discovered DRE.
1206 void discoverUse(const DeclRefExpr *DRE) { Uses->insert(DRE); }
1208 // Stop tracking the DRE as it's been fully figured out.
1209 void claimUse(const DeclRefExpr *DRE) {
1210 assert(Uses->count(DRE) &&
1211 "DRE not found or claimed by multiple matchers!");
1212 Uses->erase(DRE);
1218 return any_of(*Uses, [VD](const DeclRefExpr *DRE) {
1219 return DRE->getDecl()->getCanonicalDecl() == VD->getCanonicalDecl();
1273 // Although currently we can only provide fix-its when `Ptr` is a DRE, we
1408 if (const auto *DRE = Result.Nodes.getNodeAs<DeclRefExpr>("any_dre")) {
1409 Tracker.discoverUse(DRE);
1518 for (const DeclRefExpr *DRE : ClaimedVarUseSites) {
1519 if (const auto *VD = dyn_cast<VarDecl>(DRE->getDecl())) {
1547 for (const DeclRefExpr *DRE : DREs) {
1548 if (const auto *VD = dyn_cast<VarDecl>(DRE->getDecl())) {
1607 /// \returns fixit that adds .data() call after \DRE.
1609 const DeclRefExpr *DRE);
1675 if (const auto *DRE =
1677 if (const auto *VD = dyn_cast<VarDecl>(DRE->getDecl())) {
2052 const DeclRefExpr *DRE) {
2054 // Inserts the .data() after the DRE
2056 getPastLoc(DRE, SM, Ctx.getLangOpts());
2064 // Generates fix-its replacing an expression of the form UPC(DRE) with
2065 // `DRE.data()`
2086 // Generates fix-its replacing an expression of the form `&DRE[e]` with
2087 // `&DRE.data()[e]`:
2091 const auto *DRE = cast<DeclRefExpr>(ArraySub->getBase()->IgnoreImpCasts());
2094 const ASTContext &Ctx = DRE->getDecl()->getASTContext();
2104 std::optional<StringRef> DreString = getExprText(DRE, SM, LangOpts);
2128 return std::nullopt; // In cases of `Ptr += n` where `Ptr` is not a DRE, we
2170 return std::nullopt; // In cases of `++Ptr` where `Ptr` is not a DRE, we
3089 for (const auto *DRE : G->getClaimedVarUseSites()) {
3090 Tracker.claimUse(DRE);
3163 "' : has an unclaimed use\nThe unclaimed DRE trace: " +