[PATCH] D26515: [clang-move] Abstract a ClassMather for matching class declarations.

Eric Liu via cfe-commits cfe-commits at lists.llvm.org
Thu Nov 10 11:52:37 PST 2016


ioeric added inline comments.


================
Comment at: clang-move/ClangMove.cpp:144
+  void run(const ast_matchers::MatchFinder::MatchResult &Result) override {
+    if (const auto *CMD =
+            Result.Nodes.getNodeAs<clang::CXXMethodDecl>("class_method")) {
----------------
hokein wrote:
> ioeric wrote:
> > It'd be more readable if you pull each case below into a helper function.
> hmm, I'd prefer current way. Because I don't see significant advantage by pulling each case into a helper function, since the code for each condition is used only once. 
>  
Generally, we prefer short functions to long functions. 


================
Comment at: clang-move/ClangMove.cpp:139
 
+class ClassDeclarationMatcher : public MatchFinder::MatchCallback {
+public:
----------------
Why is this called a Matcher?


https://reviews.llvm.org/D26515





More information about the cfe-commits mailing list