[PATCH] Initial clang-tidy architecture

Manuel Klimek klimek at google.com
Tue Jun 4 01:09:22 PDT 2013


  I think this is fine as a first version.


================
Comment at: clang-tidy/ClangTidyModule.h:21
@@ +20,3 @@
+
+typedef std::pair<StringRef, ClangTidyCheck *> NamedCheck;
+typedef SmallVector<NamedCheck, 16> ClangTidyCheckVector;
----------------
Daniel Jasper wrote:
> Manuel Klimek wrote:
> > I'd probably use a getName() in ClangTidyCheck instead.
> The point is that I want this to be a configuration feature of the Module instead of an implementation detail of the check. I think we might arrive at a point where the same Check-class is used with slightly different options in several modules and thereby with different names.
Wouldn't that mean that it's even more strongly coupled to the Check class? Anyway, I don't feel too strongly about it.

================
Comment at: clang-tidy/ClangTidyModule.h:29
@@ +28,3 @@
+  virtual ~ClangTidyModule() {}
+  virtual void addChecks(ClangTidyCheckVector *Checks) = 0;
+};
----------------
Daniel Jasper wrote:
> Manuel Klimek wrote:
> > I don't think the typedef buys us much here, but I might be alone with my opinion...
> As you have just asked my to change it above and that change would already have required me to change more than a handful of instances, I think you have proven yourself wrong ;-).
Well, I don't consider changing 10 lines of code a big issue; when I say I think it doesn't buy us much, I think that it doesn't aid readability :P


http://llvm-reviews.chandlerc.com/D884



More information about the cfe-commits mailing list