[PATCH] D36574: [refactor] add clang-refactor tool with initial testing support and local-rename action

Alex Lorenz via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Sep 8 00:51:17 PDT 2017


arphaman added inline comments.


================
Comment at: tools/clang-refactor/ClangRefactor.cpp:62
+  /// \returns true if an error occurred, false otherwise.
+  virtual bool refactorForEachSelection(
+      RefactoringRuleContext &Context,
----------------
ioeric wrote:
> I would expect the `SourceSelectionArgument` to be more like a container of ranges and further decoupled with the refactoring logic. Same for the `TestSelectionRangesInFile`.
> 
> How about an interface like this?
> ```
> template <typename T>
> void ForAllRanges(T callback) const;
> ```
Not sure I fully understand your interface suggestion, but I've tried to decouple some more in the updated patch.


Repository:
  rL LLVM

https://reviews.llvm.org/D36574





More information about the cfe-commits mailing list