[PATCH] D37291: [refactor] Use a RefactoringResultConsumer instead of tagged refactoring rule classes
    Eric Liu via Phabricator via cfe-commits 
    cfe-commits at lists.llvm.org
       
    Wed Aug 30 07:51:18 PDT 2017
    
    
  
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;
+};
----------------
I think this interface is specific to some refactoring rules and should be pushed down to derived classes.
================
Comment at: unittests/Tooling/RefactoringActionRulesTest.cpp:39
+  class Consumer final : public RefactoringResultConsumer {
+    void handleInitiationFailure() {
+      Result = Expected<Optional<AtomicChanges>>(None);
----------------
Can we probably have default error handling in the base class so that we don't need to re-implement these for every derived consumer. I would expect the error handling for initiation and invocation to be similar in different consumers.
Repository:
  rL LLVM
https://reviews.llvm.org/D37291
    
    
More information about the cfe-commits
mailing list