ilya-biryukov added a comment.

An alternative approach I'm thinking of:
After D68977 <https://reviews.llvm.org/D68977> lands, we could try using 
`findExplicitReferences` to produce all of these edits:

1. we collect locations of all references and declaration of relevant 
parameters and template parameters.
2. find the ones where the name differs and produce the changes.

That would handle not only references in the default argument, but also all 
references in the body and should be less code overall.
IMO it's worth exploring this approach right away, e.g. you could layer your 
patch on top of the current version of D68977 <https://reviews.llvm.org/D68977>



================
Comment at: clang-tools-extra/clangd/refactor/tweaks/DefineInline.cpp:229
 
+/// Generates a replacement that renames \p Dest to \p Source.
+llvm::Error rewriteParameterName(tooling::Replacements &Replacements,
----------------
We only need name from the `Source`. Why not accept it as a `StringRef Name` 
directly?
Would allow to call this function even if `Source` is not a `NamedDecl`


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D68937/new/

https://reviews.llvm.org/D68937



_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to