[PATCH] D39332: [clang-refactor] Introduce "local-qualified-rename" action.

Alex Lorenz via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Oct 27 10:56:29 PDT 2017


arphaman added a comment.

I've committed https://reviews.llvm.org/D38985, so you'd have to rebase unfortunately. Things are still somewhat unstable :)



================
Comment at: lib/Tooling/Refactoring/Rename/RenamingAction.cpp:154
+
+class LocalQualifiedRename final : public RefactoringAction {
+public:
----------------
hokein wrote:
> sammccall wrote:
> > As discussed offline, it's not clear why this is a separate Action, rather than a different Rule that's part of the same Action.
> > 
> > @arphaman how does the framework answer this question?
> There is a [document](https://clang.llvm.org/docs/RefactoringEngine.html#refactoring-action-rules) describing it, but still ambiguous.
> 
> We also had some questions about `local-rename` from the discussion, need @arphaman's input:
> 
> * `OccurrenceFinder` is not exposed now, it is merely used in `RenameOccurrences`. We think there should be a public interface to the clients, like for implementing interactive mode in IDE? 
> * Currently the rules defined in the same action must have mutual command-line options, otherwise clang-refactor would complain the command-line option are being registered more than once. It might be very strict for some cases. For example, `-new-name` is most likely being used by many rules in `local-rename` action.
>  
I think that this should be just a rule in `local-rename`.

So you'd be able to call:

`clang-refactor local-rename -selection=X -new-name=foo`
`clang-refactor local-rename -old-qualified-name=bar -new-name=foo`.


https://reviews.llvm.org/D39332





More information about the cfe-commits mailing list