[PATCH] D80697: [clang-tidy] Reworked TransformerClangTidyCheck to simplify usage of Options

Nathan James via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri May 29 03:45:34 PDT 2020


njames93 added a comment.

There are a few reasons for using the virtual method:

- It keeps everything contained in the one class.
- In the case where options are needed it avoid extra work in the derived class.
- It's consistent with how all base class checks handle the specifics of derived checks.



================
Comment at: clang-tools-extra/clang-tidy/utils/TransformerClangTidyCheck.h:62
-  // of the language or clang-tidy options.
-  TransformerClangTidyCheck(transformer::RewriteRule R, StringRef Name,
-                            ClangTidyContext *Context);
----------------
ymandel wrote:
> Why delete this? It is the most commonly used constructor and cleaner than the OOP goop of the virtual method.
I'll add that back in, but I feel this constructor is no different in most cases to just placing the rule builder in the virtual method


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D80697/new/

https://reviews.llvm.org/D80697





More information about the cfe-commits mailing list