[PATCH] D13079: [clang-tidy] Code factorization and cleanup in IdentifierNamingCheck

Alexander Kornienko via cfe-commits cfe-commits at lists.llvm.org
Fri Sep 25 09:56:13 PDT 2015


alexfh accepted this revision.
alexfh added a comment.
This revision is now accepted and ready to land.

Looks good with a few comments.

Please tell me, if you need me to commit the patch for you after you address the comments.


================
Comment at: clang-tidy/readability/IdentifierNamingCheck.cpp:574
@@ -578,2 +573,3 @@
         Diag << FixItHint::CreateReplacement(
-            CharSourceRange::getTokenRange(Range), Failure.Fixup);
+            SourceRange(SourceLocation::getFromRawEncoding(Loc)),
+            Failure.Fixup);
----------------
This change assumes that the name is always represented by a single token. Please add a comment explaining why this can be done.

================
Comment at: clang-tidy/readability/IdentifierNamingCheck.h:65
@@ -64,7 +64,3 @@
 
-private:
-  std::vector<NamingStyle> NamingStyles;
-  bool IgnoreFailedSplit;
-
   struct NamingCheckFailure {
     std::string KindName;
----------------
Please add a comment for this struct. Especially for the `RawUsageLocs` field.

================
Comment at: clang-tidy/readability/IdentifierNamingCheck.h:73
@@ -76,2 +72,3 @@
   };
+  typedef llvm::DenseMap<const NamedDecl *, NamingCheckFailure> NamingCheckFailureMap;
 
----------------
80 character limit.


http://reviews.llvm.org/D13079





More information about the cfe-commits mailing list