[PATCH] D37291: [refactor] Use a RefactoringResultConsumer instead of tagged refactoring rule classes

Alex Lorenz via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Aug 30 08:20:37 PDT 2017


arphaman added inline comments.


================
Comment at: include/clang/Tooling/Refactoring/RefactoringResultConsumer.h:39
+  /// Handles the source replacements that are produced by a refactoring action.
+  virtual void handle(AtomicChanges SourceReplacements) = 0;
+};
----------------
ioeric wrote:
> I think this interface is specific to some refactoring rules and should be pushed down to derived classes.
Are you talking about derived classes of `RefactoringResultConsumer`? So something like

```
class RefactoringResultConsumer {
  virtual void handleInvocationError(llvm::Error Err) = 0;
};

class RefactoringResultSourceReplacementConsumer: RefactoringResultConsumer {
 virtual void handle(AtomicChanges SourceReplacements) = 0;
};
```

If yes, can you please clarify how the rule can call `handle` if it's in a subclass of `RefactoringResultConsumer`?



Repository:
  rL LLVM

https://reviews.llvm.org/D37291





More information about the cfe-commits mailing list