[clang] [Clang] [NFC] Refactor more AST visitors (PR #116823)

via cfe-commits cfe-commits at lists.llvm.org
Thu Nov 28 12:12:10 PST 2024


================
@@ -266,7 +265,7 @@ class RenameLocFinder : public RecursiveASTVisitor<RenameLocFinder> {
     return true;
   }
 
-  bool VisitDeclRefExpr(const DeclRefExpr *Expr) {
----------------
Sirraide wrote:

> How hard do you think it would be to introduce something like `MutableDynamicRecursiveASTVisitor` and preserve constness where possible?

I mean, it would basically just involve copy-pasting the entire DRAV interface+implementation and adding `const` everywhere; personally, I don’t really think it’s worth it because there aren’t that many visitors that were using `const` in the first place, and the entire RAV implementation also isn’t `const` to begin with...

https://github.com/llvm/llvm-project/pull/116823


More information about the cfe-commits mailing list