================
@@ -85,6 +89,41 @@ void IdentifierLengthCheck::registerMatchers(MatchFinder 
*Finder) {
         this);
 }
 
+static unsigned countLinesToLastUse(const VarDecl *Var,
+                                    const SourceManager *SrcMgr,
+                                    ASTContext *Ctx) {
+  const unsigned DeclLine = SrcMgr->getSpellingLineNumber(Var->getLocation());
+
+  class VarUseCallback : public MatchFinder::MatchCallback {
----------------
dutkalex wrote:

Thanks for the feedback, I did not know about this helper function. I have made 
the change to use it. Since ``allDeclRefExprs`` does not directly return line 
numbers, I have used ``std::transform_reduce`` instead of ``max_element``. I'm 
not 100% sure however if I'm doing the right thing to get the ``Decl*`` 
representing the parent scope.

https://github.com/llvm/llvm-project/pull/185319
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to