ioeric 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;
+};
----------------
arphaman wrote:
> 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`?
> 
Sorry, I thought the `handle` interface was dispatched by template. 

Maybe we can have default implementation of rule-specific handlers, e.g. 
generate errors, in the base class? Derived classes can implement handlers that 
they care about and ignore others.


Repository:
  rL LLVM

https://reviews.llvm.org/D37291



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

Reply via email to