Move the RewriteRule class and related declarations into its own set of files
(header, implementation). Only the Transformer class is left in the
Transformer-named files. This change clarifies the distinction between the
RewriteRule class, which is essential to the Transformer library, and the
Transformer class, which is only one possible RewriteRule interpreter
(compare to TransformerClangTidyCheck, a clang-tidy based interpreter).
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
clang/include/clang/Tooling/Transformer/Transformer.h | ||
---|---|---|
58 | I'm not a fan of umbrella headers... especially if they don't cover everything. I think "include what you use" is a better rule. The rest of the patch makes sense to me, just not this file. (OK to keep it temporarily if we need it to help clients migrate, of course.) |
clang/include/clang/Tooling/Transformer/Transformer.h | ||
---|---|---|
58 | Thanks, sounds good. In that case, might it make more sense to just split off RewriteRule and not rename Transformer -> TransformerTool (along w/ the correpsonding header change)? My primary motivation for renaming the class was to allow Transformer to be the name for the umbrella. Since Transformer.h will have to include RewriteRule.h anyhow, there won't be any need for a forwarding header while we update users. |
clang/include/clang/Tooling/Transformer/Transformer.h | ||
---|---|---|
58 | I've uploaded a new diff w/ these changes. I also split the implementation file, which I'd forgotten to do previously. I've left the test in one file because testing the RewriteRule code w/o Transformer is somewhat complicated. It's probably worth doing that work, but doesn't seem critical at this point just for the sake of somewhat more independent unit tests. |
I'm not a fan of umbrella headers... especially if they don't cover everything.
I think "include what you use" is a better rule.
The rest of the patch makes sense to me, just not this file. (OK to keep it temporarily if we need it to help clients migrate, of course.)